Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2016-01-20 17:36:40 -0500
committerDonald Dunne2016-01-26 10:00:15 -0500
commit6438426a07509acb0530a9924985585390c239d7 (patch)
tree16617ae40953da716bbd016b379b255830467e84
parent3738818bbb7713456f6e4d30ba9e8009aad04d21 (diff)
downloadorg.eclipse.osee-6438426a07509acb0530a9924985585390c239d7.tar.gz
org.eclipse.osee-6438426a07509acb0530a9924985585390c239d7.tar.xz
org.eclipse.osee-6438426a07509acb0530a9924985585390c239d7.zip
bug[ats_ATS267319]: ATS Workflow Editor double-click on transition corrupts workflow
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/WETransitionComposite.java30
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/XWidgetsExampleBlam.java59
2 files changed, 80 insertions, 9 deletions
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/WETransitionComposite.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/WETransitionComposite.java
index bad3019448..ca5febb76f 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/WETransitionComposite.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/WETransitionComposite.java
@@ -63,8 +63,8 @@ import org.eclipse.osee.framework.ui.skynet.widgets.dialog.UserCheckTreeDialog;
import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.Widgets;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
@@ -84,6 +84,7 @@ public class WETransitionComposite extends Composite {
private final AbstractWorkflowArtifact awa;
private final SMAWorkFlowSection workflowSection;
private final SMAEditor editor;
+ private final Button transitionButton;
public WETransitionComposite(Composite parent, SMAWorkFlowSection workflowSection, final SMAEditor editor, final boolean isEditable) throws OseeCoreException {
super(parent, SWT.NONE);
@@ -95,12 +96,21 @@ public class WETransitionComposite extends Composite {
setLayout(new GridLayout((editor.getWorkFlowTab().isShowTargetedVersion() ? 7 : 5), false));
setBackground(AtsUtil.ACTIVE_COLOR);
- Button transitionButton = editor.getToolkit().createButton(this, "Transition", SWT.PUSH);
- transitionButton.addSelectionListener(new SelectionAdapter() {
+ transitionButton = editor.getToolkit().createButton(this, "Transition", SWT.PUSH);
+ transitionButton.addMouseListener(new MouseAdapter() {
+
@Override
- public void widgetSelected(SelectionEvent e) {
- handleTransitionButtonSelection(editor, isEditable);
+ public void mouseUp(MouseEvent e) {
+ super.mouseUp(e);
+ /**
+ * Only respond to first click and not to double click. After system configured time, count will return to
+ * 1.
+ */
+ if (e.count == 1) {
+ handleTransitionButtonSelection(editor, isEditable);
+ }
}
+
});
transitionButton.setBackground(AtsUtil.ACTIVE_COLOR);
@@ -190,6 +200,7 @@ public class WETransitionComposite extends Composite {
private void handleTransitionButtonSelection(final SMAEditor editor, final boolean isEditable) {
editor.doSave(null);
+ transitionButton.setEnabled(false);
final List<IAtsWorkItem> workItems = Arrays.asList((IAtsWorkItem) awa);
final IAtsStateDefinition toStateDef = (IAtsStateDefinition) transitionToStateCombo.getSelected();
final IAtsStateDefinition fromStateDef = awa.getStateDefinition();
@@ -333,8 +344,8 @@ public class WETransitionComposite extends Composite {
if (isRequireStateHoursSpentPrompt(fromStateDefinition) && !toStateDefinition.getStateType().isCancelledState()) {
// Otherwise, open dialog to ask for hours complete
- String msg =
- awa.getStateMgr().getCurrentStateName() + " State\n\n" + AtsUtilCore.doubleToI18nString(hoursSpent) + " hours already spent on this state.\n" + "Enter the additional number of hours you spent on this state.";
+ String msg = awa.getStateMgr().getCurrentStateName() + " State\n\n" + AtsUtilCore.doubleToI18nString(
+ hoursSpent) + " hours already spent on this state.\n" + "Enter the additional number of hours you spent on this state.";
// Remove after ATS Resolution options is removed 0.9.9_SR5ish
TransitionStatusData data = new TransitionStatusData(Arrays.asList(awa), false);
TransitionStatusDialog dialog = new TransitionStatusDialog("Enter Hours Spent", msg, data);
@@ -434,7 +445,8 @@ public class WETransitionComposite extends Composite {
UserCheckTreeDialog uld = new UserCheckTreeDialog();
uld.setInitialSelections(userServiceClient.getOseeUsers(aba.getTransitionAssignees()));
if (awa.getParentTeamWorkflow() != null) {
- uld.setTeamMembers(userServiceClient.getOseeUsers(awa.getParentTeamWorkflow().getTeamDefinition().getMembersAndLeads()));
+ uld.setTeamMembers(
+ userServiceClient.getOseeUsers(awa.getParentTeamWorkflow().getTeamDefinition().getMembersAndLeads()));
}
if (uld.open() != 0) {
return;
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/XWidgetsExampleBlam.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/XWidgetsExampleBlam.java
index e9acb02f6b..ae3a7c8df2 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/XWidgetsExampleBlam.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/XWidgetsExampleBlam.java
@@ -13,8 +13,21 @@ package org.eclipse.osee.framework.ui.skynet.blam.operation;
import java.util.Arrays;
import java.util.Collection;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.ui.skynet.blam.AbstractBlam;
import org.eclipse.osee.framework.ui.skynet.blam.VariableMap;
+import org.eclipse.osee.framework.ui.skynet.widgets.XModifiedListener;
+import org.eclipse.osee.framework.ui.skynet.widgets.XSelectFromMultiChoiceBranch;
+import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
+import org.eclipse.osee.framework.ui.skynet.widgets.util.SwtXWidgetRenderer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.ui.forms.widgets.FormToolkit;
/**
* @author Donald G. Dunne
@@ -38,4 +51,50 @@ public class XWidgetsExampleBlam extends AbstractBlam {
public Collection<String> getCategories() {
return Arrays.asList("Util");
}
+
+ @Override
+ public void widgetCreated(XWidget xWidget, FormToolkit toolkit, Artifact art, SwtXWidgetRenderer dynamicXWidgetLayout, XModifiedListener modListener, boolean isEditable) throws OseeCoreException {
+ super.widgetCreated(xWidget, toolkit, art, dynamicXWidgetLayout, modListener, isEditable);
+ if (xWidget.getLabel().equals("XSelectFromMultiChoiceBranch")) {
+ XSelectFromMultiChoiceBranch sel = (XSelectFromMultiChoiceBranch) xWidget;
+
+ Button button = new Button(sel.getStyledText().getParent(), SWT.PUSH);
+ button.setText("Click and double-click to see Event type");
+ button.addSelectionListener(new SelectionListener() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ System.err.println(String.format("handleWidgetSelected " + e.detail + " - " + e.time));
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ System.err.println(String.format("haneldWidgetDefaultSelected " + e.detail));
+ }
+
+ });
+
+ Button button2 = new Button(sel.getStyledText().getParent(), SWT.PUSH);
+ button2.setText("Click and double-click to see MouseEvent type");
+ button2.addMouseListener(new MouseListener() {
+
+ @Override
+ public void mouseUp(MouseEvent e) {
+ System.err.println("mouseUp " + e.count);
+ }
+
+ @Override
+ public void mouseDown(MouseEvent e) {
+ System.err.println("mouseDown " + e.count);
+ }
+
+ @Override
+ public void mouseDoubleClick(MouseEvent e) {
+ System.err.println("mouseDoubleClick " + e.count);
+ }
+ });
+
+ }
+ }
+
} \ No newline at end of file

Back to the top