diff options
author | ddunne | 2008-11-12 19:02:42 +0000 |
---|---|---|
committer | ddunne | 2008-11-12 19:02:42 +0000 |
commit | da8d93b44260a52aba5e5bc71b966416f7916a69 (patch) | |
tree | f6e9ee6ba95c3b2b03a2051e4ec06885b49ef997 | |
parent | bcb5cad102beb66d8c873b796f6ff1504c1036ad (diff) | |
download | org.eclipse.osee-da8d93b44260a52aba5e5bc71b966416f7916a69.tar.gz org.eclipse.osee-da8d93b44260a52aba5e5bc71b966416f7916a69.tar.xz org.eclipse.osee-da8d93b44260a52aba5e5bc71b966416f7916a69.zip |
2 files changed, 42 insertions, 27 deletions
diff --git a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/ArtifactPromptChange.java b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/ArtifactPromptChange.java index 43ec90f96af..9c158ae641a 100644 --- a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/ArtifactPromptChange.java +++ b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/ArtifactPromptChange.java @@ -20,6 +20,7 @@ import java.util.Set; import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.dialogs.MessageDialogWithToggle;
import org.eclipse.osee.framework.db.connection.exception.AttributeDoesNotExist;
+import org.eclipse.osee.framework.db.connection.exception.OseeArgumentException;
import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.attribute.Attribute;
@@ -76,7 +77,7 @@ public class ArtifactPromptChange { return promptChangeStringAttribute(attributeName, displayName, VALID_INTEGER_REG_EX, artifacts, persist);
}
- public static boolean promptChangeIntegerAttribute(String attributeName, String displayName, final Artifact artifact, boolean persist ) throws Exception {
+ public static boolean promptChangeIntegerAttribute(String attributeName, String displayName, final Artifact artifact, boolean persist) throws Exception {
return promptChangeStringAttribute(attributeName, displayName, VALID_INTEGER_REG_EX, Arrays.asList(artifact),
persist);
}
@@ -187,6 +188,9 @@ public class ArtifactPromptChange { if (result == 0) {
sma.setSoleAttributeFromString(attributeName, value);
} else {
+ if (attributeName.equals("Name")) {
+ throw new OseeArgumentException("Can not delete Name attribute");
+ }
sma.deleteSoleAttribute(attributeName);
}
if (persist) sma.persistAttributes();
diff --git a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/OverviewPage.java b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/OverviewPage.java index e46378ef4ae..5c945bfc8f6 100644 --- a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/OverviewPage.java +++ b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/OverviewPage.java @@ -27,8 +27,11 @@ import org.eclipse.osee.framework.ui.skynet.widgets.workflow.IDynamicWidgetLayou import org.eclipse.swt.SWT; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Event; +import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.Text; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.forms.IManagedForm; @@ -102,6 +105,7 @@ public class OverviewPage extends FormPage implements IActionable { } } + @Override protected void createFormContent(IManagedForm managedForm) { ScrolledForm form = managedForm.getForm(); form.setText(getEditorInput().getName()); @@ -116,17 +120,9 @@ public class OverviewPage extends FormPage implements IActionable { private void createToolBarActions(ScrolledForm form) { Action runAction = new Action("Run Workflow in Job", Action.AS_PUSH_BUTTON) { + @Override public void run() { - - VariableMap blamVariableMap = editor.getBlamVariableMap(); - for (DynamicXWidgetLayoutData xWidgetData : dynamicXWidgetLayout.getLayoutDatas()) { - XWidget widget = xWidgetData.getXWidget(); - blamVariableMap.setValue(widget.getLabel(), widget.getData()); - } - - BlamJob blamJob = new BlamJob(editor); - blamJob.addListener(editor); - Jobs.startJob(blamJob); + runWorkflow(); } }; runAction.setToolTipText("Starts the workflow in a platform job"); @@ -138,6 +134,18 @@ public class OverviewPage extends FormPage implements IActionable { } + private void runWorkflow() { + VariableMap blamVariableMap = editor.getBlamVariableMap(); + for (DynamicXWidgetLayoutData xWidgetData : dynamicXWidgetLayout.getLayoutDatas()) { + XWidget widget = xWidgetData.getXWidget(); + blamVariableMap.setValue(widget.getLabel(), widget.getData()); + } + + BlamJob blamJob = new BlamJob(editor); + blamJob.addListener(editor); + Jobs.startJob(blamJob); + } + public String getActionDescription() { return ""; } @@ -153,8 +161,8 @@ public class OverviewPage extends FormPage implements IActionable { PlatformUI.getWorkbench().getHelpSystem().setHelp(body, IHelpContextIds.MAIN_WORKFLOW_PAGE); managedForm.addPart(new SectionPart(createUsageSection(body))); - managedForm.addPart(new SectionPart(createOutputSection(body))); managedForm.addPart(new SectionPart(createParametersSection(body))); + managedForm.addPart(new SectionPart(createOutputSection(body))); managedForm.refresh(); } @@ -166,15 +174,11 @@ public class OverviewPage extends FormPage implements IActionable { Composite mainComp = toolkit.createClientContainer(section, 1); // mainComp.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_DARK_YELLOW)); - GridData gridData = new GridData(GridData.FILL_BOTH | GridData.VERTICAL_ALIGN_BEGINNING); - gridData.widthHint = 400; - mainComp.setLayoutData(gridData); + mainComp.setLayoutData(new GridData(GridData.FILL_BOTH | GridData.VERTICAL_ALIGN_BEGINNING)); mainComp.layout(); - Text formText = toolkit.createText(mainComp, workflow.getDescriptionUsage(), SWT.WRAP); - gridData = new GridData(GridData.FILL_BOTH | GridData.VERTICAL_ALIGN_BEGINNING); - gridData.widthHint = 400; - formText.setLayoutData(gridData); + Text formText = toolkit.createText(mainComp, workflow.getDescriptionUsage(), SWT.NONE); + formText.setLayoutData(new GridData(GridData.FILL_BOTH | GridData.VERTICAL_ALIGN_BEGINNING)); section.layout(); return section; @@ -182,19 +186,26 @@ public class OverviewPage extends FormPage implements IActionable { private Section createOutputSection(Composite body) { outputSection = toolkit.createSection(body, Section.TITLE_BAR); - outputSection.setText("Output"); - outputSection.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + outputSection.setText("Execute"); + outputSection.setLayoutData(new GridData(GridData.FILL_BOTH)); outputComp = toolkit.createClientContainer(outputSection, 1); // mainComp.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_DARK_YELLOW)); - GridData gridData = new GridData(GridData.FILL_BOTH | GridData.VERTICAL_ALIGN_BEGINNING); - gridData.widthHint = 400; - outputComp.setLayoutData(gridData); - outputComp.layout(); + outputComp.setLayoutData(new GridData(GridData.FILL_BOTH | GridData.VERTICAL_ALIGN_BEGINNING)); + outputComp.setLayout(new GridLayout(1, false)); + + Button button = toolkit.createButton(outputComp, "Run this Workflow", SWT.PUSH); + button.setImage(SkynetGuiPlugin.getInstance().getImage("run_exc.gif")); + button.addListener(SWT.MouseUp, new Listener() { + @Override + public void handleEvent(Event event) { + runWorkflow(); + } + }); outputText = toolkit.createText(outputComp, "Workflow has not yet run\n", SWT.WRAP); - gridData = new GridData(GridData.FILL_BOTH | GridData.VERTICAL_ALIGN_BEGINNING); - gridData.widthHint = 400; + GridData gridData = new GridData(GridData.FILL_BOTH | GridData.VERTICAL_ALIGN_BEGINNING); + gridData.heightHint = 500; outputText.setLayoutData(gridData); outputSection.layout(); |