Skip to content

Commit 340854c

Browse files
committed
Pass action type to action calls
1 parent 33855ac commit 340854c

8 files changed

Lines changed: 23 additions & 13 deletions

File tree

bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/OpenGradleTestReportAction.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import org.eclipse.ui.IEditorPart;
1919

2020
import io.openliberty.tools.eclipse.DevModeOperations;
21+
import io.openliberty.tools.eclipse.DevModeOperations.DashboardAction;
2122
import io.openliberty.tools.eclipse.logging.Trace;
2223
import io.openliberty.tools.eclipse.messages.Messages;
2324
import io.openliberty.tools.eclipse.model.ProjectModel;
@@ -115,7 +116,7 @@ public static void run(IProject iProject) throws Exception {
115116
}
116117

117118
// Resolve the target project taking into account only those that are actively running.
118-
ProjectModel targetProjectModel = devModeOps.resolveCommandTarget(selectedProjectModel, "View Gradle Test Report", DevModeOperations.ServerFilterMode.ACTIVE_ONLY);
119+
ProjectModel targetProjectModel = devModeOps.resolveCommandTarget(selectedProjectModel, DashboardAction.OPEN_GRADLE_TEST_REPORT, DevModeOperations.ServerFilterMode.ACTIVE_ONLY);
119120
if (targetProjectModel == null) {
120121
return;
121122
}
@@ -127,7 +128,7 @@ public static void run(IProject iProject) throws Exception {
127128
}
128129

129130
// Resolve the target project containing the test report to view.
130-
targetProjectModel = devModeOps.resolveTestReportTarget(targetProjectModel, "View Gradle Test Report");
131+
targetProjectModel = devModeOps.resolveTestReportTarget(targetProjectModel, DashboardAction.OPEN_GRADLE_TEST_REPORT);
131132
if (targetProjectModel == null) {
132133
return;
133134
}

bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/OpenMavenITestReportAction.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import org.eclipse.ui.IEditorPart;
1919

2020
import io.openliberty.tools.eclipse.DevModeOperations;
21+
import io.openliberty.tools.eclipse.DevModeOperations.DashboardAction;
2122
import io.openliberty.tools.eclipse.logging.Trace;
2223
import io.openliberty.tools.eclipse.messages.Messages;
2324
import io.openliberty.tools.eclipse.model.ProjectModel;
@@ -115,20 +116,21 @@ public static void run(IProject iProject) throws Exception {
115116
}
116117

117118
// Resolve the target project taking into account only those that are actively running.
118-
ProjectModel targetProjectModel = devModeOps.resolveCommandTarget(selectedProjectModel, "View Maven Integration Test Report",
119+
ProjectModel targetProjectModel = devModeOps.resolveCommandTarget(selectedProjectModel,
120+
DashboardAction.OPEN_MVN_IT_TEST_REPORT,
119121
DevModeOperations.ServerFilterMode.ACTIVE_ONLY);
120122
if (targetProjectModel == null) {
121123
return;
122124
}
123125

124-
// Update the active selection to the selected target project if the original selection does match the target.
126+
// Update the active project selection on the dashboard.
125127
String targetProjectName = targetProjectModel.getName();
126128
if (!selectedProjectName.equals(targetProjectName)) {
127129
Utils.updateActiveSelection(targetProjectModel);
128130
}
129131

130-
// Resolve the target project containing the test report to view.
131-
targetProjectModel = devModeOps.resolveTestReportTarget(targetProjectModel, "View Maven Integration Test Report");
132+
// Resolve the test report to view.
133+
targetProjectModel = devModeOps.resolveTestReportTarget(targetProjectModel, DashboardAction.OPEN_MVN_IT_TEST_REPORT);
132134
if (targetProjectModel == null) {
133135
// User cancelled the selection dialog
134136
return;

bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/OpenMavenUTestReportAction.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import org.eclipse.ui.IEditorPart;
1919

2020
import io.openliberty.tools.eclipse.DevModeOperations;
21+
import io.openliberty.tools.eclipse.DevModeOperations.DashboardAction;
2122
import io.openliberty.tools.eclipse.logging.Trace;
2223
import io.openliberty.tools.eclipse.messages.Messages;
2324
import io.openliberty.tools.eclipse.model.ProjectModel;
@@ -115,7 +116,8 @@ public static void run(IProject iProject) throws Exception {
115116
}
116117

117118
// Resolve the target project taking into account only those that are actively running.
118-
ProjectModel targetProjectModel = devModeOps.resolveCommandTarget(selectedProjectModel, "View Maven Unit Test Report", DevModeOperations.ServerFilterMode.ACTIVE_ONLY);
119+
ProjectModel targetProjectModel = devModeOps.resolveCommandTarget(selectedProjectModel, DashboardAction.OPEN_MVN_UT_TEST_REPORT,
120+
DevModeOperations.ServerFilterMode.ACTIVE_ONLY);
119121
if (targetProjectModel == null) {
120122
return;
121123
}
@@ -127,7 +129,7 @@ public static void run(IProject iProject) throws Exception {
127129
}
128130

129131
// Resolve the target project containing the test report to view.
130-
targetProjectModel = devModeOps.resolveTestReportTarget(targetProjectModel, "View Maven Unit Test Report");
132+
targetProjectModel = devModeOps.resolveTestReportTarget(targetProjectModel, DashboardAction.OPEN_MVN_UT_TEST_REPORT);
131133
if (targetProjectModel == null) {
132134
// User cancelled the selection dialog
133135
return;

bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/RunTestsAction.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import org.eclipse.ui.IEditorPart;
1919

2020
import io.openliberty.tools.eclipse.DevModeOperations;
21+
import io.openliberty.tools.eclipse.DevModeOperations.DashboardAction;
2122
import io.openliberty.tools.eclipse.logging.Trace;
2223
import io.openliberty.tools.eclipse.messages.Messages;
2324
import io.openliberty.tools.eclipse.model.ProjectModel;
@@ -113,7 +114,7 @@ public static void run(IProject iProject) throws Exception {
113114
}
114115

115116
// Resolve the target project taking into account only those that are actively running.
116-
ProjectModel targetProjectModel = devModeOps.resolveCommandTarget(selectedProjectModel, "Run Tests", DevModeOperations.ServerFilterMode.ACTIVE_ONLY);
117+
ProjectModel targetProjectModel = devModeOps.resolveCommandTarget(selectedProjectModel, DashboardAction.RUNTESTS, DevModeOperations.ServerFilterMode.ACTIVE_ONLY);
117118
if (targetProjectModel == null) {
118119
return;
119120
}

bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/StartAction.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import org.eclipse.ui.IEditorPart;
2121

2222
import io.openliberty.tools.eclipse.DevModeOperations;
23+
import io.openliberty.tools.eclipse.DevModeOperations.DashboardAction;
2324
import io.openliberty.tools.eclipse.logging.Trace;
2425
import io.openliberty.tools.eclipse.messages.Messages;
2526
import io.openliberty.tools.eclipse.model.ProjectModel;
@@ -112,7 +113,7 @@ public static void run(IProject iProject, String mode) throws Exception {
112113
}
113114

114115
// Resolve the target project taking into account only those that are not actively running.
115-
ProjectModel targetProjectModel = devModeOps.resolveCommandTarget(selectedProjectModel, "Start", DevModeOperations.ServerFilterMode.INACTIVE_ONLY);
116+
ProjectModel targetProjectModel = devModeOps.resolveCommandTarget(selectedProjectModel, DashboardAction.START, DevModeOperations.ServerFilterMode.INACTIVE_ONLY);
116117
if (targetProjectModel == null) {
117118
return;
118119
}

bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/StartConfigurationDialogAction.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import org.eclipse.ui.PlatformUI;
2525

2626
import io.openliberty.tools.eclipse.DevModeOperations;
27+
import io.openliberty.tools.eclipse.DevModeOperations.DashboardAction;
2728
import io.openliberty.tools.eclipse.logging.Trace;
2829
import io.openliberty.tools.eclipse.messages.Messages;
2930
import io.openliberty.tools.eclipse.model.ProjectModel;
@@ -132,7 +133,7 @@ public static void run(IProject iProject, String mode) throws Exception {
132133
}
133134

134135
// Resolve the target project taking into account only those that are not actively running.
135-
targetProjectModel = devModeOps.resolveCommandTarget(selectedProjectModel, "Start...", DevModeOperations.ServerFilterMode.INACTIVE_ONLY);
136+
targetProjectModel = devModeOps.resolveCommandTarget(selectedProjectModel, DashboardAction.START_CFG, DevModeOperations.ServerFilterMode.INACTIVE_ONLY);
136137
if (targetProjectModel == null) {
137138
return;
138139
}

bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/StartInContainerAction.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import org.eclipse.ui.IEditorPart;
2121

2222
import io.openliberty.tools.eclipse.DevModeOperations;
23+
import io.openliberty.tools.eclipse.DevModeOperations.DashboardAction;
2324
import io.openliberty.tools.eclipse.logging.Trace;
2425
import io.openliberty.tools.eclipse.messages.Messages;
2526
import io.openliberty.tools.eclipse.model.ProjectModel;
@@ -118,7 +119,7 @@ public static void run(IProject iProject, String mode) throws Exception {
118119
}
119120

120121
// Resolve the target project taking into account only those that are not actively running.
121-
ProjectModel targetProjectModel = devModeOps.resolveCommandTarget(selectedProjectModel, "Start in container", DevModeOperations.ServerFilterMode.INACTIVE_ONLY);
122+
ProjectModel targetProjectModel = devModeOps.resolveCommandTarget(selectedProjectModel, DashboardAction.START_CTR, DevModeOperations.ServerFilterMode.INACTIVE_ONLY);
122123
if (targetProjectModel == null) {
123124
return;
124125
}

bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/ui/launch/shortcuts/StopAction.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import org.eclipse.ui.IEditorPart;
1919

2020
import io.openliberty.tools.eclipse.DevModeOperations;
21+
import io.openliberty.tools.eclipse.DevModeOperations.DashboardAction;
2122
import io.openliberty.tools.eclipse.logging.Trace;
2223
import io.openliberty.tools.eclipse.messages.Messages;
2324
import io.openliberty.tools.eclipse.model.ProjectModel;
@@ -113,7 +114,7 @@ public static void run(IProject iProject) throws Exception {
113114
}
114115

115116
// Resolve the target project taking into account only those that are actively running.
116-
ProjectModel targetProjectModel = devModeOps.resolveCommandTarget(selectedProjectModel, "Stop", DevModeOperations.ServerFilterMode.ACTIVE_ONLY);
117+
ProjectModel targetProjectModel = devModeOps.resolveCommandTarget(selectedProjectModel, DashboardAction.STOP, DevModeOperations.ServerFilterMode.ACTIVE_ONLY);
117118
if (targetProjectModel == null) {
118119
return;
119120
}

0 commit comments

Comments
 (0)