Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrbrooks2010-10-15 22:45:05 +0000
committerRyan D. Brooks2010-10-15 22:45:05 +0000
commit825269616c59f6abfc854f9741cb369db8f7f972 (patch)
treef13e7a2420c6a749fdc1c34cb009c891373fc0bb /plugins
parent78d1a94c390d102ceccc4f9645660a114367f3bf (diff)
downloadorg.eclipse.osee-825269616c59f6abfc854f9741cb369db8f7f972.tar.gz
org.eclipse.osee-825269616c59f6abfc854f9741cb369db8f7f972.tar.xz
org.eclipse.osee-825269616c59f6abfc854f9741cb369db8f7f972.zip
refactor: Convert all line terminators to Unix style
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/wizard/AtsConfigWizard.java112
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/AtsWorkflowConfigEditorActionBarContributor.java90
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/AtsWorkflowConfigEditorContextMenuProvider.java120
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/AtsWorkflowConfigEditorPaletteFactory.java376
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/Connection.java310
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/EllipticalShape.java96
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/ModelElement.java310
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/RectangleShape.java100
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/Shape.java560
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/TransitionConnection.java166
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/WorkPageShape.java504
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/WorkflowDiagram.java568
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/commands/ConnectionCreateCommand.java220
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/commands/ConnectionDeleteCommand.java78
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/commands/ConnectionReconnectCommand.java344
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/commands/ShapeCreateCommand.java150
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/commands/ShapeDeleteCommand.java196
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/commands/ShapeSetConstraintCommand.java134
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/parts/ConnectionEditPart.java182
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/parts/DiagramEditPart.java290
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/parts/DiagramTreeEditPart.java196
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/parts/ShapeComponentEditPolicy.java54
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/parts/ShapeEditPart.java464
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/parts/ShapeTreeEditPart.java154
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/parts/ShapesEditPartFactory.java110
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/parts/ShapesTreeEditPartFactory.java52
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/wizard/AtsWorkflowConfigCreationWizard.java308
-rw-r--r--plugins/org.eclipse.osee.coverage/src-gen/org/eclipse/osee/coverage/msgs/CoverageChange1.java238
-rw-r--r--plugins/org.eclipse.osee.coverage/src-gen/org/eclipse/osee/coverage/msgs/CoveragePackageEvent1.java256
-rw-r--r--plugins/org.eclipse.osee.coverage/src-gen/org/eclipse/osee/coverage/msgs/ObjectFactory.java136
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/event/CoverageChange.java114
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/event/CoveragePackageEvent.java124
-rw-r--r--plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/schema/operations/DatabaseDataExtractor.java2
-rw-r--r--plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/mock/MockPropertyStore.java106
-rw-r--r--plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/ReservedCharacters.java308
-rw-r--r--plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/xml/Xml.java928
-rw-r--r--plugins/org.eclipse.osee.framework.search.engine.test/src/org/eclipse/osee/framework/search/engine/test/utility/SearchTagQueryBuilderTest.java218
-rw-r--r--plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/utility/SearchTagQueryBuilder.java158
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/importing/parsers/WordOutlineTest.java448
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/mocks/MockLinker.java106
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/reference/compare_two_artifacts.html46
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/reference/creating_new_links.html53
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/reference/deleting_artifacts.html56
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/reference/deleting_link.html46
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/reference/go_into.html46
-rw-r--r--plugins/org.eclipse.osee.support.admin/openDO/meeting.txt148
-rw-r--r--plugins/org.eclipse.osee.support.admin/presentations_publications/EclipseCon2009_Developing_High_Integrity_Software.html64
47 files changed, 4927 insertions, 4918 deletions
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/wizard/AtsConfigWizard.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/wizard/AtsConfigWizard.java
index 62d70beed22..2b8938635bf 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/wizard/AtsConfigWizard.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/wizard/AtsConfigWizard.java
@@ -8,59 +8,59 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.ats.config.wizard;
-
-import java.util.Collection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.osee.ats.config.AtsConfigManager;
-import org.eclipse.osee.ats.internal.AtsPlugin;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.core.operation.IOperation;
-import org.eclipse.osee.framework.core.operation.Operations;
-import org.eclipse.osee.framework.logging.OseeLevel;
-import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
-
-/**
- * Create new new .shape-file. Those files can be used with the ShapesEditor (see plugin.xml).
- *
- * @author Donald G. Dunne
- */
-public class AtsConfigWizard extends Wizard implements INewWizard {
-
- private AtsConfigWizardPage1 page1;
-
- @Override
- public void addPages() {
- // add pages to this wizard
- addPage(page1);
- }
-
- @Override
- public void init(IWorkbench workbench, IStructuredSelection selection) {
- // create pages for this wizard
- page1 = new AtsConfigWizardPage1(this);
- }
-
- @Override
- public boolean performFinish() {
- try {
- String namespace = page1.getNamespace();
- String teamDefName = page1.getTeamDefName();
- Collection<String> aias = page1.getActionableItems();
- Collection<String> versionNames = page1.getVersions();
- String workflowId = page1.getWorkflowId();
-
- IOperation operation =
- AtsConfigManager.createAtsConfigOperation(namespace, teamDefName, versionNames, aias, workflowId);
- Operations.executeAsJob(operation, true);
-
- } catch (OseeCoreException ex) {
- OseeLog.log(AtsPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- return false;
- }
- return true;
- }
-}
+package org.eclipse.osee.ats.config.wizard;
+
+import java.util.Collection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.osee.ats.config.AtsConfigManager;
+import org.eclipse.osee.ats.internal.AtsPlugin;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.operation.IOperation;
+import org.eclipse.osee.framework.core.operation.Operations;
+import org.eclipse.osee.framework.logging.OseeLevel;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+
+/**
+ * Create new new .shape-file. Those files can be used with the ShapesEditor (see plugin.xml).
+ *
+ * @author Donald G. Dunne
+ */
+public class AtsConfigWizard extends Wizard implements INewWizard {
+
+ private AtsConfigWizardPage1 page1;
+
+ @Override
+ public void addPages() {
+ // add pages to this wizard
+ addPage(page1);
+ }
+
+ @Override
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ // create pages for this wizard
+ page1 = new AtsConfigWizardPage1(this);
+ }
+
+ @Override
+ public boolean performFinish() {
+ try {
+ String namespace = page1.getNamespace();
+ String teamDefName = page1.getTeamDefName();
+ Collection<String> aias = page1.getActionableItems();
+ Collection<String> versionNames = page1.getVersions();
+ String workflowId = page1.getWorkflowId();
+
+ IOperation operation =
+ AtsConfigManager.createAtsConfigOperation(namespace, teamDefName, versionNames, aias, workflowId);
+ Operations.executeAsJob(operation, true);
+
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ return false;
+ }
+ return true;
+ }
+}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/AtsWorkflowConfigEditorActionBarContributor.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/AtsWorkflowConfigEditorActionBarContributor.java
index 2005fce0361..e372196cb2a 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/AtsWorkflowConfigEditorActionBarContributor.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/AtsWorkflowConfigEditorActionBarContributor.java
@@ -8,49 +8,49 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.ats.workflow.editor;
-
-import org.eclipse.gef.ui.actions.ActionBarContributor;
-import org.eclipse.gef.ui.actions.DeleteRetargetAction;
-import org.eclipse.gef.ui.actions.RedoRetargetAction;
-import org.eclipse.gef.ui.actions.UndoRetargetAction;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.ui.actions.ActionFactory;
-
-/**
- * Contributes actions to a toolbar. This class is tied to the editor in the definition of editor-extension (see
- * plugin.xml).
- *
- * @author Donald G. Dunne
- */
-public class AtsWorkflowConfigEditorActionBarContributor extends ActionBarContributor {
-
- /**
- * Create actions managed by this contributor.
- *
- * @see org.eclipse.gef.ui.actions.ActionBarContributor#buildActions()
- */
- @Override
- protected void buildActions() {
- addRetargetAction(new DeleteRetargetAction());
- addRetargetAction(new UndoRetargetAction());
- addRetargetAction(new RedoRetargetAction());
- }
-
- /**
- * Add actions to the given toolbar.
- *
- * @see org.eclipse.ui.part.EditorActionBarContributor#contributeToToolBar(org.eclipse.jface.action.IToolBarManager)
- */
- @Override
- public void contributeToToolBar(IToolBarManager toolBarManager) {
- toolBarManager.add(getAction(ActionFactory.UNDO.getId()));
- toolBarManager.add(getAction(ActionFactory.REDO.getId()));
- }
-
- @Override
- protected void declareGlobalActionKeys() {
- // currently none
- }
-
+package org.eclipse.osee.ats.workflow.editor;
+
+import org.eclipse.gef.ui.actions.ActionBarContributor;
+import org.eclipse.gef.ui.actions.DeleteRetargetAction;
+import org.eclipse.gef.ui.actions.RedoRetargetAction;
+import org.eclipse.gef.ui.actions.UndoRetargetAction;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.ui.actions.ActionFactory;
+
+/**
+ * Contributes actions to a toolbar. This class is tied to the editor in the definition of editor-extension (see
+ * plugin.xml).
+ *
+ * @author Donald G. Dunne
+ */
+public class AtsWorkflowConfigEditorActionBarContributor extends ActionBarContributor {
+
+ /**
+ * Create actions managed by this contributor.
+ *
+ * @see org.eclipse.gef.ui.actions.ActionBarContributor#buildActions()
+ */
+ @Override
+ protected void buildActions() {
+ addRetargetAction(new DeleteRetargetAction());
+ addRetargetAction(new UndoRetargetAction());
+ addRetargetAction(new RedoRetargetAction());
+ }
+
+ /**
+ * Add actions to the given toolbar.
+ *
+ * @see org.eclipse.ui.part.EditorActionBarContributor#contributeToToolBar(org.eclipse.jface.action.IToolBarManager)
+ */
+ @Override
+ public void contributeToToolBar(IToolBarManager toolBarManager) {
+ toolBarManager.add(getAction(ActionFactory.UNDO.getId()));
+ toolBarManager.add(getAction(ActionFactory.REDO.getId()));
+ }
+
+ @Override
+ protected void declareGlobalActionKeys() {
+ // currently none
+ }
+
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/AtsWorkflowConfigEditorContextMenuProvider.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/AtsWorkflowConfigEditorContextMenuProvider.java
index 5c7bcf1426d..dbf997ccf61 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/AtsWorkflowConfigEditorContextMenuProvider.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/AtsWorkflowConfigEditorContextMenuProvider.java
@@ -8,63 +8,63 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.ats.workflow.editor;
-
-import org.eclipse.gef.ContextMenuProvider;
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.gef.ui.actions.ActionRegistry;
-import org.eclipse.gef.ui.actions.GEFActionConstants;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.osee.ats.workflow.editor.actions.EditAction;
-import org.eclipse.osee.framework.core.exception.OseeArgumentException;
-import org.eclipse.ui.actions.ActionFactory;
-
-/**
- * Provides context menu actions for the ShapesEditor.
- *
- * @author Donald G. Dunne
- */
-class AtsWorkflowConfigEditorContextMenuProvider extends ContextMenuProvider {
-
- /** The editor's action registry. */
- private final ActionRegistry actionRegistry;
-
- /**
- * Instantiate a new menu context provider for the specified EditPartViewer and ActionRegistry.
- *
- * @param viewer the editor's graphical viewer
- * @param registry the editor's action registry
- * @throws OseeArgumentException if registry is <tt>null</tt>.
- */
- public AtsWorkflowConfigEditorContextMenuProvider(EditPartViewer viewer, ActionRegistry registry) {
- super(viewer);
- if (registry == null) {
- throw new IllegalArgumentException();
- }
- actionRegistry = registry;
- }
-
- /**
- * Called when the context menu is about to show. Actions, whose state is enabled, will appear in the context menu.
- *
- * @see org.eclipse.gef.ContextMenuProvider#buildContextMenu(org.eclipse.jface.action.IMenuManager)
- */
- @Override
- public void buildContextMenu(IMenuManager menu) {
- // Add standard action groups to the menu
- GEFActionConstants.addStandardActionGroups(menu);
-
- // Add actions to the menu
- menu.appendToGroup(GEFActionConstants.GROUP_EDIT, getAction(EditAction.ID));
- menu.appendToGroup(GEFActionConstants.GROUP_UNDO, // target group id
- getAction(ActionFactory.UNDO.getId())); // action to add
- menu.appendToGroup(GEFActionConstants.GROUP_UNDO, getAction(ActionFactory.REDO.getId()));
- menu.appendToGroup(GEFActionConstants.GROUP_EDIT, getAction(ActionFactory.DELETE.getId()));
- }
-
- private IAction getAction(String actionId) {
- return actionRegistry.getAction(actionId);
- }
-
-}
+package org.eclipse.osee.ats.workflow.editor;
+
+import org.eclipse.gef.ContextMenuProvider;
+import org.eclipse.gef.EditPartViewer;
+import org.eclipse.gef.ui.actions.ActionRegistry;
+import org.eclipse.gef.ui.actions.GEFActionConstants;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.osee.ats.workflow.editor.actions.EditAction;
+import org.eclipse.osee.framework.core.exception.OseeArgumentException;
+import org.eclipse.ui.actions.ActionFactory;
+
+/**
+ * Provides context menu actions for the ShapesEditor.
+ *
+ * @author Donald G. Dunne
+ */
+class AtsWorkflowConfigEditorContextMenuProvider extends ContextMenuProvider {
+
+ /** The editor's action registry. */
+ private final ActionRegistry actionRegistry;
+
+ /**
+ * Instantiate a new menu context provider for the specified EditPartViewer and ActionRegistry.
+ *
+ * @param viewer the editor's graphical viewer
+ * @param registry the editor's action registry
+ * @throws OseeArgumentException if registry is <tt>null</tt>.
+ */
+ public AtsWorkflowConfigEditorContextMenuProvider(EditPartViewer viewer, ActionRegistry registry) {
+ super(viewer);
+ if (registry == null) {
+ throw new IllegalArgumentException();
+ }
+ actionRegistry = registry;
+ }
+
+ /**
+ * Called when the context menu is about to show. Actions, whose state is enabled, will appear in the context menu.
+ *
+ * @see org.eclipse.gef.ContextMenuProvider#buildContextMenu(org.eclipse.jface.action.IMenuManager)
+ */
+ @Override
+ public void buildContextMenu(IMenuManager menu) {
+ // Add standard action groups to the menu
+ GEFActionConstants.addStandardActionGroups(menu);
+
+ // Add actions to the menu
+ menu.appendToGroup(GEFActionConstants.GROUP_EDIT, getAction(EditAction.ID));
+ menu.appendToGroup(GEFActionConstants.GROUP_UNDO, // target group id
+ getAction(ActionFactory.UNDO.getId())); // action to add
+ menu.appendToGroup(GEFActionConstants.GROUP_UNDO, getAction(ActionFactory.REDO.getId()));
+ menu.appendToGroup(GEFActionConstants.GROUP_EDIT, getAction(ActionFactory.DELETE.getId()));
+ }
+
+ private IAction getAction(String actionId) {
+ return actionRegistry.getAction(actionId);
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/AtsWorkflowConfigEditorPaletteFactory.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/AtsWorkflowConfigEditorPaletteFactory.java
index 25c9da190ea..e71ab7fc2a1 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/AtsWorkflowConfigEditorPaletteFactory.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/AtsWorkflowConfigEditorPaletteFactory.java
@@ -8,192 +8,192 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.ats.workflow.editor;
-
-import org.eclipse.gef.Tool;
-import org.eclipse.gef.palette.CombinedTemplateCreationEntry;
-import org.eclipse.gef.palette.ConnectionCreationToolEntry;
-import org.eclipse.gef.palette.MarqueeToolEntry;
-import org.eclipse.gef.palette.PaletteContainer;
-import org.eclipse.gef.palette.PaletteDrawer;
-import org.eclipse.gef.palette.PaletteRoot;
-import org.eclipse.gef.palette.PaletteToolbar;
-import org.eclipse.gef.palette.PanningSelectionToolEntry;
-import org.eclipse.gef.palette.ToolEntry;
-import org.eclipse.gef.requests.CreationFactory;
-import org.eclipse.gef.requests.SimpleFactory;
-import org.eclipse.gef.tools.AbstractTool;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.osee.ats.AtsImage;
-import org.eclipse.osee.ats.internal.AtsPlugin;
-import org.eclipse.osee.ats.workflow.editor.actions.ValidateDiagramToolEntry;
-import org.eclipse.osee.ats.workflow.editor.model.CancelledWorkPageShape;
-import org.eclipse.osee.ats.workflow.editor.model.CompletedWorkPageShape;
-import org.eclipse.osee.ats.workflow.editor.model.DefaultTransitionConnection;
-import org.eclipse.osee.ats.workflow.editor.model.ReturnTransitionConnection;
-import org.eclipse.osee.ats.workflow.editor.model.TransitionConnection;
-import org.eclipse.osee.ats.workflow.editor.model.WorkPageShape;
-import org.eclipse.osee.framework.ui.plugin.OseeUiActions;
-import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
-import org.eclipse.osee.framework.ui.swt.Displays;
-import org.eclipse.osee.framework.ui.swt.ImageManager;
-
-/**
- * Utility class that can create a GEF Palette.
- *
- * @see #createPalette()
- * @author Donald G. Dunne
- */
-final class AtsWorkflowConfigEditorPaletteFactory {
-
- /** Create the "States" drawer. */
- private static PaletteContainer createStatesDrawer() {
- PaletteDrawer componentsDrawer = new PaletteDrawer("States");
-
- CombinedTemplateCreationEntry component =
- new CombinedTemplateCreationEntry("State", "Create a new Workflow State", WorkPageShape.class,
- new SimpleFactory(WorkPageShape.class), ImageManager.getImageDescriptor(FrameworkImage.RECTANGLE_16),
- ImageManager.getImageDescriptor(FrameworkImage.RECTANGLE_24));
- componentsDrawer.add(component);
-
- component =
- new CombinedTemplateCreationEntry("Completed State", "Create a Completed State", CompletedWorkPageShape.class,
- new SimpleFactory(CompletedWorkPageShape.class),
- ImageManager.getImageDescriptor(FrameworkImage.RECTANGLE_16),
- ImageManager.getImageDescriptor(FrameworkImage.RECTANGLE_24));
- componentsDrawer.add(component);
-
- component =
- new CombinedTemplateCreationEntry("Cancelled State", "Create a Cancelled State", CancelledWorkPageShape.class,
- new SimpleFactory(CancelledWorkPageShape.class),
- ImageManager.getImageDescriptor(FrameworkImage.RECTANGLE_16),
- ImageManager.getImageDescriptor(FrameworkImage.RECTANGLE_24));
- componentsDrawer.add(component);
-
- return componentsDrawer;
- }
-
- /** Create the "Transitions" drawer. */
- private static PaletteContainer createTransitionsDrawer() {
- PaletteDrawer componentsDrawer = new PaletteDrawer("Transitions");
-
- ToolEntry tool =
- new ConnectionCreationToolEntry("Default Transition", "Create a Default Transition", new CreationFactory() {
- @Override
- public Object getNewObject() {
- return null;
- }
-
- @Override
- public Object getObjectType() {
- return DefaultTransitionConnection.class;
- }
- }, ImageManager.getImageDescriptor(AtsImage.CONECTION_16),
- ImageManager.getImageDescriptor(AtsImage.CONECTION_24));
- componentsDrawer.add(tool);
-
- tool =
- new ConnectionCreationToolEntry("Transition", "Create a Transition", new CreationFactory() {
- @Override
- public Object getNewObject() {
- return null;
- }
-
- @Override
- public Object getObjectType() {
- return TransitionConnection.class;
- }
- }, ImageManager.getImageDescriptor(AtsImage.CONECTION_16),
- ImageManager.getImageDescriptor(AtsImage.CONECTION_24));
- componentsDrawer.add(tool);
-
- tool =
- new ConnectionCreationToolEntry("Return Transition", "Create a Return Transition", new CreationFactory() {
- @Override
- public Object getNewObject() {
- return null;
- }
-
- @Override
- public Object getObjectType() {
- return ReturnTransitionConnection.class;
- }
- }, ImageManager.getImageDescriptor(AtsImage.CONECTION_16),
- ImageManager.getImageDescriptor(AtsImage.CONECTION_24));
- componentsDrawer.add(tool);
-
- return componentsDrawer;
- }
-
- /**
- * Creates the PaletteRoot and adds all palette elements. Use this factory method to create a new palette for your
- * graphical editor.
- *
- * @return a new PaletteRoot
- */
- static PaletteRoot createPalette(AtsWorkflowConfigEditor editor) {
- PaletteRoot palette = new PaletteRoot();
- palette.add(createToolsGroup(palette, editor));
- palette.add(createStatesDrawer());
- palette.add(createTransitionsDrawer());
- return palette;
- }
-
- /** Create the "Tools" group. */
- private static PaletteContainer createToolsGroup(PaletteRoot palette, AtsWorkflowConfigEditor editor) {
- PaletteToolbar toolbar = new PaletteToolbar("Tools");
-
- // Add a selection tool to the group
- ToolEntry tool = new PanningSelectionToolEntry();
- toolbar.add(tool);
- palette.setDefaultEntry(tool);
-
- // Add a marquee tool to the group
- toolbar.add(new MarqueeToolEntry());
-
- toolbar.add(new ValidateDiagramToolEntry());
-
- final Action action =
- OseeUiActions.createBugAction(AtsPlugin.PLUGIN_ID, editor, AtsWorkflowConfigEditor.EDITOR_ID,
- "ATS Workflow Config Editor");
- final ImageDescriptor img = action.getImageDescriptor();
-
- toolbar.add(new ToolEntry("", action.getText(), img, img, null) {
-
- @Override
- public Tool createTool() {
- return new AbstractTool() {
-
- @Override
- protected String getCommandName() {
- return action.getText();
- }
-
- @Override
- public void activate() {
- super.activate();
- Displays.ensureInDisplayThread(new Runnable() {
-
- @Override
- public void run() {
- deactivate();
- action.run();
- }
- });
-
- }
- };
- }
-
- });
-
- return toolbar;
- }
-
- /** Utility class. */
- private AtsWorkflowConfigEditorPaletteFactory() {
- // Utility class
- }
-
+package org.eclipse.osee.ats.workflow.editor;
+
+import org.eclipse.gef.Tool;
+import org.eclipse.gef.palette.CombinedTemplateCreationEntry;
+import org.eclipse.gef.palette.ConnectionCreationToolEntry;
+import org.eclipse.gef.palette.MarqueeToolEntry;
+import org.eclipse.gef.palette.PaletteContainer;
+import org.eclipse.gef.palette.PaletteDrawer;
+import org.eclipse.gef.palette.PaletteRoot;
+import org.eclipse.gef.palette.PaletteToolbar;
+import org.eclipse.gef.palette.PanningSelectionToolEntry;
+import org.eclipse.gef.palette.ToolEntry;
+import org.eclipse.gef.requests.CreationFactory;
+import org.eclipse.gef.requests.SimpleFactory;
+import org.eclipse.gef.tools.AbstractTool;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.osee.ats.AtsImage;
+import org.eclipse.osee.ats.internal.AtsPlugin;
+import org.eclipse.osee.ats.workflow.editor.actions.ValidateDiagramToolEntry;
+import org.eclipse.osee.ats.workflow.editor.model.CancelledWorkPageShape;
+import org.eclipse.osee.ats.workflow.editor.model.CompletedWorkPageShape;
+import org.eclipse.osee.ats.workflow.editor.model.DefaultTransitionConnection;
+import org.eclipse.osee.ats.workflow.editor.model.ReturnTransitionConnection;
+import org.eclipse.osee.ats.workflow.editor.model.TransitionConnection;
+import org.eclipse.osee.ats.workflow.editor.model.WorkPageShape;
+import org.eclipse.osee.framework.ui.plugin.OseeUiActions;
+import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
+import org.eclipse.osee.framework.ui.swt.Displays;
+import org.eclipse.osee.framework.ui.swt.ImageManager;
+
+/**
+ * Utility class that can create a GEF Palette.
+ *
+ * @see #createPalette()
+ * @author Donald G. Dunne
+ */
+final class AtsWorkflowConfigEditorPaletteFactory {
+
+ /** Create the "States" drawer. */
+ private static PaletteContainer createStatesDrawer() {
+ PaletteDrawer componentsDrawer = new PaletteDrawer("States");
+
+ CombinedTemplateCreationEntry component =
+ new CombinedTemplateCreationEntry("State", "Create a new Workflow State", WorkPageShape.class,
+ new SimpleFactory(WorkPageShape.class), ImageManager.getImageDescriptor(FrameworkImage.RECTANGLE_16),
+ ImageManager.getImageDescriptor(FrameworkImage.RECTANGLE_24));
+ componentsDrawer.add(component);
+
+ component =
+ new CombinedTemplateCreationEntry("Completed State", "Create a Completed State", CompletedWorkPageShape.class,
+ new SimpleFactory(CompletedWorkPageShape.class),
+ ImageManager.getImageDescriptor(FrameworkImage.RECTANGLE_16),
+ ImageManager.getImageDescriptor(FrameworkImage.RECTANGLE_24));
+ componentsDrawer.add(component);
+
+ component =
+ new CombinedTemplateCreationEntry("Cancelled State", "Create a Cancelled State", CancelledWorkPageShape.class,
+ new SimpleFactory(CancelledWorkPageShape.class),
+ ImageManager.getImageDescriptor(FrameworkImage.RECTANGLE_16),
+ ImageManager.getImageDescriptor(FrameworkImage.RECTANGLE_24));
+ componentsDrawer.add(component);
+
+ return componentsDrawer;
+ }
+
+ /** Create the "Transitions" drawer. */
+ private static PaletteContainer createTransitionsDrawer() {
+ PaletteDrawer componentsDrawer = new PaletteDrawer("Transitions");
+
+ ToolEntry tool =
+ new ConnectionCreationToolEntry("Default Transition", "Create a Default Transition", new CreationFactory() {
+ @Override
+ public Object getNewObject() {
+ return null;
+ }
+
+ @Override
+ public Object getObjectType() {
+ return DefaultTransitionConnection.class;
+ }
+ }, ImageManager.getImageDescriptor(AtsImage.CONECTION_16),
+ ImageManager.getImageDescriptor(AtsImage.CONECTION_24));
+ componentsDrawer.add(tool);
+
+ tool =
+ new ConnectionCreationToolEntry("Transition", "Create a Transition", new CreationFactory() {
+ @Override
+ public Object getNewObject() {
+ return null;
+ }
+
+ @Override
+ public Object getObjectType() {
+ return TransitionConnection.class;
+ }
+ }, ImageManager.getImageDescriptor(AtsImage.CONECTION_16),
+ ImageManager.getImageDescriptor(AtsImage.CONECTION_24));
+ componentsDrawer.add(tool);
+
+ tool =
+ new ConnectionCreationToolEntry("Return Transition", "Create a Return Transition", new CreationFactory() {
+ @Override
+ public Object getNewObject() {
+ return null;
+ }
+
+ @Override
+ public Object getObjectType() {
+ return ReturnTransitionConnection.class;
+ }
+ }, ImageManager.getImageDescriptor(AtsImage.CONECTION_16),
+ ImageManager.getImageDescriptor(AtsImage.CONECTION_24));
+ componentsDrawer.add(tool);
+
+ return componentsDrawer;
+ }
+
+ /**
+ * Creates the PaletteRoot and adds all palette elements. Use this factory method to create a new palette for your
+ * graphical editor.
+ *
+ * @return a new PaletteRoot
+ */
+ static PaletteRoot createPalette(AtsWorkflowConfigEditor editor) {
+ PaletteRoot palette = new PaletteRoot();
+ palette.add(createToolsGroup(palette, editor));
+ palette.add(createStatesDrawer());
+ palette.add(createTransitionsDrawer());
+ return palette;
+ }
+
+ /** Create the "Tools" group. */
+ private static PaletteContainer createToolsGroup(PaletteRoot palette, AtsWorkflowConfigEditor editor) {
+ PaletteToolbar toolbar = new PaletteToolbar("Tools");
+
+ // Add a selection tool to the group
+ ToolEntry tool = new PanningSelectionToolEntry();
+ toolbar.add(tool);
+ palette.setDefaultEntry(tool);
+
+ // Add a marquee tool to the group
+ toolbar.add(new MarqueeToolEntry());
+
+ toolbar.add(new ValidateDiagramToolEntry());
+
+ final Action action =
+ OseeUiActions.createBugAction(AtsPlugin.PLUGIN_ID, editor, AtsWorkflowConfigEditor.EDITOR_ID,
+ "ATS Workflow Config Editor");
+ final ImageDescriptor img = action.getImageDescriptor();
+
+ toolbar.add(new ToolEntry("", action.getText(), img, img, null) {
+
+ @Override
+ public Tool createTool() {
+ return new AbstractTool() {
+
+ @Override
+ protected String getCommandName() {
+ return action.getText();
+ }
+
+ @Override
+ public void activate() {
+ super.activate();
+ Displays.ensureInDisplayThread(new Runnable() {
+
+ @Override
+ public void run() {
+ deactivate();
+ action.run();
+ }
+ });
+
+ }
+ };
+ }
+
+ });
+
+ return toolbar;
+ }
+
+ /** Utility class. */
+ private AtsWorkflowConfigEditorPaletteFactory() {
+ // Utility class
+ }
+
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/Connection.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/Connection.java
index a227149c37c..da0d87531a4 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/Connection.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/Connection.java
@@ -8,159 +8,159 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.ats.workflow.editor.model;
-
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.ui.plugin.util.Result;
-import org.eclipse.osee.framework.ui.swt.Displays;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-
-/**
- * A connection between two distinct shapes.
- *
- * @author Donald G. Dunne
- */
-public class Connection extends ModelElement {
-
- /** True, if the connection is attached to its endpoints. */
- private boolean isConnected;
- private int lineStyle = Graphics.LINE_SOLID;
- /** Connection's source endpoint. */
- private Shape source;
- /** Connection's target endpoint. */
- private Shape target;
-
- /**
- * Create a (solid) connection between two distinct shapes.
- *
- * @param source a source endpoint for this connection (non null)
- * @param target a target endpoint for this connection (non null)
- * @throws IllegalArgumentException if any of the parameters are null or source == target
- * @see #setLineStyle(int)
- */
- public Connection(Shape source, Shape target) {
- reconnect(source, target);
- }
-
- public Color getForegroundColor() {
- return Displays.getSystemColor(SWT.COLOR_BLACK);
- }
-
- @Override
- public String toString() {
- return "Connection";
- }
-
- /**
- * Disconnect this connection from the shapes it is attached to.
- */
- public void disconnect() {
- if (isConnected) {
- source.removeConnection(this);
- target.removeConnection(this);
- isConnected = false;
- }
- }
-
- /**
- * Returns the line drawing style of this connection.
- *
- * @return an int value (Graphics.LINE_DASH or Graphics.LINE_SOLID)
- */
- public int getLineStyle() {
- return lineStyle;
- }
-
- @SuppressWarnings("unused")
- @Override
- public Result validForSave() throws OseeCoreException {
- System.err.println("Add Connection validations.");
- return Result.TrueResult;
- }
-
- /**
- * Returns the source end-point of this connection.
- *
- * @return a non-null Shape instance
- */
- public Shape getSource() {
- return source;
- }
-
- /**
- * Returns the target endpoint of this connection.
- *
- * @return a non-null Shape instance
- */
- public Shape getTarget() {
- return target;
- }
-
- /**
- * Reconnect this connection. The connection will reconnect with the shapes it was previously attached to.
- */
- public void reconnect() {
- if (!isConnected) {
- source.addConnection(this);
- target.addConnection(this);
- isConnected = true;
- }
- }
-
- /**
- * Reconnect to a different source and/or target shape. The connection will disconnect from its current attachments
- * and reconnect to the new source and target.
- *
- * @param newSource a new source endpoint for this connection (non null)
- * @param newTarget a new target endpoint for this connection (non null)
- * @throws IllegalArgumentException if any of the paramers are null or newSource == newTarget
- */
- public void reconnect(Shape newSource, Shape newTarget) {
- if (newSource == null || newTarget == null || newSource == newTarget) {
- throw new IllegalArgumentException();
- }
- disconnect();
- this.source = newSource;
- this.target = newTarget;
- reconnect();
- }
-
- /**
- * Set the line drawing style of this connection.
- *
- * @param lineStyle one of following values: Graphics.LINE_DASH or Graphics.LINE_SOLID
- * @see Graphics#LINE_DASH
- * @see Graphics#LINE_SOLID
- * @throws IllegalArgumentException if lineStyle does not have one of the above values
- */
- public void setLineStyle(int lineStyle) {
- if (lineStyle != Graphics.LINE_DASH && lineStyle != Graphics.LINE_SOLID) {
- throw new IllegalArgumentException();
- }
- this.lineStyle = lineStyle;
- }
-
- /**
- * @return the label
- */
- public String getLabel() {
- return "Connection";
- }
-
- /**
- * @return the lineWidth
- */
- public int getLineWidth() {
- return 2;
- }
-
- @SuppressWarnings("unused")
- @Override
- public Result doSave(SkynetTransaction transaction) throws OseeCoreException {
- return Result.TrueResult;
- }
-
+package org.eclipse.osee.ats.workflow.editor.model;
+
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+import org.eclipse.osee.framework.ui.swt.Displays;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+
+/**
+ * A connection between two distinct shapes.
+ *
+ * @author Donald G. Dunne
+ */
+public class Connection extends ModelElement {
+
+ /** True, if the connection is attached to its endpoints. */
+ private boolean isConnected;
+ private int lineStyle = Graphics.LINE_SOLID;
+ /** Connection's source endpoint. */
+ private Shape source;
+ /** Connection's target endpoint. */
+ private Shape target;
+
+ /**
+ * Create a (solid) connection between two distinct shapes.
+ *
+ * @param source a source endpoint for this connection (non null)
+ * @param target a target endpoint for this connection (non null)
+ * @throws IllegalArgumentException if any of the parameters are null or source == target
+ * @see #setLineStyle(int)
+ */
+ public Connection(Shape source, Shape target) {
+ reconnect(source, target);
+ }
+
+ public Color getForegroundColor() {
+ return Displays.getSystemColor(SWT.COLOR_BLACK);
+ }
+
+ @Override
+ public String toString() {
+ return "Connection";
+ }
+
+ /**
+ * Disconnect this connection from the shapes it is attached to.
+ */
+ public void disconnect() {
+ if (isConnected) {
+ source.removeConnection(this);
+ target.removeConnection(this);
+ isConnected = false;
+ }
+ }
+
+ /**
+ * Returns the line drawing style of this connection.
+ *
+ * @return an int value (Graphics.LINE_DASH or Graphics.LINE_SOLID)
+ */
+ public int getLineStyle() {
+ return lineStyle;
+ }
+
+ @SuppressWarnings("unused")
+ @Override
+ public Result validForSave() throws OseeCoreException {
+ System.err.println("Add Connection validations.");
+ return Result.TrueResult;
+ }
+
+ /**
+ * Returns the source end-point of this connection.
+ *
+ * @return a non-null Shape instance
+ */
+ public Shape getSource() {
+ return source;
+ }
+
+ /**
+ * Returns the target endpoint of this connection.
+ *
+ * @return a non-null Shape instance
+ */
+ public Shape getTarget() {
+ return target;
+ }
+
+ /**
+ * Reconnect this connection. The connection will reconnect with the shapes it was previously attached to.
+ */
+ public void reconnect() {
+ if (!isConnected) {
+ source.addConnection(this);
+ target.addConnection(this);
+ isConnected = true;
+ }
+ }
+
+ /**
+ * Reconnect to a different source and/or target shape. The connection will disconnect from its current attachments
+ * and reconnect to the new source and target.
+ *
+ * @param newSource a new source endpoint for this connection (non null)
+ * @param newTarget a new target endpoint for this connection (non null)
+ * @throws IllegalArgumentException if any of the paramers are null or newSource == newTarget
+ */
+ public void reconnect(Shape newSource, Shape newTarget) {
+ if (newSource == null || newTarget == null || newSource == newTarget) {
+ throw new IllegalArgumentException();
+ }
+ disconnect();
+ this.source = newSource;
+ this.target = newTarget;
+ reconnect();
+ }
+
+ /**
+ * Set the line drawing style of this connection.
+ *
+ * @param lineStyle one of following values: Graphics.LINE_DASH or Graphics.LINE_SOLID
+ * @see Graphics#LINE_DASH
+ * @see Graphics#LINE_SOLID
+ * @throws IllegalArgumentException if lineStyle does not have one of the above values
+ */
+ public void setLineStyle(int lineStyle) {
+ if (lineStyle != Graphics.LINE_DASH && lineStyle != Graphics.LINE_SOLID) {
+ throw new IllegalArgumentException();
+ }
+ this.lineStyle = lineStyle;
+ }
+
+ /**
+ * @return the label
+ */
+ public String getLabel() {
+ return "Connection";
+ }
+
+ /**
+ * @return the lineWidth
+ */
+ public int getLineWidth() {
+ return 2;
+ }
+
+ @SuppressWarnings("unused")
+ @Override
+ public Result doSave(SkynetTransaction transaction) throws OseeCoreException {
+ return Result.TrueResult;
+ }
+
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/EllipticalShape.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/EllipticalShape.java
index 08911fbd5ac..2363d4b8041 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/EllipticalShape.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/EllipticalShape.java
@@ -8,51 +8,51 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.ats.workflow.editor.model;
-
-import org.eclipse.osee.ats.AtsImage;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.ui.plugin.util.Result;
-import org.eclipse.osee.framework.ui.swt.ImageManager;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * An elliptical shape.
- *
- * @author Donald G. Dunne
- */
-public class EllipticalShape extends Shape {
-
- /** A 16x16 pictogram of an elliptical shape. */
-
- @Override
- public Image getIcon() {
- return ImageManager.getImage(AtsImage.ELLIPSE_ICON);
- }
-
- @Override
- public Result validForSave() {
- return Result.TrueResult;
- }
-
- @Override
- public String toString() {
- return "Ellipse " + hashCode();
- }
-
- @Override
- protected String getName() {
- return null;
- }
-
- @Override
- protected String getToolTip() {
- return null;
- }
-
- @Override
- public Result doSave(SkynetTransaction transaction) {
- return Result.TrueResult;
- }
-
-}
+package org.eclipse.osee.ats.workflow.editor.model;
+
+import org.eclipse.osee.ats.AtsImage;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+import org.eclipse.osee.framework.ui.swt.ImageManager;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * An elliptical shape.
+ *
+ * @author Donald G. Dunne
+ */
+public class EllipticalShape extends Shape {
+
+ /** A 16x16 pictogram of an elliptical shape. */
+
+ @Override
+ public Image getIcon() {
+ return ImageManager.getImage(AtsImage.ELLIPSE_ICON);
+ }
+
+ @Override
+ public Result validForSave() {
+ return Result.TrueResult;
+ }
+
+ @Override
+ public String toString() {
+ return "Ellipse " + hashCode();
+ }
+
+ @Override
+ protected String getName() {
+ return null;
+ }
+
+ @Override
+ protected String getToolTip() {
+ return null;
+ }
+
+ @Override
+ public Result doSave(SkynetTransaction transaction) {
+ return Result.TrueResult;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/ModelElement.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/ModelElement.java
index 2d36203adec..facc5eae09d 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/ModelElement.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/ModelElement.java
@@ -8,158 +8,158 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.ats.workflow.editor.model;
-
-import java.beans.PropertyChangeListener;
-import java.beans.PropertyChangeSupport;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.ui.plugin.util.Result;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertySource;
-
-/**
- * Abstract prototype of a model element.
- * <p>
- * This class provides features necessary for all model elements, like:
- * </p>
- * <ul>
- * <li>property-change support (used to notify edit parts of model changes),</li>
- * <li>property-source support (used to display property values in the Property View) and</li>
- * <li>serialization support (the model hierarchy must be serializable, so that the editor can save and restore a binary
- * representation. You might not need this, if you store the model a non-binary form like XML).</li>
- * </ul>
- *
- * @author Donald G. Dunne
- */
-public abstract class ModelElement implements IPropertySource {
- /** An empty property descriptor. */
- private static final IPropertyDescriptor[] EMPTY_ARRAY = new IPropertyDescriptor[0];
-
- /** Delegate used to implement property-change-support. */
- private transient PropertyChangeSupport pcsDelegate = new PropertyChangeSupport(this);
- protected Map<Object, Object> propertyValues;
-
- @SuppressWarnings("unused")
- protected void initializePropertyValues() throws OseeCoreException {
- if (propertyValues == null) {
- propertyValues = new HashMap<Object, Object>();
- }
- }
-
- public abstract Result doSave(SkynetTransaction transaction) throws OseeCoreException;
-
- public abstract Result validForSave() throws OseeCoreException;
-
- /**
- * Attach a non-null PropertyChangeListener to this object.
- *
- * @param l a non-null PropertyChangeListener instance
- * @throws IllegalArgumentException if the parameter is null
- */
- public synchronized void addPropertyChangeListener(PropertyChangeListener l) {
- if (l == null) {
- throw new IllegalArgumentException();
- }
- pcsDelegate.addPropertyChangeListener(l);
- }
-
- /**
- * Report a property change to registered listeners (for example edit parts).
- *
- * @param property the programmatic name of the property that changed
- * @param oldValue the old value of this property
- * @param newValue the new value of this property
- */
- protected void firePropertyChange(String property, Object oldValue, Object newValue) {
- if (pcsDelegate.hasListeners(property)) {
- pcsDelegate.firePropertyChange(property, oldValue, newValue);
- }
- }
-
- /**
- * Returns a value for this property source that can be edited in a property sheet.
- * <p>
- * My personal rule of thumb:
- * </p>
- * <ul>
- * <li>model elements should return themselves and</li>
- * <li>custom IPropertySource implementations (like DimensionPropertySource in the GEF-logic example) should return
- * an editable value.</li>
- * </ul>
- * <p>
- * Override only if necessary.
- * </p>
- *
- * @return this instance
- */
- @Override
- public Object getEditableValue() {
- return this;
- }
-
- /**
- * Children should override this. The default implementation returns an empty array.
- */
- @Override
- public IPropertyDescriptor[] getPropertyDescriptors() {
- return EMPTY_ARRAY;
- }
-
- /**
- * Children should override this. The default implementation returns null.
- */
- @Override
- public Object getPropertyValue(Object id) {
- return propertyValues.get(id);
- }
-
- /**
- * Children should override this. The default implementation returns false.
- */
- @Override
- public boolean isPropertySet(Object id) {
- return false;
- }
-
- /**
- * Deserialization constructor. Initializes transient fields.
- *
- * @see java.io.Serializable
- */
- private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
- in.defaultReadObject();
- pcsDelegate = new PropertyChangeSupport(this);
- }
-
- /**
- * Remove a PropertyChangeListener from this component.
- *
- * @param l a PropertyChangeListener instance
- */
- public synchronized void removePropertyChangeListener(PropertyChangeListener l) {
- if (l != null) {
- pcsDelegate.removePropertyChangeListener(l);
- }
- }
-
- /**
- * Children should override this. The default implementation does nothing.
- */
- @Override
- public void resetPropertyValue(Object id) {
- // do nothing
- }
-
- /**
- * Children should override this. The default implementation does nothing.
- */
- @Override
- public void setPropertyValue(Object id, Object value) {
- propertyValues.put(id, value);
- }
-}
+package org.eclipse.osee.ats.workflow.editor.model;
+
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.util.HashMap;
+import java.util.Map;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+
+/**
+ * Abstract prototype of a model element.
+ * <p>
+ * This class provides features necessary for all model elements, like:
+ * </p>
+ * <ul>
+ * <li>property-change support (used to notify edit parts of model changes),</li>
+ * <li>property-source support (used to display property values in the Property View) and</li>
+ * <li>serialization support (the model hierarchy must be serializable, so that the editor can save and restore a binary
+ * representation. You might not need this, if you store the model a non-binary form like XML).</li>
+ * </ul>
+ *
+ * @author Donald G. Dunne
+ */
+public abstract class ModelElement implements IPropertySource {
+ /** An empty property descriptor. */
+ private static final IPropertyDescriptor[] EMPTY_ARRAY = new IPropertyDescriptor[0];
+
+ /** Delegate used to implement property-change-support. */
+ private transient PropertyChangeSupport pcsDelegate = new PropertyChangeSupport(this);
+ protected Map<Object, Object> propertyValues;
+
+ @SuppressWarnings("unused")
+ protected void initializePropertyValues() throws OseeCoreException {
+ if (propertyValues == null) {
+ propertyValues = new HashMap<Object, Object>();
+ }
+ }
+
+ public abstract Result doSave(SkynetTransaction transaction) throws OseeCoreException;
+
+ public abstract Result validForSave() throws OseeCoreException;
+
+ /**
+ * Attach a non-null PropertyChangeListener to this object.
+ *
+ * @param l a non-null PropertyChangeListener instance
+ * @throws IllegalArgumentException if the parameter is null
+ */
+ public synchronized void addPropertyChangeListener(PropertyChangeListener l) {
+ if (l == null) {
+ throw new IllegalArgumentException();
+ }
+ pcsDelegate.addPropertyChangeListener(l);
+ }
+
+ /**
+ * Report a property change to registered listeners (for example edit parts).
+ *
+ * @param property the programmatic name of the property that changed
+ * @param oldValue the old value of this property
+ * @param newValue the new value of this property
+ */
+ protected void firePropertyChange(String property, Object oldValue, Object newValue) {
+ if (pcsDelegate.hasListeners(property)) {
+ pcsDelegate.firePropertyChange(property, oldValue, newValue);
+ }
+ }
+
+ /**
+ * Returns a value for this property source that can be edited in a property sheet.
+ * <p>
+ * My personal rule of thumb:
+ * </p>
+ * <ul>
+ * <li>model elements should return themselves and</li>
+ * <li>custom IPropertySource implementations (like DimensionPropertySource in the GEF-logic example) should return
+ * an editable value.</li>
+ * </ul>
+ * <p>
+ * Override only if necessary.
+ * </p>
+ *
+ * @return this instance
+ */
+ @Override
+ public Object getEditableValue() {
+ return this;
+ }
+
+ /**
+ * Children should override this. The default implementation returns an empty array.
+ */
+ @Override
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ return EMPTY_ARRAY;
+ }
+
+ /**
+ * Children should override this. The default implementation returns null.
+ */
+ @Override
+ public Object getPropertyValue(Object id) {
+ return propertyValues.get(id);
+ }
+
+ /**
+ * Children should override this. The default implementation returns false.
+ */
+ @Override
+ public boolean isPropertySet(Object id) {
+ return false;
+ }
+
+ /**
+ * Deserialization constructor. Initializes transient fields.
+ *
+ * @see java.io.Serializable
+ */
+ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
+ in.defaultReadObject();
+ pcsDelegate = new PropertyChangeSupport(this);
+ }
+
+ /**
+ * Remove a PropertyChangeListener from this component.
+ *
+ * @param l a PropertyChangeListener instance
+ */
+ public synchronized void removePropertyChangeListener(PropertyChangeListener l) {
+ if (l != null) {
+ pcsDelegate.removePropertyChangeListener(l);
+ }
+ }
+
+ /**
+ * Children should override this. The default implementation does nothing.
+ */
+ @Override
+ public void resetPropertyValue(Object id) {
+ // do nothing
+ }
+
+ /**
+ * Children should override this. The default implementation does nothing.
+ */
+ @Override
+ public void setPropertyValue(Object id, Object value) {
+ propertyValues.put(id, value);
+ }
+}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/RectangleShape.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/RectangleShape.java
index 28764cef953..176ce105625 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/RectangleShape.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/RectangleShape.java
@@ -8,53 +8,53 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.ats.workflow.editor.model;
-
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.ui.plugin.util.Result;
-import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
-import org.eclipse.osee.framework.ui.swt.ImageManager;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * A rectangular shape.
- *
- * @author Donald G. Dunne
- */
-public class RectangleShape extends Shape {
- /** A 16x16 pictogram of a rectangular shape. */
-
- public RectangleShape() {
- setSize(new Dimension(100, 50));
- }
-
- @SuppressWarnings("unused")
- @Override
- public Result validForSave() throws OseeCoreException {
- return Result.TrueResult;
- }
-
- @Override
- public Image getIcon() {
- return ImageManager.getImage(FrameworkImage.RECTANGLE_16);
- }
-
- @Override
- protected String getName() {
- return null;
- }
-
- @Override
- protected String getToolTip() {
- return null;
- }
-
- @SuppressWarnings("unused")
- @Override
- public Result doSave(SkynetTransaction transaction) throws OseeCoreException {
- return Result.TrueResult;
- }
-
-}
+package org.eclipse.osee.ats.workflow.editor.model;
+
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
+import org.eclipse.osee.framework.ui.swt.ImageManager;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * A rectangular shape.
+ *
+ * @author Donald G. Dunne
+ */
+public class RectangleShape extends Shape {
+ /** A 16x16 pictogram of a rectangular shape. */
+
+ public RectangleShape() {
+ setSize(new Dimension(100, 50));
+ }
+
+ @SuppressWarnings("unused")
+ @Override
+ public Result validForSave() throws OseeCoreException {
+ return Result.TrueResult;
+ }
+
+ @Override
+ public Image getIcon() {
+ return ImageManager.getImage(FrameworkImage.RECTANGLE_16);
+ }
+
+ @Override
+ protected String getName() {
+ return null;
+ }
+
+ @Override
+ protected String getToolTip() {
+ return null;
+ }
+
+ @SuppressWarnings("unused")
+ @Override
+ public Result doSave(SkynetTransaction transaction) throws OseeCoreException {
+ return Result.TrueResult;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/Shape.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/Shape.java
index 9a2938eca0b..b4d924266c2 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/Shape.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/Shape.java
@@ -8,284 +8,284 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.ats.workflow.editor.model;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.PropertyDescriptor;
-import org.eclipse.ui.views.properties.TextPropertyDescriptor;
-
-/**
- * Abstract prototype of a shape. Has a size (width and height), a location (x and y position) and a list of incoming
- * and outgoing connections. Use subclasses to instantiate a specific shape.
- *
- * @see org.eclipse.osee.ats.workflow.editor.model.WorkPageShape
- * @see org.eclipse.osee.ats.workflow.editor.model.EllipticalShape
- * @author Donald G. Dunne
- */
-public abstract class Shape extends ModelElement {
-
- /**
- * A static array of property descriptors. There is one IPropertyDescriptor entry per editable property.
- *
- * @see #getPropertyDescriptors()
- * @see #getPropertyValue(Object)
- * @see #setPropertyValue(Object, Object)
- */
- private IPropertyDescriptor[] descriptors;
- private final List<IPropertyDescriptor> descriptorList = new ArrayList<IPropertyDescriptor>();
- /** ID for the Height property value (used for by the corresponding property descriptor). */
- private static final String HEIGHT_PROP = "Shape.Height";
- /** Property ID to use when the location of this shape is modified. */
- public static final String LOCATION_PROP = "Shape.Location";
- private static final long serialVersionUID = 1;
- /** Property ID to use then the size of this shape is modified. */
- public static final String SIZE_PROP = "Shape.Size";
- /** Property ID to use when the list of outgoing connections is modified. */
- public static final String SOURCE_CONNECTIONS_PROP = "Shape.SourceConn";
- /** Property ID to use when the list of incoming connections is modified. */
- public static final String TARGET_CONNECTIONS_PROP = "Shape.TargetConn";
- /** ID for the Width property value (used for by the corresponding property descriptor). */
- private static final String WIDTH_PROP = "Shape.Width";
-
- /** ID for the X property value (used for by the corresponding property descriptor). */
- private static final String XPOS_PROP = "Shape.xPos";
- /** ID for the Y property value (used for by the corresponding property descriptor). */
- private static final String YPOS_PROP = "Shape.yPos";
-
- protected abstract String getName();
-
- protected abstract String getToolTip();
-
- /** Location of this shape. */
- private final Point location = new Point(0, 0);
- /** Size of this shape. */
- private final Dimension size = new Dimension(50, 50);
- /** List of outgoing Connections. */
- private final List<Connection> sourceConnections = new ArrayList<Connection>();
- /** List of incoming Connections. */
- private final List<Connection> targetConnections = new ArrayList<Connection>();
- private WorkflowDiagram workflowDiagram;
-
- /**
- * Add an incoming or outgoing connection to this shape.
- *
- * @param conn a non-null connection instance
- * @throws IllegalArgumentException if the connection is null or has not distinct endpoints
- */
- void addConnection(Connection conn) {
- if (conn == null || conn.getSource() == conn.getTarget()) {
- throw new IllegalArgumentException();
- }
- if (conn.getSource() == this) {
- sourceConnections.add(conn);
- firePropertyChange(SOURCE_CONNECTIONS_PROP, null, conn);
- } else if (conn.getTarget() == this) {
- targetConnections.add(conn);
- firePropertyChange(TARGET_CONNECTIONS_PROP, null, conn);
- }
- }
-
- /**
- * Return a pictogram (small icon) describing this model element. Children should override this method and return an
- * appropriate Image.
- *
- * @return a 16x16 Image or null
- */
- public abstract Image getIcon();
-
- /**
- * Return the Location of this shape.
- *
- * @return a non-null location instance
- */
- public Point getLocation() {
- return location.getCopy();
- }
-
- /**
- * Returns an array of IPropertyDescriptors for this shape.
- * <p>
- * The returned array is used to fill the property view, when the edit-part corresponding to this model element is
- * selected.
- * </p>
- *
- * @see #descriptors
- * @see #getPropertyValue(Object)
- * @see #setPropertyValue(Object, Object)
- */
- @Override
- public IPropertyDescriptor[] getPropertyDescriptors() {
- if (descriptors == null) {
- initializePropertyDescriptors(descriptorList);
- descriptors = descriptorList.toArray(new IPropertyDescriptor[descriptorList.size()]);
- }
- return descriptors;
- }
-
- protected void initializePropertyDescriptors(List<IPropertyDescriptor> descriptorList) {
- descriptorList.add(new TextPropertyDescriptor(XPOS_PROP, "X")); // id and description pair
- descriptorList.add(new TextPropertyDescriptor(YPOS_PROP, "Y"));
- descriptorList.add(new TextPropertyDescriptor(WIDTH_PROP, "Width"));
- descriptorList.add(new TextPropertyDescriptor(HEIGHT_PROP, "Height"));
- // use a custom cell editor validator for all four array entries
- for (IPropertyDescriptor descriptor : descriptorList) {
- ((PropertyDescriptor) descriptor).setValidator(new ICellEditorValidator() {
- @Override
- public String isValid(Object value) {
- int intValue = -1;
- try {
- intValue = Integer.parseInt((String) value);
- } catch (NumberFormatException exc) {
- return "Not a number";
- }
- return intValue >= 0 ? null : "Value must be >= 0";
- }
- });
- }
- }
-
- /**
- * Return the property value for the given propertyId, or null.
- * <p>
- * The property view uses the IDs from the IPropertyDescriptors array to obtain the value of the corresponding
- * properties.
- * </p>
- *
- * @see #descriptors
- * @see #getPropertyDescriptors()
- */
- @Override
- public Object getPropertyValue(Object propertyId) {
- if (XPOS_PROP.equals(propertyId)) {
- return Integer.toString(location.x);
- }
- if (YPOS_PROP.equals(propertyId)) {
- return Integer.toString(location.y);
- }
- if (HEIGHT_PROP.equals(propertyId)) {
- return Integer.toString(size.height);
- }
- if (WIDTH_PROP.equals(propertyId)) {
- return Integer.toString(size.width);
- }
- return super.getPropertyValue(propertyId);
- }
-
- /**
- * Return the Size of this shape.
- *
- * @return a non-null Dimension instance
- */
- public Dimension getSize() {
- return size.getCopy();
- }
-
- /**
- * Return a List of outgoing Connections.
- */
- public List<Connection> getSourceConnections() {
- return new ArrayList<Connection>(sourceConnections);
- }
-
- /**
- * Return a List of incoming Connections.
- */
- public List<Connection> getTargetConnections() {
- return new ArrayList<Connection>(targetConnections);
- }
-
- /**
- * Remove an incoming or outgoing connection from this shape.
- *
- * @param conn a non-null connection instance
- * @throws IllegalArgumentException if the parameter is null
- */
- void removeConnection(Connection conn) {
- if (conn == null) {
- throw new IllegalArgumentException();
- }
- if (conn.getSource() == this) {
- sourceConnections.remove(conn);
- firePropertyChange(SOURCE_CONNECTIONS_PROP, null, conn);
- } else if (conn.getTarget() == this) {
- targetConnections.remove(conn);
- firePropertyChange(TARGET_CONNECTIONS_PROP, null, conn);
- }
- }
-
- /**
- * Set the Location of this shape.
- *
- * @param newLocation a non-null Point instance
- * @throws IllegalArgumentException if the parameter is null
- */
- public void setLocation(Point newLocation) {
- if (newLocation == null) {
- throw new IllegalArgumentException();
- }
- location.setLocation(newLocation);
- firePropertyChange(LOCATION_PROP, null, location);
- }
-
- /**
- * Set the property value for the given property id. If no matching id is found, the call is forwarded to the
- * superclass.
- * <p>
- * The property view uses the IDs from the IPropertyDescriptors array to set the values of the corresponding
- * properties.
- * </p>
- *
- * @see #descriptors
- * @see #getPropertyDescriptors()
- */
- @Override
- public void setPropertyValue(Object propertyId, Object value) {
- if (XPOS_PROP.equals(propertyId)) {
- int x = Integer.parseInt((String) value);
- setLocation(new Point(x, location.y));
- } else if (YPOS_PROP.equals(propertyId)) {
- int y = Integer.parseInt((String) value);
- setLocation(new Point(location.x, y));
- } else if (HEIGHT_PROP.equals(propertyId)) {
- int height = Integer.parseInt((String) value);
- setSize(new Dimension(size.width, height));
- } else if (WIDTH_PROP.equals(propertyId)) {
- int width = Integer.parseInt((String) value);
- setSize(new Dimension(width, size.height));
- } else {
- super.setPropertyValue(propertyId, value);
- }
- }
-
- /**
- * Set the Size of this shape. Will not modify the size if newSize is null.
- *
- * @param newSize a non-null Dimension instance or null
- */
- public void setSize(Dimension newSize) {
- if (newSize != null) {
- size.setSize(newSize);
- firePropertyChange(SIZE_PROP, null, size);
- }
- }
-
- /**
- * @return the workflowDiagram
- */
- public WorkflowDiagram getWorkflowDiagram() {
- return workflowDiagram;
- }
-
- /**
- * @param workflowDiagram the workflowDiagram to set
- */
- public void setWorkflowDiagram(WorkflowDiagram workflowDiagram) {
- this.workflowDiagram = workflowDiagram;
- }
+package org.eclipse.osee.ats.workflow.editor.model;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.jface.viewers.ICellEditorValidator;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.PropertyDescriptor;
+import org.eclipse.ui.views.properties.TextPropertyDescriptor;
+
+/**
+ * Abstract prototype of a shape. Has a size (width and height), a location (x and y position) and a list of incoming
+ * and outgoing connections. Use subclasses to instantiate a specific shape.
+ *
+ * @see org.eclipse.osee.ats.workflow.editor.model.WorkPageShape
+ * @see org.eclipse.osee.ats.workflow.editor.model.EllipticalShape
+ * @author Donald G. Dunne
+ */
+public abstract class Shape extends ModelElement {
+
+ /**
+ * A static array of property descriptors. There is one IPropertyDescriptor entry per editable property.
+ *
+ * @see #getPropertyDescriptors()
+ * @see #getPropertyValue(Object)
+ * @see #setPropertyValue(Object, Object)
+ */
+ private IPropertyDescriptor[] descriptors;
+ private final List<IPropertyDescriptor> descriptorList = new ArrayList<IPropertyDescriptor>();
+ /** ID for the Height property value (used for by the corresponding property descriptor). */
+ private static final String HEIGHT_PROP = "Shape.Height";
+ /** Property ID to use when the location of this shape is modified. */
+ public static final String LOCATION_PROP = "Shape.Location";
+ private static final long serialVersionUID = 1;
+ /** Property ID to use then the size of this shape is modified. */
+ public static final String SIZE_PROP = "Shape.Size";
+ /** Property ID to use when the list of outgoing connections is modified. */
+ public static final String SOURCE_CONNECTIONS_PROP = "Shape.SourceConn";
+ /** Property ID to use when the list of incoming connections is modified. */
+ public static final String TARGET_CONNECTIONS_PROP = "Shape.TargetConn";
+ /** ID for the Width property value (used for by the corresponding property descriptor). */
+ private static final String WIDTH_PROP = "Shape.Width";
+
+ /** ID for the X property value (used for by the corresponding property descriptor). */
+ private static final String XPOS_PROP = "Shape.xPos";
+ /** ID for the Y property value (used for by the corresponding property descriptor). */
+ private static final String YPOS_PROP = "Shape.yPos";
+
+ protected abstract String getName();
+
+ protected abstract String getToolTip();
+
+ /** Location of this shape. */
+ private final Point location = new Point(0, 0);
+ /** Size of this shape. */
+ private final Dimension size = new Dimension(50, 50);
+ /** List of outgoing Connections. */
+ private final List<Connection> sourceConnections = new ArrayList<Connection>();
+ /** List of incoming Connections. */
+ private final List<Connection> targetConnections = new ArrayList<Connection>();
+ private WorkflowDiagram workflowDiagram;
+
+ /**
+ * Add an incoming or outgoing connection to this shape.
+ *
+ * @param conn a non-null connection instance
+ * @throws IllegalArgumentException if the connection is null or has not distinct endpoints
+ */
+ void addConnection(Connection conn) {
+ if (conn == null || conn.getSource() == conn.getTarget()) {
+ throw new IllegalArgumentException();
+ }
+ if (conn.getSource() == this) {
+ sourceConnections.add(conn);
+ firePropertyChange(SOURCE_CONNECTIONS_PROP, null, conn);
+ } else if (conn.getTarget() == this) {
+ targetConnections.add(conn);
+ firePropertyChange(TARGET_CONNECTIONS_PROP, null, conn);
+ }
+ }
+
+ /**
+ * Return a pictogram (small icon) describing this model element. Children should override this method and return an
+ * appropriate Image.
+ *
+ * @return a 16x16 Image or null
+ */
+ public abstract Image getIcon();
+
+ /**
+ * Return the Location of this shape.
+ *
+ * @return a non-null location instance
+ */
+ public Point getLocation() {
+ return location.getCopy();
+ }
+
+ /**
+ * Returns an array of IPropertyDescriptors for this shape.
+ * <p>
+ * The returned array is used to fill the property view, when the edit-part corresponding to this model element is
+ * selected.
+ * </p>
+ *
+ * @see #descriptors
+ * @see #getPropertyValue(Object)
+ * @see #setPropertyValue(Object, Object)
+ */
+ @Override
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ if (descriptors == null) {
+ initializePropertyDescriptors(descriptorList);
+ descriptors = descriptorList.toArray(new IPropertyDescriptor[descriptorList.size()]);
+ }
+ return descriptors;
+ }
+
+ protected void initializePropertyDescriptors(List<IPropertyDescriptor> descriptorList) {
+ descriptorList.add(new TextPropertyDescriptor(XPOS_PROP, "X")); // id and description pair
+ descriptorList.add(new TextPropertyDescriptor(YPOS_PROP, "Y"));
+ descriptorList.add(new TextPropertyDescriptor(WIDTH_PROP, "Width"));
+ descriptorList.add(new TextPropertyDescriptor(HEIGHT_PROP, "Height"));
+ // use a custom cell editor validator for all four array entries
+ for (IPropertyDescriptor descriptor : descriptorList) {
+ ((PropertyDescriptor) descriptor).setValidator(new ICellEditorValidator() {
+ @Override
+ public String isValid(Object value) {
+ int intValue = -1;
+ try {
+ intValue = Integer.parseInt((String) value);
+ } catch (NumberFormatException exc) {
+ return "Not a number";
+ }
+ return intValue >= 0 ? null : "Value must be >= 0";
+ }
+ });
+ }
+ }
+
+ /**
+ * Return the property value for the given propertyId, or null.
+ * <p>
+ * The property view uses the IDs from the IPropertyDescriptors array to obtain the value of the corresponding
+ * properties.
+ * </p>
+ *
+ * @see #descriptors
+ * @see #getPropertyDescriptors()
+ */
+ @Override
+ public Object getPropertyValue(Object propertyId) {
+ if (XPOS_PROP.equals(propertyId)) {
+ return Integer.toString(location.x);
+ }
+ if (YPOS_PROP.equals(propertyId)) {
+ return Integer.toString(location.y);
+ }
+ if (HEIGHT_PROP.equals(propertyId)) {
+ return Integer.toString(size.height);
+ }
+ if (WIDTH_PROP.equals(propertyId)) {
+ return Integer.toString(size.width);
+ }
+ return super.getPropertyValue(propertyId);
+ }
+
+ /**
+ * Return the Size of this shape.
+ *
+ * @return a non-null Dimension instance
+ */
+ public Dimension getSize() {
+ return size.getCopy();
+ }
+
+ /**
+ * Return a List of outgoing Connections.
+ */
+ public List<Connection> getSourceConnections() {
+ return new ArrayList<Connection>(sourceConnections);
+ }
+
+ /**
+ * Return a List of incoming Connections.
+ */
+ public List<Connection> getTargetConnections() {
+ return new ArrayList<Connection>(targetConnections);
+ }
+
+ /**
+ * Remove an incoming or outgoing connection from this shape.
+ *
+ * @param conn a non-null connection instance
+ * @throws IllegalArgumentException if the parameter is null
+ */
+ void removeConnection(Connection conn) {
+ if (conn == null) {
+ throw new IllegalArgumentException();
+ }
+ if (conn.getSource() == this) {
+ sourceConnections.remove(conn);
+ firePropertyChange(SOURCE_CONNECTIONS_PROP, null, conn);
+ } else if (conn.getTarget() == this) {
+ targetConnections.remove(conn);
+ firePropertyChange(TARGET_CONNECTIONS_PROP, null, conn);
+ }
+ }
+
+ /**
+ * Set the Location of this shape.
+ *
+ * @param newLocation a non-null Point instance
+ * @throws IllegalArgumentException if the parameter is null
+ */
+ public void setLocation(Point newLocation) {
+ if (newLocation == null) {
+ throw new IllegalArgumentException();
+ }
+ location.setLocation(newLocation);
+ firePropertyChange(LOCATION_PROP, null, location);
+ }
+
+ /**
+ * Set the property value for the given property id. If no matching id is found, the call is forwarded to the
+ * superclass.
+ * <p>
+ * The property view uses the IDs from the IPropertyDescriptors array to set the values of the corresponding
+ * properties.
+ * </p>
+ *
+ * @see #descriptors
+ * @see #getPropertyDescriptors()
+ */
+ @Override
+ public void setPropertyValue(Object propertyId, Object value) {
+ if (XPOS_PROP.equals(propertyId)) {
+ int x = Integer.parseInt((String) value);
+ setLocation(new Point(x, location.y));
+ } else if (YPOS_PROP.equals(propertyId)) {
+ int y = Integer.parseInt((String) value);
+ setLocation(new Point(location.x, y));
+ } else if (HEIGHT_PROP.equals(propertyId)) {
+ int height = Integer.parseInt((String) value);
+ setSize(new Dimension(size.width, height));
+ } else if (WIDTH_PROP.equals(propertyId)) {
+ int width = Integer.parseInt((String) value);
+ setSize(new Dimension(width, size.height));
+ } else {
+ super.setPropertyValue(propertyId, value);
+ }
+ }
+
+ /**
+ * Set the Size of this shape. Will not modify the size if newSize is null.
+ *
+ * @param newSize a non-null Dimension instance or null
+ */
+ public void setSize(Dimension newSize) {
+ if (newSize != null) {
+ size.setSize(newSize);
+ firePropertyChange(SIZE_PROP, null, size);
+ }
+ }
+
+ /**
+ * @return the workflowDiagram
+ */
+ public WorkflowDiagram getWorkflowDiagram() {
+ return workflowDiagram;
+ }
+
+ /**
+ * @param workflowDiagram the workflowDiagram to set
+ */
+ public void setWorkflowDiagram(WorkflowDiagram workflowDiagram) {
+ this.workflowDiagram = workflowDiagram;
+ }
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/TransitionConnection.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/TransitionConnection.java
index 7e27cd205e3..638a757b754 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/TransitionConnection.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/TransitionConnection.java
@@ -8,87 +8,87 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.ats.workflow.editor.model;
-
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.ui.plugin.util.Result;
-import org.eclipse.osee.framework.ui.swt.Displays;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.TextPropertyDescriptor;
-
-/**
- * A connection between two distinct shapes.
- *
- * @author Donald G. Dunne
- */
-public class TransitionConnection extends Connection {
-
- /** Property ID to use when the line style of this connection is modified. */
- public static final String TYPE_PROP = "Type";
- private static final IPropertyDescriptor[] descriptors = new IPropertyDescriptor[1];
-
- static {
- descriptors[0] = new TextPropertyDescriptor(TYPE_PROP, TYPE_PROP);
- }
-
- public TransitionConnection(Shape source, Shape target) {
- super(source, target);
- }
-
- @Override
- public Color getForegroundColor() {
- return Displays.getSystemColor(SWT.COLOR_BLACK);
- }
-
- @Override
- public String toString() {
- return "Transition: " + getPropertyValue(TYPE_PROP);
- }
-
- @Override
- public Result validForSave() {
- System.err.println("Add Connection validations.");
- return Result.TrueResult;
- }
-
- /**
- * Returns the descriptor for the lineStyle property
- *
- * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()
- */
- @Override
- public IPropertyDescriptor[] getPropertyDescriptors() {
- return descriptors;
- }
-
- /**
- * Returns the lineStyle as String for the Property Sheet
- *
- * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
- */
- @Override
- public Object getPropertyValue(Object id) {
- if (id.equals(TYPE_PROP)) {
- return getLabel();
- }
- return super.getPropertyValue(id);
- }
-
- @Override
- public String getLabel() {
- return "Transition";
- }
-
- @Override
- public int getLineWidth() {
- return 2;
- }
-
- @Override
- public Result doSave(SkynetTransaction transaction) {
- return Result.TrueResult;
- }
-
+package org.eclipse.osee.ats.workflow.editor.model;
+
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+import org.eclipse.osee.framework.ui.swt.Displays;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.TextPropertyDescriptor;
+
+/**
+ * A connection between two distinct shapes.
+ *
+ * @author Donald G. Dunne
+ */
+public class TransitionConnection extends Connection {
+
+ /** Property ID to use when the line style of this connection is modified. */
+ public static final String TYPE_PROP = "Type";
+ private static final IPropertyDescriptor[] descriptors = new IPropertyDescriptor[1];
+
+ static {
+ descriptors[0] = new TextPropertyDescriptor(TYPE_PROP, TYPE_PROP);
+ }
+
+ public TransitionConnection(Shape source, Shape target) {
+ super(source, target);
+ }
+
+ @Override
+ public Color getForegroundColor() {
+ return Displays.getSystemColor(SWT.COLOR_BLACK);
+ }
+
+ @Override
+ public String toString() {
+ return "Transition: " + getPropertyValue(TYPE_PROP);
+ }
+
+ @Override
+ public Result validForSave() {
+ System.err.println("Add Connection validations.");
+ return Result.TrueResult;
+ }
+
+ /**
+ * Returns the descriptor for the lineStyle property
+ *
+ * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()
+ */
+ @Override
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ return descriptors;
+ }
+
+ /**
+ * Returns the lineStyle as String for the Property Sheet
+ *
+ * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
+ */
+ @Override
+ public Object getPropertyValue(Object id) {
+ if (id.equals(TYPE_PROP)) {
+ return getLabel();
+ }
+ return super.getPropertyValue(id);
+ }
+
+ @Override
+ public String getLabel() {
+ return "Transition";
+ }
+
+ @Override
+ public int getLineWidth() {
+ return 2;
+ }
+
+ @Override
+ public Result doSave(SkynetTransaction transaction) {
+ return Result.TrueResult;
+ }
+
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/WorkPageShape.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/WorkPageShape.java
index e4e4894ad82..7868ca713f4 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/WorkPageShape.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/WorkPageShape.java
@@ -8,255 +8,255 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.ats.workflow.editor.model;
-
-import java.util.List;
-import java.util.logging.Level;
-import org.eclipse.osee.ats.internal.AtsPlugin;
-import org.eclipse.osee.ats.util.AtsUtil;
-import org.eclipse.osee.ats.workflow.item.AtsWorkDefinitions;
-import org.eclipse.osee.ats.workflow.page.AtsCancelledWorkPageDefinition;
-import org.eclipse.osee.ats.workflow.page.AtsCompletedWorkPageDefinition;
-import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.jdk.core.util.Strings;
-import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.ui.plugin.util.Result;
-import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkItemDefinition.WriteType;
-import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkItemDefinitionFactory;
-import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPageDefinition;
-import org.eclipse.ui.views.properties.ComboBoxPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.TextPropertyDescriptor;
-
-/**
- * A rectangular shape.
- *
- * @author Donald G. Dunne
- */
-public class WorkPageShape extends RectangleShape {
- private static final String[] attributeProperties = new String[] { //
- CoreAttributeTypes.WorkPageName.getName(), //
- CoreAttributeTypes.WorkId.getName(), //
- CoreAttributeTypes.WorkParentId.getName(),//
- };
-
- private final WorkPageDefinition workPageDefinition;
-
- public static String START_PAGE = "Start Page";
- private Artifact artifact;
- public static enum StartPageEnum {
- Yes,
- No
- };
-
- public WorkPageShape() {
- this(new WorkPageDefinition("New" + AtsUtil.getAtsDeveloperIncrementingNum(), "NEW", null));
- }
-
- public WorkPageShape(WorkPageDefinition workPageDefinition) {
- this.workPageDefinition = workPageDefinition;
- try {
- artifact = WorkItemDefinitionFactory.getWorkItemDefinitionArtifact(workPageDefinition.getId());
- } catch (OseeCoreException ex) {
- OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
- }
- }
-
- @Override
- public void setWorkflowDiagram(WorkflowDiagram workflowDiagram) {
- super.setWorkflowDiagram(workflowDiagram);
- if (getId().equals("NEW")) {
- setPropertyValue(
- CoreAttributeTypes.WorkId.getName(),
- workflowDiagram.getWorkFlowDefinition().getId() + "." + getPropertyValue(CoreAttributeTypes.WorkPageName.getName()));
- }
- }
-
- @Override
- protected void initializePropertyDescriptors(List<IPropertyDescriptor> descriptorList) {
- super.initializePropertyDescriptors(descriptorList);
- for (String type : attributeProperties) {
- descriptorList.add(new TextPropertyDescriptor(type, type)); // id and description pair
- }
- descriptorList.add(new ComboBoxPropertyDescriptor(START_PAGE, START_PAGE, new String[] {
- StartPageEnum.Yes.name(),
- StartPageEnum.No.name()}));
- }
-
- @Override
- protected void initializePropertyValues() throws OseeCoreException {
- if (propertyValues == null) {
- super.initializePropertyValues();
- super.setPropertyValue(CoreAttributeTypes.WorkPageName.getName(), workPageDefinition.getPageName());
- super.setPropertyValue(CoreAttributeTypes.WorkId.getName(), workPageDefinition.getId());
- super.setPropertyValue(CoreAttributeTypes.WorkParentId.getName(),
- workPageDefinition.getParentId() == null ? "" : workPageDefinition.getParentId());
- }
- }
-
- public boolean isStartPage() {
- if (getPropertyValue(START_PAGE) == null) {
- return false;
- }
- return (Integer) getPropertyValue(START_PAGE) == StartPageEnum.Yes.ordinal();
- }
-
- public void setStartPage(boolean set) {
- setPropertyValue(START_PAGE, set ? StartPageEnum.Yes.ordinal() : StartPageEnum.No.ordinal());
- }
-
- @Override
- public Object getPropertyValue(Object propertyId) {
- try {
- initializePropertyValues();
- } catch (OseeCoreException ex) {
- OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
- }
- return super.getPropertyValue(propertyId);
- }
-
- public Artifact getArtifact() {
- return artifact;
- }
-
- /**
- * @return the workPageDefinition
- */
- public WorkPageDefinition getWorkPageDefinition() {
- return workPageDefinition;
- }
-
- @Override
- public Result validForSave() {
- try {
- String pageName = (String) getPropertyValue(CoreAttributeTypes.WorkPageName.getName());
- if (!Strings.isValid(pageName)) {
- return new Result(CoreAttributeTypes.WorkPageName.getName() + " can not be null");
- }
- String pageId = (String) getPropertyValue(CoreAttributeTypes.WorkId.getName());
- if (!Strings.isValid(pageId)) {
- return new Result(CoreAttributeTypes.WorkId.getName() + " can not be null");
- }
- String parentPageId = (String) getPropertyValue(CoreAttributeTypes.WorkParentId.getName());
- if (Strings.isValid(parentPageId)) {
- if (WorkItemDefinitionFactory.getWorkItemDefinition(parentPageId) == null) {
- return new Result("Parent Id " + parentPageId + " Work Page Definition must exist and does not.");
- }
- }
- } catch (OseeCoreException ex) {
- return new Result("Exception in validation " + ex.getLocalizedMessage());
- }
- return Result.TrueResult;
- }
-
- public boolean isInstanceof(String workPageDefinitionId) throws OseeCoreException {
- return isInstanceofRecurse(workPageDefinition, workPageDefinitionId);
- }
-
- private boolean isInstanceofRecurse(WorkPageDefinition workPageDefinition, String workPageDefinitionId) throws OseeCoreException {
- if (workPageDefinition.getId().equals(workPageDefinitionId)) {
- return true;
- }
- if (workPageDefinition.getParent() != null) {
- return isInstanceofRecurse((WorkPageDefinition) workPageDefinition.getParent(), workPageDefinitionId);
- }
- return false;
- }
-
- public boolean isCancelledState() throws OseeCoreException {
- return isInstanceof(AtsCancelledWorkPageDefinition.ID);
- }
-
- public boolean isCompletedState() throws OseeCoreException {
- return isInstanceof(AtsCompletedWorkPageDefinition.ID);
- }
-
- @Override
- public String getName() {
- return (String) getPropertyValue(CoreAttributeTypes.WorkPageName.getName());
- }
-
- @Override
- public String getToolTip() {
- return workPageDefinition.toString();
- }
-
- @Override
- public String toString() {
- return getId();
- }
-
- public String getId() {
- return (String) getPropertyValue(CoreAttributeTypes.WorkId.getName());
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj instanceof WorkPageShape) {
- return ((WorkPageShape) obj).getId().equals(getId());
- }
- return super.equals(obj);
- }
-
- @Override
- public int hashCode() {
- return getId().hashCode();
- }
-
- @Override
- public void setPropertyValue(Object propertyId, Object value) {
- try {
- initializePropertyValues();
- if (CoreAttributeTypes.WorkPageName.getName().equals(propertyId)) {
- super.setPropertyValue(CoreAttributeTypes.WorkPageName.getName(), value);
- firePropertyChange(CoreAttributeTypes.WorkPageName.getName(), null, value);
- setPropertyValue(CoreAttributeTypes.WorkId.getName(),
- getWorkflowDiagram().getWorkFlowDefinition().getId() + "." + value);
- } else if (CoreAttributeTypes.WorkId.getName().equals(propertyId)) {
- super.setPropertyValue(CoreAttributeTypes.WorkId.getName(), value);
- firePropertyChange(CoreAttributeTypes.WorkId.getName(), null, value);
- } else if (CoreAttributeTypes.WorkParentId.getName().equals(propertyId)) {
- super.setPropertyValue(CoreAttributeTypes.WorkParentId.getName(), value);
- firePropertyChange(CoreAttributeTypes.WorkParentId.getName(), null, value);
- } else if (START_PAGE.equals(propertyId)) {
- super.setPropertyValue(START_PAGE, value);
- firePropertyChange(START_PAGE, null, value);
- } else {
- super.setPropertyValue(propertyId, value);
- }
- } catch (OseeCoreException ex) {
- OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
- }
- }
-
- @Override
- public Result doSave(SkynetTransaction transaction) throws OseeCoreException {
- String name = (String) getPropertyValue(CoreAttributeTypes.WorkPageName.getName());
- String workId = (String) getPropertyValue(CoreAttributeTypes.WorkId.getName());
- String parentWorkId = (String) getPropertyValue(CoreAttributeTypes.WorkParentId.getName());
-
- workPageDefinition.setPageName(name);
- workPageDefinition.setId(workId);
- workPageDefinition.setParentId(parentWorkId);
- Artifact artifact = getArtifact();
- if (artifact == null) {
- artifact = workPageDefinition.toArtifact(WriteType.New);
- } else {
- artifact.setSoleAttributeValue(CoreAttributeTypes.WorkPageName, name);
- artifact.setSoleAttributeValue(CoreAttributeTypes.WorkId, workId);
- if (!Strings.isValid(parentWorkId)) {
- artifact.deleteSoleAttribute(CoreAttributeTypes.WorkParentId);
- } else {
- artifact.setSoleAttributeValue(CoreAttributeTypes.WorkParentId, parentWorkId);
- }
- }
- artifact.setName(workId);
- AtsWorkDefinitions.addUpdateWorkItemToDefaultHeirarchy(artifact, transaction);
- WorkItemDefinitionFactory.deCache(workPageDefinition);
- artifact.persist(transaction);
- return Result.TrueResult;
- }
-}
+package org.eclipse.osee.ats.workflow.editor.model;
+
+import java.util.List;
+import java.util.logging.Level;
+import org.eclipse.osee.ats.internal.AtsPlugin;
+import org.eclipse.osee.ats.util.AtsUtil;
+import org.eclipse.osee.ats.workflow.item.AtsWorkDefinitions;
+import org.eclipse.osee.ats.workflow.page.AtsCancelledWorkPageDefinition;
+import org.eclipse.osee.ats.workflow.page.AtsCompletedWorkPageDefinition;
+import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.util.Strings;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkItemDefinition.WriteType;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkItemDefinitionFactory;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPageDefinition;
+import org.eclipse.ui.views.properties.ComboBoxPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.TextPropertyDescriptor;
+
+/**
+ * A rectangular shape.
+ *
+ * @author Donald G. Dunne
+ */
+public class WorkPageShape extends RectangleShape {
+ private static final String[] attributeProperties = new String[] { //
+ CoreAttributeTypes.WorkPageName.getName(), //
+ CoreAttributeTypes.WorkId.getName(), //
+ CoreAttributeTypes.WorkParentId.getName(),//
+ };
+
+ private final WorkPageDefinition workPageDefinition;
+
+ public static String START_PAGE = "Start Page";
+ private Artifact artifact;
+ public static enum StartPageEnum {
+ Yes,
+ No
+ };
+
+ public WorkPageShape() {
+ this(new WorkPageDefinition("New" + AtsUtil.getAtsDeveloperIncrementingNum(), "NEW", null));
+ }
+
+ public WorkPageShape(WorkPageDefinition workPageDefinition) {
+ this.workPageDefinition = workPageDefinition;
+ try {
+ artifact = WorkItemDefinitionFactory.getWorkItemDefinitionArtifact(workPageDefinition.getId());
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+
+ @Override
+ public void setWorkflowDiagram(WorkflowDiagram workflowDiagram) {
+ super.setWorkflowDiagram(workflowDiagram);
+ if (getId().equals("NEW")) {
+ setPropertyValue(
+ CoreAttributeTypes.WorkId.getName(),
+ workflowDiagram.getWorkFlowDefinition().getId() + "." + getPropertyValue(CoreAttributeTypes.WorkPageName.getName()));
+ }
+ }
+
+ @Override
+ protected void initializePropertyDescriptors(List<IPropertyDescriptor> descriptorList) {
+ super.initializePropertyDescriptors(descriptorList);
+ for (String type : attributeProperties) {
+ descriptorList.add(new TextPropertyDescriptor(type, type)); // id and description pair
+ }
+ descriptorList.add(new ComboBoxPropertyDescriptor(START_PAGE, START_PAGE, new String[] {
+ StartPageEnum.Yes.name(),
+ StartPageEnum.No.name()}));
+ }
+
+ @Override
+ protected void initializePropertyValues() throws OseeCoreException {
+ if (propertyValues == null) {
+ super.initializePropertyValues();
+ super.setPropertyValue(CoreAttributeTypes.WorkPageName.getName(), workPageDefinition.getPageName());
+ super.setPropertyValue(CoreAttributeTypes.WorkId.getName(), workPageDefinition.getId());
+ super.setPropertyValue(CoreAttributeTypes.WorkParentId.getName(),
+ workPageDefinition.getParentId() == null ? "" : workPageDefinition.getParentId());
+ }
+ }
+
+ public boolean isStartPage() {
+ if (getPropertyValue(START_PAGE) == null) {
+ return false;
+ }
+ return (Integer) getPropertyValue(START_PAGE) == StartPageEnum.Yes.ordinal();
+ }
+
+ public void setStartPage(boolean set) {
+ setPropertyValue(START_PAGE, set ? StartPageEnum.Yes.ordinal() : StartPageEnum.No.ordinal());
+ }
+
+ @Override
+ public Object getPropertyValue(Object propertyId) {
+ try {
+ initializePropertyValues();
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ return super.getPropertyValue(propertyId);
+ }
+
+ public Artifact getArtifact() {
+ return artifact;
+ }
+
+ /**
+ * @return the workPageDefinition
+ */
+ public WorkPageDefinition getWorkPageDefinition() {
+ return workPageDefinition;
+ }
+
+ @Override
+ public Result validForSave() {
+ try {
+ String pageName = (String) getPropertyValue(CoreAttributeTypes.WorkPageName.getName());
+ if (!Strings.isValid(pageName)) {
+ return new Result(CoreAttributeTypes.WorkPageName.getName() + " can not be null");
+ }
+ String pageId = (String) getPropertyValue(CoreAttributeTypes.WorkId.getName());
+ if (!Strings.isValid(pageId)) {
+ return new Result(CoreAttributeTypes.WorkId.getName() + " can not be null");
+ }
+ String parentPageId = (String) getPropertyValue(CoreAttributeTypes.WorkParentId.getName());
+ if (Strings.isValid(parentPageId)) {
+ if (WorkItemDefinitionFactory.getWorkItemDefinition(parentPageId) == null) {
+ return new Result("Parent Id " + parentPageId + " Work Page Definition must exist and does not.");
+ }
+ }
+ } catch (OseeCoreException ex) {
+ return new Result("Exception in validation " + ex.getLocalizedMessage());
+ }
+ return Result.TrueResult;
+ }
+
+ public boolean isInstanceof(String workPageDefinitionId) throws OseeCoreException {
+ return isInstanceofRecurse(workPageDefinition, workPageDefinitionId);
+ }
+
+ private boolean isInstanceofRecurse(WorkPageDefinition workPageDefinition, String workPageDefinitionId) throws OseeCoreException {
+ if (workPageDefinition.getId().equals(workPageDefinitionId)) {
+ return true;
+ }
+ if (workPageDefinition.getParent() != null) {
+ return isInstanceofRecurse((WorkPageDefinition) workPageDefinition.getParent(), workPageDefinitionId);
+ }
+ return false;
+ }
+
+ public boolean isCancelledState() throws OseeCoreException {
+ return isInstanceof(AtsCancelledWorkPageDefinition.ID);
+ }
+
+ public boolean isCompletedState() throws OseeCoreException {
+ return isInstanceof(AtsCompletedWorkPageDefinition.ID);
+ }
+
+ @Override
+ public String getName() {
+ return (String) getPropertyValue(CoreAttributeTypes.WorkPageName.getName());
+ }
+
+ @Override
+ public String getToolTip() {
+ return workPageDefinition.toString();
+ }
+
+ @Override
+ public String toString() {
+ return getId();
+ }
+
+ public String getId() {
+ return (String) getPropertyValue(CoreAttributeTypes.WorkId.getName());
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj instanceof WorkPageShape) {
+ return ((WorkPageShape) obj).getId().equals(getId());
+ }
+ return super.equals(obj);
+ }
+
+ @Override
+ public int hashCode() {
+ return getId().hashCode();
+ }
+
+ @Override
+ public void setPropertyValue(Object propertyId, Object value) {
+ try {
+ initializePropertyValues();
+ if (CoreAttributeTypes.WorkPageName.getName().equals(propertyId)) {
+ super.setPropertyValue(CoreAttributeTypes.WorkPageName.getName(), value);
+ firePropertyChange(CoreAttributeTypes.WorkPageName.getName(), null, value);
+ setPropertyValue(CoreAttributeTypes.WorkId.getName(),
+ getWorkflowDiagram().getWorkFlowDefinition().getId() + "." + value);
+ } else if (CoreAttributeTypes.WorkId.getName().equals(propertyId)) {
+ super.setPropertyValue(CoreAttributeTypes.WorkId.getName(), value);
+ firePropertyChange(CoreAttributeTypes.WorkId.getName(), null, value);
+ } else if (CoreAttributeTypes.WorkParentId.getName().equals(propertyId)) {
+ super.setPropertyValue(CoreAttributeTypes.WorkParentId.getName(), value);
+ firePropertyChange(CoreAttributeTypes.WorkParentId.getName(), null, value);
+ } else if (START_PAGE.equals(propertyId)) {
+ super.setPropertyValue(START_PAGE, value);
+ firePropertyChange(START_PAGE, null, value);
+ } else {
+ super.setPropertyValue(propertyId, value);
+ }
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+
+ @Override
+ public Result doSave(SkynetTransaction transaction) throws OseeCoreException {
+ String name = (String) getPropertyValue(CoreAttributeTypes.WorkPageName.getName());
+ String workId = (String) getPropertyValue(CoreAttributeTypes.WorkId.getName());
+ String parentWorkId = (String) getPropertyValue(CoreAttributeTypes.WorkParentId.getName());
+
+ workPageDefinition.setPageName(name);
+ workPageDefinition.setId(workId);
+ workPageDefinition.setParentId(parentWorkId);
+ Artifact artifact = getArtifact();
+ if (artifact == null) {
+ artifact = workPageDefinition.toArtifact(WriteType.New);
+ } else {
+ artifact.setSoleAttributeValue(CoreAttributeTypes.WorkPageName, name);
+ artifact.setSoleAttributeValue(CoreAttributeTypes.WorkId, workId);
+ if (!Strings.isValid(parentWorkId)) {
+ artifact.deleteSoleAttribute(CoreAttributeTypes.WorkParentId);
+ } else {
+ artifact.setSoleAttributeValue(CoreAttributeTypes.WorkParentId, parentWorkId);
+ }
+ }
+ artifact.setName(workId);
+ AtsWorkDefinitions.addUpdateWorkItemToDefaultHeirarchy(artifact, transaction);
+ WorkItemDefinitionFactory.deCache(workPageDefinition);
+ artifact.persist(transaction);
+ return Result.TrueResult;
+ }
+}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/WorkflowDiagram.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/WorkflowDiagram.java
index 78b4bae9f04..12eb6b8edc3 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/WorkflowDiagram.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/WorkflowDiagram.java
@@ -8,288 +8,288 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.ats.workflow.editor.model;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import org.eclipse.osee.ats.internal.AtsPlugin;
-import org.eclipse.osee.ats.workflow.item.AtsWorkDefinitions;
-import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.logging.OseeLevel;
-import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.ui.plugin.util.Result;
-import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkFlowDefinition;
-import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkFlowDefinition.TransitionType;
-import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkItemDefinition.WriteType;
-import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkItemDefinitionFactory;
-import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPageDefinition;
-
-/**
- * A container for multiple shapes. This is the "root" of the model data structure.
- *
- * @author Donald G Dunne
- */
-public class WorkflowDiagram extends ModelElement {
-
- /** Property ID to use when a child is added to this diagram. */
- public static final String CHILD_ADDED_PROP = "WorkflowDiagram.ChildAdded";
- /** Property ID to use when a child is removed from this diagram. */
- public static final String CHILD_REMOVED_PROP = "WorkflowDiagram.ChildRemoved";
- private final List<Shape> shapes = new ArrayList<Shape>();
- private final List<Shape> deletedShapes = new ArrayList<Shape>();
- private final WorkFlowDefinition workFlowDefinition;
-
- public WorkflowDiagram(WorkFlowDefinition workFlowDefinition) {
- super();
- this.workFlowDefinition = workFlowDefinition;
- }
-
- @Override
- public Result doSave(SkynetTransaction transaction) throws OseeCoreException {
- Result result = validForSave();
- if (result.isFalse()) {
- return result;
- }
- try {
-
- List<WorkPageShape> workPageShapes = new ArrayList<WorkPageShape>();
- for (Shape shape : getChildren()) {
- if (shape instanceof WorkPageShape) {
- workPageShapes.add((WorkPageShape) shape);
- }
- }
-
- // Remove all states that do not exist anymore
- for (Shape shape : deletedShapes) {
- if (WorkPageShape.class.isAssignableFrom(shape.getClass())) {
- WorkPageShape workPageShape = (WorkPageShape) shape;
- if (workPageShape.getArtifact() != null) {
- workPageShape.getArtifact().deleteAndPersist(transaction);
- workFlowDefinition.removeWorkItem(((WorkPageShape) shape).getId());
- }
- }
- }
-
- // Save new states and modifications to states
- for (WorkPageShape workPageShape : workPageShapes) {
- result = workPageShape.doSave(transaction);
- if (result.isFalse()) {
- return result;
- }
- }
-
- // Set start page
- for (WorkPageShape workPageShape : workPageShapes) {
- if (workPageShape.isStartPage()) {
- workFlowDefinition.setStartPageId(workPageShape.getWorkPageDefinition().getPageName());
- break;
- }
- }
-
- // Validate transitions
- workFlowDefinition.clearTransitions();
- for (Connection connection : getConnections()) {
- if (TransitionConnection.class.isAssignableFrom(connection.getClass())) {
- TransitionConnection transConn = (TransitionConnection) connection;
- if (transConn instanceof DefaultTransitionConnection) {
- workFlowDefinition.addPageTransition(
- ((WorkPageShape) transConn.getSource()).getWorkPageDefinition().getPageName(),
- ((WorkPageShape) transConn.getTarget()).getWorkPageDefinition().getPageName(),
- TransitionType.ToPageAsDefault);
- } else if (transConn instanceof ReturnTransitionConnection) {
- workFlowDefinition.addPageTransition(
- ((WorkPageShape) transConn.getSource()).getWorkPageDefinition().getPageName(),
- ((WorkPageShape) transConn.getTarget()).getWorkPageDefinition().getPageName(),
- TransitionType.ToPageAsReturn);
- } else {
- workFlowDefinition.addPageTransition(
- ((WorkPageShape) transConn.getSource()).getWorkPageDefinition().getPageName(),
- ((WorkPageShape) transConn.getTarget()).getWorkPageDefinition().getPageName(),
- TransitionType.ToPage);
- }
- }
- }
- workFlowDefinition.loadPageData(true);
-
- Artifact artifact = workFlowDefinition.toArtifact(WriteType.Update);
- AtsWorkDefinitions.addUpdateWorkItemToDefaultHeirarchy(artifact, transaction);
- artifact.persist(transaction);
-
- WorkItemDefinitionFactory.deCache(workFlowDefinition);
-
- // Validate saved workflows and all corresponding workItemDefinitions
- // prior to completion of save
- result = AtsWorkDefinitions.validateWorkItemDefinition(workFlowDefinition);
- if (result.isFalse()) {
- return result;
- }
- for (Shape shape : getChildren()) {
- if (WorkPageShape.class.isAssignableFrom(shape.getClass())) {
- WorkPageDefinition workPageDefinition = ((WorkPageShape) shape).getWorkPageDefinition();
- result = AtsWorkDefinitions.validateWorkItemDefinition(workPageDefinition);
- if (result.isFalse()) {
- return result;
- }
- }
- }
-
- } catch (OseeCoreException ex) {
- OseeLog.log(AtsPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- }
- return Result.TrueResult;
- }
-
- @Override
- public Result validForSave() throws OseeCoreException {
-
- // Validate # Completed states
- int num = 0;
- for (Shape shape : getChildren()) {
- num += shape instanceof CompletedWorkPageShape ? 1 : 0;
- }
- if (num > 1 || num == 0) {
- return new Result("Must have only 1 Completed state; Currently " + num);
- }
-
- // Validate # Cancelled states
- num = 0;
- for (Shape shape : getChildren()) {
- num += shape instanceof CancelledWorkPageShape ? 1 : 0;
- }
- if (num > 1 || num == 0) {
- return new Result("Must have only 1 Cancelled state; Currently " + num);
- }
-
- // Validate # other states
- num = 0;
- for (Shape shape : getChildren()) {
- num += !(shape instanceof CompletedWorkPageShape) && !(shape instanceof CancelledWorkPageShape) ? 1 : 0;
- }
- if (num == 0) {
- return new Result("Must have > 0 states; Currently " + num);
- }
-
- // Validate # other states
- num = 0;
- for (Shape shape : getChildren()) {
- if (WorkPageShape.class.isAssignableFrom(shape.getClass())) {
- if (((WorkPageShape) shape).isStartPage()) {
- if (((WorkPageShape) shape).isCancelledState()) {
- return new Result("Cancelled state can not be start page");
- }
- if (((WorkPageShape) shape).isCompletedState()) {
- return new Result("Completed state can not be start page");
- }
- num++;
- }
- }
- }
- if (num > 1 || num == 0) {
- return new Result("Must have 1 start page; Currently " + num);
- }
-
- // Validate state names
- List<String> stateNames = new ArrayList<String>();
- for (Shape shape : getChildren()) {
- if (WorkPageShape.class.isAssignableFrom(shape.getClass())) {
- String name = (String) ((WorkPageShape) shape).getPropertyValue(CoreAttributeTypes.WorkPageName);
- if (stateNames.contains(name)) {
- return new Result(
- "Workflow can not have more than one state of same name. Multiples found of name " + name);
- }
- stateNames.add(name);
- }
- }
-
- // Validate transitions (each state must have a transition to or from
- for (Shape shape : getChildren()) {
- if (WorkPageShape.class.isAssignableFrom(shape.getClass())) {
- if (shape.getSourceConnections().isEmpty() && shape.getTargetConnections().isEmpty()) {
- return new Result("States must have at least one transition to or from. None found for " + shape);
- }
- }
- }
-
- // Validate children shapes
- for (Shape shape : getChildren()) {
- Result result = shape.validForSave();
- if (result.isFalse()) {
- return result;
- }
- }
- return Result.TrueResult;
- }
-
- @Override
- public String toString() {
- return "Work Flow Definition: " + workFlowDefinition.getName();
- }
-
- /**
- * Add a shape to this diagram.
- *
- * @param s a non-null shape instance
- * @return true, if the shape was added, false otherwise
- */
- public boolean addChild(Shape s) {
- if (s != null && shapes.add(s)) {
- deletedShapes.remove(s);
- s.setWorkflowDiagram(this);
- firePropertyChange(CHILD_ADDED_PROP, null, s);
- return true;
- }
- return false;
- }
-
- public boolean hasChild(Shape s) {
- for (Object obj : shapes) {
- Shape shape = (Shape) obj;
- if (shape.equals(s)) {
- return true;
- }
- }
- return false;
- }
-
- /** Return a List of Shapes in this diagram. The returned List should not be modified. */
- public List<Shape> getChildren() {
- return shapes;
- }
-
- public Set<Connection> getConnections() {
- Set<Connection> connections = new HashSet<Connection>();
- for (Shape shape : getChildren()) {
- connections.addAll(shape.getSourceConnections());
- connections.addAll(shape.getTargetConnections());
- }
- return connections;
- }
-
- /**
- * Remove a shape from this diagram.
- *
- * @param s a non-null shape instance;
- * @return true, if the shape was removed, false otherwise
- */
- public boolean removeChild(Shape s) {
- if (s != null && shapes.remove(s)) {
- deletedShapes.add(s);
- firePropertyChange(CHILD_REMOVED_PROP, null, s);
- return true;
- }
- return false;
- }
-
- /**
- * @return the workFlowDefinition
- */
- public WorkFlowDefinition getWorkFlowDefinition() {
- return workFlowDefinition;
- }
-
+package org.eclipse.osee.ats.workflow.editor.model;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import org.eclipse.osee.ats.internal.AtsPlugin;
+import org.eclipse.osee.ats.workflow.item.AtsWorkDefinitions;
+import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLevel;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkFlowDefinition;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkFlowDefinition.TransitionType;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkItemDefinition.WriteType;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkItemDefinitionFactory;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPageDefinition;
+
+/**
+ * A container for multiple shapes. This is the "root" of the model data structure.
+ *
+ * @author Donald G Dunne
+ */
+public class WorkflowDiagram extends ModelElement {
+
+ /** Property ID to use when a child is added to this diagram. */
+ public static final String CHILD_ADDED_PROP = "WorkflowDiagram.ChildAdded";
+ /** Property ID to use when a child is removed from this diagram. */
+ public static final String CHILD_REMOVED_PROP = "WorkflowDiagram.ChildRemoved";
+ private final List<Shape> shapes = new ArrayList<Shape>();
+ private final List<Shape> deletedShapes = new ArrayList<Shape>();
+ private final WorkFlowDefinition workFlowDefinition;
+
+ public WorkflowDiagram(WorkFlowDefinition workFlowDefinition) {
+ super();
+ this.workFlowDefinition = workFlowDefinition;
+ }
+
+ @Override
+ public Result doSave(SkynetTransaction transaction) throws OseeCoreException {
+ Result result = validForSave();
+ if (result.isFalse()) {
+ return result;
+ }
+ try {
+
+ List<WorkPageShape> workPageShapes = new ArrayList<WorkPageShape>();
+ for (Shape shape : getChildren()) {
+ if (shape instanceof WorkPageShape) {
+ workPageShapes.add((WorkPageShape) shape);
+ }
+ }
+
+ // Remove all states that do not exist anymore
+ for (Shape shape : deletedShapes) {
+ if (WorkPageShape.class.isAssignableFrom(shape.getClass())) {
+ WorkPageShape workPageShape = (WorkPageShape) shape;
+ if (workPageShape.getArtifact() != null) {
+ workPageShape.getArtifact().deleteAndPersist(transaction);
+ workFlowDefinition.removeWorkItem(((WorkPageShape) shape).getId());
+ }
+ }
+ }
+
+ // Save new states and modifications to states
+ for (WorkPageShape workPageShape : workPageShapes) {
+ result = workPageShape.doSave(transaction);
+ if (result.isFalse()) {
+ return result;
+ }
+ }
+
+ // Set start page
+ for (WorkPageShape workPageShape : workPageShapes) {
+ if (workPageShape.isStartPage()) {
+ workFlowDefinition.setStartPageId(workPageShape.getWorkPageDefinition().getPageName());
+ break;
+ }
+ }
+
+ // Validate transitions
+ workFlowDefinition.clearTransitions();
+ for (Connection connection : getConnections()) {
+ if (TransitionConnection.class.isAssignableFrom(connection.getClass())) {
+ TransitionConnection transConn = (TransitionConnection) connection;
+ if (transConn instanceof DefaultTransitionConnection) {
+ workFlowDefinition.addPageTransition(
+ ((WorkPageShape) transConn.getSource()).getWorkPageDefinition().getPageName(),
+ ((WorkPageShape) transConn.getTarget()).getWorkPageDefinition().getPageName(),
+ TransitionType.ToPageAsDefault);
+ } else if (transConn instanceof ReturnTransitionConnection) {
+ workFlowDefinition.addPageTransition(
+ ((WorkPageShape) transConn.getSource()).getWorkPageDefinition().getPageName(),
+ ((WorkPageShape) transConn.getTarget()).getWorkPageDefinition().getPageName(),
+ TransitionType.ToPageAsReturn);
+ } else {
+ workFlowDefinition.addPageTransition(
+ ((WorkPageShape) transConn.getSource()).getWorkPageDefinition().getPageName(),
+ ((WorkPageShape) transConn.getTarget()).getWorkPageDefinition().getPageName(),
+ TransitionType.ToPage);
+ }
+ }
+ }
+ workFlowDefinition.loadPageData(true);
+
+ Artifact artifact = workFlowDefinition.toArtifact(WriteType.Update);
+ AtsWorkDefinitions.addUpdateWorkItemToDefaultHeirarchy(artifact, transaction);
+ artifact.persist(transaction);
+
+ WorkItemDefinitionFactory.deCache(workFlowDefinition);
+
+ // Validate saved workflows and all corresponding workItemDefinitions
+ // prior to completion of save
+ result = AtsWorkDefinitions.validateWorkItemDefinition(workFlowDefinition);
+ if (result.isFalse()) {
+ return result;
+ }
+ for (Shape shape : getChildren()) {
+ if (WorkPageShape.class.isAssignableFrom(shape.getClass())) {
+ WorkPageDefinition workPageDefinition = ((WorkPageShape) shape).getWorkPageDefinition();
+ result = AtsWorkDefinitions.validateWorkItemDefinition(workPageDefinition);
+ if (result.isFalse()) {
+ return result;
+ }
+ }
+ }
+
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ return Result.TrueResult;
+ }
+
+ @Override
+ public Result validForSave() throws OseeCoreException {
+
+ // Validate # Completed states
+ int num = 0;
+ for (Shape shape : getChildren()) {
+ num += shape instanceof CompletedWorkPageShape ? 1 : 0;
+ }
+ if (num > 1 || num == 0) {
+ return new Result("Must have only 1 Completed state; Currently " + num);
+ }
+
+ // Validate # Cancelled states
+ num = 0;
+ for (Shape shape : getChildren()) {
+ num += shape instanceof CancelledWorkPageShape ? 1 : 0;
+ }
+ if (num > 1 || num == 0) {
+ return new Result("Must have only 1 Cancelled state; Currently " + num);
+ }
+
+ // Validate # other states
+ num = 0;
+ for (Shape shape : getChildren()) {
+ num += !(shape instanceof CompletedWorkPageShape) && !(shape instanceof CancelledWorkPageShape) ? 1 : 0;
+ }
+ if (num == 0) {
+ return new Result("Must have > 0 states; Currently " + num);
+ }
+
+ // Validate # other states
+ num = 0;
+ for (Shape shape : getChildren()) {
+ if (WorkPageShape.class.isAssignableFrom(shape.getClass())) {
+ if (((WorkPageShape) shape).isStartPage()) {
+ if (((WorkPageShape) shape).isCancelledState()) {
+ return new Result("Cancelled state can not be start page");
+ }
+ if (((WorkPageShape) shape).isCompletedState()) {
+ return new Result("Completed state can not be start page");
+ }
+ num++;
+ }
+ }
+ }
+ if (num > 1 || num == 0) {
+ return new Result("Must have 1 start page; Currently " + num);
+ }
+
+ // Validate state names
+ List<String> stateNames = new ArrayList<String>();
+ for (Shape shape : getChildren()) {
+ if (WorkPageShape.class.isAssignableFrom(shape.getClass())) {
+ String name = (String) ((WorkPageShape) shape).getPropertyValue(CoreAttributeTypes.WorkPageName);
+ if (stateNames.contains(name)) {
+ return new Result(
+ "Workflow can not have more than one state of same name. Multiples found of name " + name);
+ }
+ stateNames.add(name);
+ }
+ }
+
+ // Validate transitions (each state must have a transition to or from
+ for (Shape shape : getChildren()) {
+ if (WorkPageShape.class.isAssignableFrom(shape.getClass())) {
+ if (shape.getSourceConnections().isEmpty() && shape.getTargetConnections().isEmpty()) {
+ return new Result("States must have at least one transition to or from. None found for " + shape);
+ }
+ }
+ }
+
+ // Validate children shapes
+ for (Shape shape : getChildren()) {
+ Result result = shape.validForSave();
+ if (result.isFalse()) {
+ return result;
+ }
+ }
+ return Result.TrueResult;
+ }
+
+ @Override
+ public String toString() {
+ return "Work Flow Definition: " + workFlowDefinition.getName();
+ }
+
+ /**
+ * Add a shape to this diagram.
+ *
+ * @param s a non-null shape instance
+ * @return true, if the shape was added, false otherwise
+ */
+ public boolean addChild(Shape s) {
+ if (s != null && shapes.add(s)) {
+ deletedShapes.remove(s);
+ s.setWorkflowDiagram(this);
+ firePropertyChange(CHILD_ADDED_PROP, null, s);
+ return true;
+ }
+ return false;
+ }
+
+ public boolean hasChild(Shape s) {
+ for (Object obj : shapes) {
+ Shape shape = (Shape) obj;
+ if (shape.equals(s)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /** Return a List of Shapes in this diagram. The returned List should not be modified. */
+ public List<Shape> getChildren() {
+ return shapes;
+ }
+
+ public Set<Connection> getConnections() {
+ Set<Connection> connections = new HashSet<Connection>();
+ for (Shape shape : getChildren()) {
+ connections.addAll(shape.getSourceConnections());
+ connections.addAll(shape.getTargetConnections());
+ }
+ return connections;
+ }
+
+ /**
+ * Remove a shape from this diagram.
+ *
+ * @param s a non-null shape instance;
+ * @return true, if the shape was removed, false otherwise
+ */
+ public boolean removeChild(Shape s) {
+ if (s != null && shapes.remove(s)) {
+ deletedShapes.add(s);
+ firePropertyChange(CHILD_REMOVED_PROP, null, s);
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * @return the workFlowDefinition
+ */
+ public WorkFlowDefinition getWorkFlowDefinition() {
+ return workFlowDefinition;
+ }
+
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/commands/ConnectionCreateCommand.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/commands/ConnectionCreateCommand.java
index 2b12f2c7e00..f6eef1b53cd 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/commands/ConnectionCreateCommand.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/commands/ConnectionCreateCommand.java
@@ -8,113 +8,113 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.ats.workflow.editor.model.commands;
-
-import java.util.Iterator;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.osee.ats.workflow.editor.model.Connection;
-import org.eclipse.osee.ats.workflow.editor.model.DefaultTransitionConnection;
-import org.eclipse.osee.ats.workflow.editor.model.ReturnTransitionConnection;
-import org.eclipse.osee.ats.workflow.editor.model.Shape;
-import org.eclipse.osee.ats.workflow.editor.model.TransitionConnection;
-
-/**
- * A command to create a connection between two shapes. The command can be undone or redone.
- * <p>
- * This command is designed to be used together with a GraphicalNodeEditPolicy. To use this command properly, following
- * steps are necessary:
- * </p>
- * <ol>
- * <li>Create a subclass of GraphicalNodeEditPolicy.</li>
- * <li>Override the <tt>getConnectionCreateCommand(...)</tt> method, to create a new instance of this class and put it
- * into the CreateConnectionRequest.</li>
- * <li>Override the <tt>getConnectionCompleteCommand(...)</tt> method, to obtain the Command from the ConnectionRequest,
- * call setTarget(...) to set the target endpoint of the connection and return this command instance.</li>
- * </ol>
- *
- * @see org.eclipse.osee.ats.workflow.editor.parts.ShapeEditPart#createEditPolicies() for an example of the above
- * procedure.
- * @see org.eclipse.gef.editpolicies.GraphicalNodeEditPolicy
- * @author Donald G. Dunne
- */
-public class ConnectionCreateCommand extends Command {
- /** The connection instance. */
- private Connection connection;
-
- /** Start endpoint for the connection. */
- private final Shape source;
- /** Target endpoint for the connection. */
- private Shape target;
- private final Class<?> clazz;
-
- /**
- * Instantiate a command that can create a connection between two shapes.
- *
- * @param source the source endpoint (a non-null Shape instance)
- * @param lineStyle the desired line style. See Connection#setLineStyle(int) for details
- * @throws IllegalArgumentException if source is null
- * @see Connection#setLineStyle(int)
- */
- @SuppressWarnings("rawtypes")
- public ConnectionCreateCommand(Shape source, Class clazz) {
- this.clazz = clazz;
- if (source == null) {
- throw new IllegalArgumentException();
- }
- setLabel("connection creation");
- this.source = source;
- }
-
- @Override
- public boolean canExecute() {
- // disallow source -> source connections
- if (source.equals(target)) {
- return false;
- }
- // return false, if the source -> target connection exists already
- for (Iterator<?> iter = source.getSourceConnections().iterator(); iter.hasNext();) {
- Connection conn = (Connection) iter.next();
- if (conn.getTarget().equals(target)) {
- return false;
- }
- }
- return true;
- }
-
- @Override
- public void execute() {
- // create a new connection between source and target
- if (clazz == DefaultTransitionConnection.class) {
- connection = new DefaultTransitionConnection(source, target);
- } else if (clazz == ReturnTransitionConnection.class) {
- connection = new ReturnTransitionConnection(source, target);
- } else if (clazz == TransitionConnection.class) {
- connection = new TransitionConnection(source, target);
- } else {
- throw new IllegalStateException("Unhandled connection type");
- }
- }
-
- @Override
- public void redo() {
- connection.reconnect();
- }
-
- /**
- * Set the target endpoint for the connection.
- *
- * @param target that target endpoint (a non-null Shape instance)
- * @throws IllegalArgumentException if target is null
- */
- public void setTarget(Shape target) {
- if (target == null) {
- throw new IllegalArgumentException();
- }
- this.target = target;
- }
-
- @Override
- public void undo() {
- connection.disconnect();
- }
-}
+package org.eclipse.osee.ats.workflow.editor.model.commands;
+
+import java.util.Iterator;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.osee.ats.workflow.editor.model.Connection;
+import org.eclipse.osee.ats.workflow.editor.model.DefaultTransitionConnection;
+import org.eclipse.osee.ats.workflow.editor.model.ReturnTransitionConnection;
+import org.eclipse.osee.ats.workflow.editor.model.Shape;
+import org.eclipse.osee.ats.workflow.editor.model.TransitionConnection;
+
+/**
+ * A command to create a connection between two shapes. The command can be undone or redone.
+ * <p>
+ * This command is designed to be used together with a GraphicalNodeEditPolicy. To use this command properly, following
+ * steps are necessary:
+ * </p>
+ * <ol>
+ * <li>Create a subclass of GraphicalNodeEditPolicy.</li>
+ * <li>Override the <tt>getConnectionCreateCommand(...)</tt> method, to create a new instance of this class and put it
+ * into the CreateConnectionRequest.</li>
+ * <li>Override the <tt>getConnectionCompleteCommand(...)</tt> method, to obtain the Command from the ConnectionRequest,
+ * call setTarget(...) to set the target endpoint of the connection and return this command instance.</li>
+ * </ol>
+ *
+ * @see org.eclipse.osee.ats.workflow.editor.parts.ShapeEditPart#createEditPolicies() for an example of the above
+ * procedure.
+ * @see org.eclipse.gef.editpolicies.GraphicalNodeEditPolicy
+ * @author Donald G. Dunne
+ */
+public class ConnectionCreateCommand extends Command {
+ /** The connection instance. */
+ private Connection connection;
+
+ /** Start endpoint for the connection. */
+ private final Shape source;
+ /** Target endpoint for the connection. */
+ private Shape target;
+ private final Class<?> clazz;
+
+ /**
+ * Instantiate a command that can create a connection between two shapes.
+ *
+ * @param source the source endpoint (a non-null Shape instance)
+ * @param lineStyle the desired line style. See Connection#setLineStyle(int) for details
+ * @throws IllegalArgumentException if source is null
+ * @see Connection#setLineStyle(int)
+ */
+ @SuppressWarnings("rawtypes")
+ public ConnectionCreateCommand(Shape source, Class clazz) {
+ this.clazz = clazz;
+ if (source == null) {
+ throw new IllegalArgumentException();
+ }
+ setLabel("connection creation");
+ this.source = source;
+ }
+
+ @Override
+ public boolean canExecute() {
+ // disallow source -> source connections
+ if (source.equals(target)) {
+ return false;
+ }
+ // return false, if the source -> target connection exists already
+ for (Iterator<?> iter = source.getSourceConnections().iterator(); iter.hasNext();) {
+ Connection conn = (Connection) iter.next();
+ if (conn.getTarget().equals(target)) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ @Override
+ public void execute() {
+ // create a new connection between source and target
+ if (clazz == DefaultTransitionConnection.class) {
+ connection = new DefaultTransitionConnection(source, target);
+ } else if (clazz == ReturnTransitionConnection.class) {
+ connection = new ReturnTransitionConnection(source, target);
+ } else if (clazz == TransitionConnection.class) {
+ connection = new TransitionConnection(source, target);
+ } else {
+ throw new IllegalStateException("Unhandled connection type");
+ }
+ }
+
+ @Override
+ public void redo() {
+ connection.reconnect();
+ }
+
+ /**
+ * Set the target endpoint for the connection.
+ *
+ * @param target that target endpoint (a non-null Shape instance)
+ * @throws IllegalArgumentException if target is null
+ */
+ public void setTarget(Shape target) {
+ if (target == null) {
+ throw new IllegalArgumentException();
+ }
+ this.target = target;
+ }
+
+ @Override
+ public void undo() {
+ connection.disconnect();
+ }
+}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/commands/ConnectionDeleteCommand.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/commands/ConnectionDeleteCommand.java
index 2f8760145ff..1918e4609b4 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/commands/ConnectionDeleteCommand.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/commands/ConnectionDeleteCommand.java
@@ -8,42 +8,42 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.ats.workflow.editor.model.commands;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.osee.ats.workflow.editor.model.Connection;
-
-/**
- * A command to disconnect (remove) a connection from its endpoints. The command can be undone or redone.
- *
- * @author Donald G. Dunne
- */
-public class ConnectionDeleteCommand extends Command {
-
- /** Connection instance to disconnect. */
- private final Connection connection;
-
- /**
- * Create a command that will disconnect a connection from its endpoints.
- *
- * @param conn the connection instance to disconnect (non-null)
- * @throws IllegalArgumentException if conn is null
- */
- public ConnectionDeleteCommand(Connection conn) {
- if (conn == null) {
- throw new IllegalArgumentException();
- }
- setLabel("connection deletion");
- this.connection = conn;
- }
-
- @Override
- public void execute() {
- connection.disconnect();
- }
-
- @Override
- public void undo() {
- connection.reconnect();
- }
-}
+package org.eclipse.osee.ats.workflow.editor.model.commands;
+
+import org.eclipse.gef.commands.Command;
+import org.eclipse.osee.ats.workflow.editor.model.Connection;
+
+/**
+ * A command to disconnect (remove) a connection from its endpoints. The command can be undone or redone.
+ *
+ * @author Donald G. Dunne
+ */
+public class ConnectionDeleteCommand extends Command {
+
+ /** Connection instance to disconnect. */
+ private final Connection connection;
+
+ /**
+ * Create a command that will disconnect a connection from its endpoints.
+ *
+ * @param conn the connection instance to disconnect (non-null)
+ * @throws IllegalArgumentException if conn is null
+ */
+ public ConnectionDeleteCommand(Connection conn) {
+ if (conn == null) {
+ throw new IllegalArgumentException();
+ }
+ setLabel("connection deletion");
+ this.connection = conn;
+ }
+
+ @Override
+ public void execute() {
+ connection.disconnect();
+ }
+
+ @Override
+ public void undo() {
+ connection.reconnect();
+ }
+}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/commands/ConnectionReconnectCommand.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/commands/ConnectionReconnectCommand.java
index 99c297f7da0..a93310d5e90 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/commands/ConnectionReconnectCommand.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/commands/ConnectionReconnectCommand.java
@@ -8,175 +8,175 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.ats.workflow.editor.model.commands;
-
-import java.util.Iterator;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.osee.ats.workflow.editor.model.Connection;
-import org.eclipse.osee.ats.workflow.editor.model.Shape;
-
-/**
- * A command to reconnect a connection to a different start point or end point. The command can be undone or redone.
- * <p>
- * This command is designed to be used together with a GraphicalNodeEditPolicy. To use this command propertly, following
- * steps are necessary:
- * </p>
- * <ol>
- * <li>Create a subclass of GraphicalNodeEditPolicy.</li>
- * <li>Override the <tt>getReconnectSourceCommand(...)</tt> method. Here you need to obtain the Connection model element
- * from the ReconnectRequest, create a new ConnectionReconnectCommand, set the new connection <i>source</i> by calling
- * the <tt>setNewSource(Shape)</tt> method and return the command instance.
- * <li>Override the <tt>getReconnectTargetCommand(...)</tt> method.</li> Here again you need to obtain the Connection
- * model element from the ReconnectRequest, create a new ConnectionReconnectCommand, set the new connection
- * <i>target</i> by calling the <tt>setNewTarget(Shape)</tt> method and return the command instance.</li>
- * </ol>
- *
- * @see org.eclipse.osee.ats.workflow.editor.parts.ShapeEditPart#createEditPolicies() for an example of the above
- * procedure.
- * @see org.eclipse.gef.editpolicies.GraphicalNodeEditPolicy
- * @see #setNewSource(Shape)
- * @see #setNewTarget(Shape)
- * @author Donald G. Dunne
- */
-public class ConnectionReconnectCommand extends Command {
-
- /** The connection instance to reconnect. */
- private final Connection connection;
- /** The new source endpoint. */
- private Shape newSource;
- /** The new target endpoint. */
- private Shape newTarget;
- /** The original source endpoint. */
- private final Shape oldSource;
- /** The original target endpoint. */
- private final Shape oldTarget;
-
- /**
- * Instantiate a command that can reconnect a Connection instance to a different source or target endpoint.
- *
- * @param conn the connection instance to reconnect (non-null)
- * @throws IllegalArgumentException if conn is null
- */
- public ConnectionReconnectCommand(Connection conn) {
- if (conn == null) {
- throw new IllegalArgumentException();
- }
- this.connection = conn;
- this.oldSource = conn.getSource();
- this.oldTarget = conn.getTarget();
- }
-
- @Override
- public boolean canExecute() {
- if (newSource != null) {
- return checkSourceReconnection();
- } else if (newTarget != null) {
- return checkTargetReconnection();
- }
- return false;
- }
-
- /**
- * Return true, if reconnecting the connection-instance to newSource is allowed.
- */
- private boolean checkSourceReconnection() {
- // connection endpoints must be different Shapes
- if (newSource.equals(oldTarget)) {
- return false;
- }
- // return false, if the connection exists already
- for (Iterator<?> iter = newSource.getSourceConnections().iterator(); iter.hasNext();) {
- Connection conn = (Connection) iter.next();
- // return false if a newSource -> oldTarget connection exists already
- // and it is a different instance than the connection-field
- if (conn.getTarget().equals(oldTarget) && !conn.equals(connection)) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Return true, if reconnecting the connection-instance to newTarget is allowed.
- */
- private boolean checkTargetReconnection() {
- // connection endpoints must be different Shapes
- if (newTarget.equals(oldSource)) {
- return false;
- }
- // return false, if the connection exists already
- for (Iterator<?> iter = newTarget.getTargetConnections().iterator(); iter.hasNext();) {
- Connection conn = (Connection) iter.next();
- // return false if a oldSource -> newTarget connection exists already
- // and it is a differenct instance that the connection-field
- if (conn.getSource().equals(oldSource) && !conn.equals(connection)) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Reconnect the connection to newSource (if setNewSource(...) was invoked before) or newTarget (if setNewTarget(...)
- * was invoked before).
- */
- @Override
- public void execute() {
- if (newSource != null) {
- connection.reconnect(newSource, oldTarget);
- } else if (newTarget != null) {
- connection.reconnect(oldSource, newTarget);
- } else {
- throw new IllegalStateException("Should not happen");
- }
- }
-
- /**
- * Set a new source endpoint for this connection. When execute() is invoked, the source endpoint of the connection
- * will be attached to the supplied Shape instance.
- * <p>
- * Note: Calling this method, deactivates reconnection of the <i>target</i> endpoint. A single instance of this
- * command can only reconnect either the source or the target endpoint.
- * </p>
- *
- * @param connectionSource a non-null Shape instance, to be used as a new source endpoint
- * @throws IllegalArgumentException if connectionSource is null
- */
- public void setNewSource(Shape connectionSource) {
- if (connectionSource == null) {
- throw new IllegalArgumentException();
- }
- setLabel("move connection startpoint");
- newSource = connectionSource;
- newTarget = null;
- }
-
- /**
- * Set a new target endpoint for this connection When execute() is invoked, the target endpoint of the connection
- * will be attached to the supplied Shape instance.
- * <p>
- * Note: Calling this method, deactivates reconnection of the <i>source</i> endpoint. A single instance of this
- * command can only reconnect either the source or the target endpoint.
- * </p>
- *
- * @param connectionTarget a non-null Shape instance, to be used as a new target endpoint
- * @throws IllegalArgumentException if connectionTarget is null
- */
- public void setNewTarget(Shape connectionTarget) {
- if (connectionTarget == null) {
- throw new IllegalArgumentException();
- }
- setLabel("move connection endpoint");
- newSource = null;
- newTarget = connectionTarget;
- }
-
- /**
- * Reconnect the connection to its original source and target endpoints.
- */
- @Override
- public void undo() {
- connection.reconnect(oldSource, oldTarget);
- }
-
-}
+package org.eclipse.osee.ats.workflow.editor.model.commands;
+
+import java.util.Iterator;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.osee.ats.workflow.editor.model.Connection;
+import org.eclipse.osee.ats.workflow.editor.model.Shape;
+
+/**
+ * A command to reconnect a connection to a different start point or end point. The command can be undone or redone.
+ * <p>
+ * This command is designed to be used together with a GraphicalNodeEditPolicy. To use this command propertly, following
+ * steps are necessary:
+ * </p>
+ * <ol>
+ * <li>Create a subclass of GraphicalNodeEditPolicy.</li>
+ * <li>Override the <tt>getReconnectSourceCommand(...)</tt> method. Here you need to obtain the Connection model element
+ * from the ReconnectRequest, create a new ConnectionReconnectCommand, set the new connection <i>source</i> by calling
+ * the <tt>setNewSource(Shape)</tt> method and return the command instance.
+ * <li>Override the <tt>getReconnectTargetCommand(...)</tt> method.</li> Here again you need to obtain the Connection
+ * model element from the ReconnectRequest, create a new ConnectionReconnectCommand, set the new connection
+ * <i>target</i> by calling the <tt>setNewTarget(Shape)</tt> method and return the command instance.</li>
+ * </ol>
+ *
+ * @see org.eclipse.osee.ats.workflow.editor.parts.ShapeEditPart#createEditPolicies() for an example of the above
+ * procedure.
+ * @see org.eclipse.gef.editpolicies.GraphicalNodeEditPolicy
+ * @see #setNewSource(Shape)
+ * @see #setNewTarget(Shape)
+ * @author Donald G. Dunne
+ */
+public class ConnectionReconnectCommand extends Command {
+
+ /** The connection instance to reconnect. */
+ private final Connection connection;
+ /** The new source endpoint. */
+ private Shape newSource;
+ /** The new target endpoint. */
+ private Shape newTarget;
+ /** The original source endpoint. */
+ private final Shape oldSource;
+ /** The original target endpoint. */
+ private final Shape oldTarget;
+
+ /**
+ * Instantiate a command that can reconnect a Connection instance to a different source or target endpoint.
+ *
+ * @param conn the connection instance to reconnect (non-null)
+ * @throws IllegalArgumentException if conn is null
+ */
+ public ConnectionReconnectCommand(Connection conn) {
+ if (conn == null) {
+ throw new IllegalArgumentException();
+ }
+ this.connection = conn;
+ this.oldSource = conn.getSource();
+ this.oldTarget = conn.getTarget();
+ }
+
+ @Override
+ public boolean canExecute() {
+ if (newSource != null) {
+ return checkSourceReconnection();
+ } else if (newTarget != null) {
+ return checkTargetReconnection();
+ }
+ return false;
+ }
+
+ /**
+ * Return true, if reconnecting the connection-instance to newSource is allowed.
+ */
+ private boolean checkSourceReconnection() {
+ // connection endpoints must be different Shapes
+ if (newSource.equals(oldTarget)) {
+ return false;
+ }
+ // return false, if the connection exists already
+ for (Iterator<?> iter = newSource.getSourceConnections().iterator(); iter.hasNext();) {
+ Connection conn = (Connection) iter.next();
+ // return false if a newSource -> oldTarget connection exists already
+ // and it is a different instance than the connection-field
+ if (conn.getTarget().equals(oldTarget) && !conn.equals(connection)) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * Return true, if reconnecting the connection-instance to newTarget is allowed.
+ */
+ private boolean checkTargetReconnection() {
+ // connection endpoints must be different Shapes
+ if (newTarget.equals(oldSource)) {
+ return false;
+ }
+ // return false, if the connection exists already
+ for (Iterator<?> iter = newTarget.getTargetConnections().iterator(); iter.hasNext();) {
+ Connection conn = (Connection) iter.next();
+ // return false if a oldSource -> newTarget connection exists already
+ // and it is a differenct instance that the connection-field
+ if (conn.getSource().equals(oldSource) && !conn.equals(connection)) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * Reconnect the connection to newSource (if setNewSource(...) was invoked before) or newTarget (if setNewTarget(...)
+ * was invoked before).
+ */
+ @Override
+ public void execute() {
+ if (newSource != null) {
+ connection.reconnect(newSource, oldTarget);
+ } else if (newTarget != null) {
+ connection.reconnect(oldSource, newTarget);
+ } else {
+ throw new IllegalStateException("Should not happen");
+ }
+ }
+
+ /**
+ * Set a new source endpoint for this connection. When execute() is invoked, the source endpoint of the connection
+ * will be attached to the supplied Shape instance.
+ * <p>
+ * Note: Calling this method, deactivates reconnection of the <i>target</i> endpoint. A single instance of this
+ * command can only reconnect either the source or the target endpoint.
+ * </p>
+ *
+ * @param connectionSource a non-null Shape instance, to be used as a new source endpoint
+ * @throws IllegalArgumentException if connectionSource is null
+ */
+ public void setNewSource(Shape connectionSource) {
+ if (connectionSource == null) {
+ throw new IllegalArgumentException();
+ }
+ setLabel("move connection startpoint");
+ newSource = connectionSource;
+ newTarget = null;
+ }
+
+ /**
+ * Set a new target endpoint for this connection When execute() is invoked, the target endpoint of the connection
+ * will be attached to the supplied Shape instance.
+ * <p>
+ * Note: Calling this method, deactivates reconnection of the <i>source</i> endpoint. A single instance of this
+ * command can only reconnect either the source or the target endpoint.
+ * </p>
+ *
+ * @param connectionTarget a non-null Shape instance, to be used as a new target endpoint
+ * @throws IllegalArgumentException if connectionTarget is null
+ */
+ public void setNewTarget(Shape connectionTarget) {
+ if (connectionTarget == null) {
+ throw new IllegalArgumentException();
+ }
+ setLabel("move connection endpoint");
+ newSource = null;
+ newTarget = connectionTarget;
+ }
+
+ /**
+ * Reconnect the connection to its original source and target endpoints.
+ */
+ @Override
+ public void undo() {
+ connection.reconnect(oldSource, oldTarget);
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/commands/ShapeCreateCommand.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/commands/ShapeCreateCommand.java
index fbec89e537b..bcd1d8f4252 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/commands/ShapeCreateCommand.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/commands/ShapeCreateCommand.java
@@ -8,79 +8,79 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.ats.workflow.editor.model.commands;
-
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.osee.ats.workflow.editor.model.Shape;
-import org.eclipse.osee.ats.workflow.editor.model.WorkflowDiagram;
-
-/**
- * A command to add a Shape to a ShapeDiagram. The command can be undone or redone.
- *
- * @author Donald G. Dunne
- */
-public class ShapeCreateCommand extends Command {
-
- /** The new shape. */
- private final Shape newShape;
- /** ShapeDiagram to add to. */
- private final WorkflowDiagram parent;
- /** The bounds of the new Shape. */
- private final Rectangle bounds;
-
- /**
- * Create a command that will add a new Shape to a WorkflowDiagram.
- *
- * @param newShape the new Shape that is to be added
- * @param parent the WorkflowDiagram that will hold the new element
- * @param bounds the bounds of the new shape; the size can be (-1, -1) if not known
- * @throws IllegalArgumentException if any parameter is null, or the request does not provide a new Shape instance
- */
- public ShapeCreateCommand(Shape newShape, WorkflowDiagram parent, Rectangle bounds) {
- this.newShape = newShape;
- this.newShape.setWorkflowDiagram(parent);
- this.parent = parent;
- this.bounds = bounds;
- setLabel("shape creation");
- }
-
- /**
- * Can execute if all the necessary information has been provided.
- *
- * @see org.eclipse.gef.commands.Command#canExecute()
- */
- @Override
- public boolean canExecute() {
- boolean create = newShape != null && parent != null && bounds != null;
- if (!create) {
- return false;
- }
- if (parent.hasChild(newShape)) {
- return false;
- }
- return true;
- }
-
- @Override
- public void execute() {
- newShape.setLocation(bounds.getLocation());
- Dimension size = bounds.getSize();
- if (size.width > 0 && size.height > 0) {
- newShape.setSize(size);
- }
- redo();
- }
-
- @Override
- public void redo() {
- parent.addChild(newShape);
- }
-
- @Override
- public void undo() {
- parent.removeChild(newShape);
- }
-
+package org.eclipse.osee.ats.workflow.editor.model.commands;
+
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.osee.ats.workflow.editor.model.Shape;
+import org.eclipse.osee.ats.workflow.editor.model.WorkflowDiagram;
+
+/**
+ * A command to add a Shape to a ShapeDiagram. The command can be undone or redone.
+ *
+ * @author Donald G. Dunne
+ */
+public class ShapeCreateCommand extends Command {
+
+ /** The new shape. */
+ private final Shape newShape;
+ /** ShapeDiagram to add to. */
+ private final WorkflowDiagram parent;
+ /** The bounds of the new Shape. */
+ private final Rectangle bounds;
+
+ /**
+ * Create a command that will add a new Shape to a WorkflowDiagram.
+ *
+ * @param newShape the new Shape that is to be added
+ * @param parent the WorkflowDiagram that will hold the new element
+ * @param bounds the bounds of the new shape; the size can be (-1, -1) if not known
+ * @throws IllegalArgumentException if any parameter is null, or the request does not provide a new Shape instance
+ */
+ public ShapeCreateCommand(Shape newShape, WorkflowDiagram parent, Rectangle bounds) {
+ this.newShape = newShape;
+ this.newShape.setWorkflowDiagram(parent);
+ this.parent = parent;
+ this.bounds = bounds;
+ setLabel("shape creation");
+ }
+
+ /**
+ * Can execute if all the necessary information has been provided.
+ *
+ * @see org.eclipse.gef.commands.Command#canExecute()
+ */
+ @Override
+ public boolean canExecute() {
+ boolean create = newShape != null && parent != null && bounds != null;
+ if (!create) {
+ return false;
+ }
+ if (parent.hasChild(newShape)) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public void execute() {
+ newShape.setLocation(bounds.getLocation());
+ Dimension size = bounds.getSize();
+ if (size.width > 0 && size.height > 0) {
+ newShape.setSize(size);
+ }
+ redo();
+ }
+
+ @Override
+ public void redo() {
+ parent.addChild(newShape);
+ }
+
+ @Override
+ public void undo() {
+ parent.removeChild(newShape);
+ }
+
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/commands/ShapeDeleteCommand.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/commands/ShapeDeleteCommand.java
index 8772c3535b6..92ac384ab46 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/commands/ShapeDeleteCommand.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/commands/ShapeDeleteCommand.java
@@ -8,102 +8,102 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.ats.workflow.editor.model.commands;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.osee.ats.workflow.editor.model.Connection;
-import org.eclipse.osee.ats.workflow.editor.model.Shape;
-import org.eclipse.osee.ats.workflow.editor.model.WorkflowDiagram;
-
-/**
- * A command to remove a shape from its parent. The command can be undone or redone.
- *
- * @author Donald G. Dunne
- */
-public class ShapeDeleteCommand extends Command {
- /** Shape to remove. */
- private final Shape child;
-
- /** ShapeDiagram to remove from. */
- private final WorkflowDiagram parent;
- /** Holds a copy of the outgoing connections of child. */
- private List<Connection> sourceConnections;
- /** Holds a copy of the incoming connections of child. */
- private List<Connection> targetConnections;
- /** True, if child was removed from its parent. */
- private boolean wasRemoved;
-
- /**
- * Create a command that will remove the shape from its parent.
- *
- * @param parent the WorkflowDiagram containing the child
- * @param child the Shape to remove
- * @throws IllegalArgumentException if any parameter is null
- */
- public ShapeDeleteCommand(WorkflowDiagram parent, Shape child) {
- if (parent == null || child == null) {
- throw new IllegalArgumentException();
- }
- setLabel("shape deletion");
- this.parent = parent;
- this.child = child;
- }
-
- /**
- * Reconnects a List of Connections with their previous endpoints.
- *
- * @param connections a non-null List of connections
- */
- private void addConnections(List<Connection> connections) {
- for (Iterator<Connection> iter = connections.iterator(); iter.hasNext();) {
- Connection conn = iter.next();
- conn.reconnect();
- }
- }
-
- @Override
- public boolean canUndo() {
- return wasRemoved;
- }
-
- @Override
- public void execute() {
- // store a copy of incoming & outgoing connections before proceeding
- sourceConnections = child.getSourceConnections();
- targetConnections = child.getTargetConnections();
- redo();
- }
-
- @Override
- public void redo() {
- // remove the child and disconnect its connections
- wasRemoved = parent.removeChild(child);
- if (wasRemoved) {
- removeConnections(sourceConnections);
- removeConnections(targetConnections);
- }
- }
-
- /**
- * Disconnects a List of Connections from their endpoints.
- *
- * @param connections a non-null List of connections
- */
- private void removeConnections(List<Connection> connections) {
- for (Iterator<Connection> iter = connections.iterator(); iter.hasNext();) {
- Connection conn = iter.next();
- conn.disconnect();
- }
- }
-
- @Override
- public void undo() {
- // add the child and reconnect its connections
- if (parent.addChild(child)) {
- addConnections(sourceConnections);
- addConnections(targetConnections);
- }
- }
+package org.eclipse.osee.ats.workflow.editor.model.commands;
+
+import java.util.Iterator;
+import java.util.List;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.osee.ats.workflow.editor.model.Connection;
+import org.eclipse.osee.ats.workflow.editor.model.Shape;
+import org.eclipse.osee.ats.workflow.editor.model.WorkflowDiagram;
+
+/**
+ * A command to remove a shape from its parent. The command can be undone or redone.
+ *
+ * @author Donald G. Dunne
+ */
+public class ShapeDeleteCommand extends Command {
+ /** Shape to remove. */
+ private final Shape child;
+
+ /** ShapeDiagram to remove from. */
+ private final WorkflowDiagram parent;
+ /** Holds a copy of the outgoing connections of child. */
+ private List<Connection> sourceConnections;
+ /** Holds a copy of the incoming connections of child. */
+ private List<Connection> targetConnections;
+ /** True, if child was removed from its parent. */
+ private boolean wasRemoved;
+
+ /**
+ * Create a command that will remove the shape from its parent.
+ *
+ * @param parent the WorkflowDiagram containing the child
+ * @param child the Shape to remove
+ * @throws IllegalArgumentException if any parameter is null
+ */
+ public ShapeDeleteCommand(WorkflowDiagram parent, Shape child) {
+ if (parent == null || child == null) {
+ throw new IllegalArgumentException();
+ }
+ setLabel("shape deletion");
+ this.parent = parent;
+ this.child = child;
+ }
+
+ /**
+ * Reconnects a List of Connections with their previous endpoints.
+ *
+ * @param connections a non-null List of connections
+ */
+ private void addConnections(List<Connection> connections) {
+ for (Iterator<Connection> iter = connections.iterator(); iter.hasNext();) {
+ Connection conn = iter.next();
+ conn.reconnect();
+ }
+ }
+
+ @Override
+ public boolean canUndo() {
+ return wasRemoved;
+ }
+
+ @Override
+ public void execute() {
+ // store a copy of incoming & outgoing connections before proceeding
+ sourceConnections = child.getSourceConnections();
+ targetConnections = child.getTargetConnections();
+ redo();
+ }
+
+ @Override
+ public void redo() {
+ // remove the child and disconnect its connections
+ wasRemoved = parent.removeChild(child);
+ if (wasRemoved) {
+ removeConnections(sourceConnections);
+ removeConnections(targetConnections);
+ }
+ }
+
+ /**
+ * Disconnects a List of Connections from their endpoints.
+ *
+ * @param connections a non-null List of connections
+ */
+ private void removeConnections(List<Connection> connections) {
+ for (Iterator<Connection> iter = connections.iterator(); iter.hasNext();) {
+ Connection conn = iter.next();
+ conn.disconnect();
+ }
+ }
+
+ @Override
+ public void undo() {
+ // add the child and reconnect its connections
+ if (parent.addChild(child)) {
+ addConnections(sourceConnections);
+ addConnections(targetConnections);
+ }
+ }
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/commands/ShapeSetConstraintCommand.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/commands/ShapeSetConstraintCommand.java
index 6047f67a57b..a1577150936 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/commands/ShapeSetConstraintCommand.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/model/commands/ShapeSetConstraintCommand.java
@@ -8,70 +8,70 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.ats.workflow.editor.model.commands;
-
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.RequestConstants;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.osee.ats.workflow.editor.model.Shape;
-
-/**
- * A command to resize and/or move a shape. The command can be undone or redone.
- *
- * @author Donald G. Dunne
- */
-public class ShapeSetConstraintCommand extends Command {
- /** Stores the new size and location. */
- private final Rectangle newBounds;
- /** Stores the old size and location. */
- private Rectangle oldBounds;
- /** A request to move/resize an edit part. */
- private final ChangeBoundsRequest request;
-
- /** Shape to manipulate. */
- private final Shape shape;
-
- /**
- * Create a command that can resize and/or move a shape.
- *
- * @param shape the shape to manipulate
- * @param req the move and resize request
- * @param newBounds the new size and location
- * @throws IllegalArgumentException if any of the parameters is null
- */
- public ShapeSetConstraintCommand(Shape shape, ChangeBoundsRequest req, Rectangle newBounds) {
- if (shape == null || req == null || newBounds == null) {
- throw new IllegalArgumentException();
- }
- this.shape = shape;
- this.request = req;
- this.newBounds = newBounds.getCopy();
- setLabel("move / resize");
- }
-
- @Override
- public boolean canExecute() {
- Object type = request.getType();
- // make sure the Request is of a type we support:
- return RequestConstants.REQ_MOVE.equals(type) || RequestConstants.REQ_MOVE_CHILDREN.equals(type) || RequestConstants.REQ_RESIZE.equals(type) || RequestConstants.REQ_RESIZE_CHILDREN.equals(type);
- }
-
- @Override
- public void execute() {
- oldBounds = new Rectangle(shape.getLocation(), shape.getSize());
- redo();
- }
-
- @Override
- public void redo() {
- shape.setSize(newBounds.getSize());
- shape.setLocation(newBounds.getLocation());
- }
-
- @Override
- public void undo() {
- shape.setSize(oldBounds.getSize());
- shape.setLocation(oldBounds.getLocation());
- }
-}
+package org.eclipse.osee.ats.workflow.editor.model.commands;
+
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.RequestConstants;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.requests.ChangeBoundsRequest;
+import org.eclipse.osee.ats.workflow.editor.model.Shape;
+
+/**
+ * A command to resize and/or move a shape. The command can be undone or redone.
+ *
+ * @author Donald G. Dunne
+ */
+public class ShapeSetConstraintCommand extends Command {
+ /** Stores the new size and location. */
+ private final Rectangle newBounds;
+ /** Stores the old size and location. */
+ private Rectangle oldBounds;
+ /** A request to move/resize an edit part. */
+ private final ChangeBoundsRequest request;
+
+ /** Shape to manipulate. */
+ private final Shape shape;
+
+ /**
+ * Create a command that can resize and/or move a shape.
+ *
+ * @param shape the shape to manipulate
+ * @param req the move and resize request
+ * @param newBounds the new size and location
+ * @throws IllegalArgumentException if any of the parameters is null
+ */
+ public ShapeSetConstraintCommand(Shape shape, ChangeBoundsRequest req, Rectangle newBounds) {
+ if (shape == null || req == null || newBounds == null) {
+ throw new IllegalArgumentException();
+ }
+ this.shape = shape;
+ this.request = req;
+ this.newBounds = newBounds.getCopy();
+ setLabel("move / resize");
+ }
+
+ @Override
+ public boolean canExecute() {
+ Object type = request.getType();
+ // make sure the Request is of a type we support:
+ return RequestConstants.REQ_MOVE.equals(type) || RequestConstants.REQ_MOVE_CHILDREN.equals(type) || RequestConstants.REQ_RESIZE.equals(type) || RequestConstants.REQ_RESIZE_CHILDREN.equals(type);
+ }
+
+ @Override
+ public void execute() {
+ oldBounds = new Rectangle(shape.getLocation(), shape.getSize());
+ redo();
+ }
+
+ @Override
+ public void redo() {
+ shape.setSize(newBounds.getSize());
+ shape.setLocation(newBounds.getLocation());
+ }
+
+ @Override
+ public void undo() {
+ shape.setSize(oldBounds.getSize());
+ shape.setLocation(oldBounds.getLocation());
+ }
+}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/parts/ConnectionEditPart.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/parts/ConnectionEditPart.java
index 1b8b41b9d0f..957121dc08f 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/parts/ConnectionEditPart.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/parts/ConnectionEditPart.java
@@ -8,95 +8,95 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.ats.workflow.editor.parts;
-
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.PolygonDecoration;
-import org.eclipse.draw2d.PolylineConnection;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editparts.AbstractConnectionEditPart;
-import org.eclipse.gef.editpolicies.ConnectionEditPolicy;
-import org.eclipse.gef.editpolicies.ConnectionEndpointEditPolicy;
-import org.eclipse.gef.requests.GroupRequest;
-import org.eclipse.osee.ats.workflow.editor.model.Connection;
-import org.eclipse.osee.ats.workflow.editor.model.ModelElement;
-import org.eclipse.osee.ats.workflow.editor.model.TransitionConnection;
-import org.eclipse.osee.ats.workflow.editor.model.commands.ConnectionDeleteCommand;
-
-/**
- * Edit part for Connection model elements.
- * <p>
- * This edit part must implement the PropertyChangeListener interface, so it can be notified of property changes in the
- * corresponding model element.
- * </p>
- *
- * @author Donald G. Dunne
- */
-class ConnectionEditPart extends AbstractConnectionEditPart implements PropertyChangeListener {
-
- /**
- * Upon activation, attach to the model element as a property change listener.
- */
- @Override
- public void activate() {
- if (!isActive()) {
- super.activate();
- ((ModelElement) getModel()).addPropertyChangeListener(this);
- }
- }
-
- @Override
- protected void createEditPolicies() {
- // Selection handle edit policy.
- // Makes the connection show a feedback, when selected by the user.
- installEditPolicy(EditPolicy.CONNECTION_ENDPOINTS_ROLE, new ConnectionEndpointEditPolicy());
- // Allows the removal of the connection model element
- installEditPolicy(EditPolicy.CONNECTION_ROLE, new ConnectionEditPolicy() {
- @Override
- protected Command getDeleteCommand(GroupRequest request) {
- return new ConnectionDeleteCommand(getCastedModel());
- }
- });
- }
-
- @Override
- protected IFigure createFigure() {
- PolylineConnection connection = (PolylineConnection) super.createFigure();
- connection.setTargetDecoration(new PolygonDecoration()); // arrow at target endpoint
- connection.setLineStyle(getCastedModel().getLineStyle()); // line drawing style
- connection.setForegroundColor(getCastedModel().getForegroundColor());
- connection.setLineWidth(getCastedModel().getLineWidth());
- if (getCastedModel().getLabel() != null) {
- connection.setToolTip(new Label(getCastedModel().getLabel()));
- }
- return connection;
- }
-
- /**
- * Upon deactivation, detach from the model element as a property change listener.
- */
- @Override
- public void deactivate() {
- if (isActive()) {
- super.deactivate();
- ((ModelElement) getModel()).removePropertyChangeListener(this);
- }
- }
-
- private Connection getCastedModel() {
- return (Connection) getModel();
- }
-
- @Override
- public void propertyChange(PropertyChangeEvent event) {
- String property = event.getPropertyName();
- if (TransitionConnection.TYPE_PROP.equals(property)) {
- ((PolylineConnection) getFigure()).setLineStyle(getCastedModel().getLineStyle());
- }
- }
-
+package org.eclipse.osee.ats.workflow.editor.parts;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.PolygonDecoration;
+import org.eclipse.draw2d.PolylineConnection;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editparts.AbstractConnectionEditPart;
+import org.eclipse.gef.editpolicies.ConnectionEditPolicy;
+import org.eclipse.gef.editpolicies.ConnectionEndpointEditPolicy;
+import org.eclipse.gef.requests.GroupRequest;
+import org.eclipse.osee.ats.workflow.editor.model.Connection;
+import org.eclipse.osee.ats.workflow.editor.model.ModelElement;
+import org.eclipse.osee.ats.workflow.editor.model.TransitionConnection;
+import org.eclipse.osee.ats.workflow.editor.model.commands.ConnectionDeleteCommand;
+
+/**
+ * Edit part for Connection model elements.
+ * <p>
+ * This edit part must implement the PropertyChangeListener interface, so it can be notified of property changes in the
+ * corresponding model element.
+ * </p>
+ *
+ * @author Donald G. Dunne
+ */
+class ConnectionEditPart extends AbstractConnectionEditPart implements PropertyChangeListener {
+
+ /**
+ * Upon activation, attach to the model element as a property change listener.
+ */
+ @Override
+ public void activate() {
+ if (!isActive()) {
+ super.activate();
+ ((ModelElement) getModel()).addPropertyChangeListener(this);
+ }
+ }
+
+ @Override
+ protected void createEditPolicies() {
+ // Selection handle edit policy.
+ // Makes the connection show a feedback, when selected by the user.
+ installEditPolicy(EditPolicy.CONNECTION_ENDPOINTS_ROLE, new ConnectionEndpointEditPolicy());
+ // Allows the removal of the connection model element
+ installEditPolicy(EditPolicy.CONNECTION_ROLE, new ConnectionEditPolicy() {
+ @Override
+ protected Command getDeleteCommand(GroupRequest request) {
+ return new ConnectionDeleteCommand(getCastedModel());
+ }
+ });
+ }
+
+ @Override
+ protected IFigure createFigure() {
+ PolylineConnection connection = (PolylineConnection) super.createFigure();
+ connection.setTargetDecoration(new PolygonDecoration()); // arrow at target endpoint
+ connection.setLineStyle(getCastedModel().getLineStyle()); // line drawing style
+ connection.setForegroundColor(getCastedModel().getForegroundColor());
+ connection.setLineWidth(getCastedModel().getLineWidth());
+ if (getCastedModel().getLabel() != null) {
+ connection.setToolTip(new Label(getCastedModel().getLabel()));
+ }
+ return connection;
+ }
+
+ /**
+ * Upon deactivation, detach from the model element as a property change listener.
+ */
+ @Override
+ public void deactivate() {
+ if (isActive()) {
+ super.deactivate();
+ ((ModelElement) getModel()).removePropertyChangeListener(this);
+ }
+ }
+
+ private Connection getCastedModel() {
+ return (Connection) getModel();
+ }
+
+ @Override
+ public void propertyChange(PropertyChangeEvent event) {
+ String property = event.getPropertyName();
+ if (TransitionConnection.TYPE_PROP.equals(property)) {
+ ((PolylineConnection) getFigure()).setLineStyle(getCastedModel().getLineStyle());
+ }
+ }
+
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/parts/DiagramEditPart.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/parts/DiagramEditPart.java
index 2de40d486d9..7c13cc6ceb9 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/parts/DiagramEditPart.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/parts/DiagramEditPart.java
@@ -8,149 +8,149 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.ats.workflow.editor.parts;
-
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.util.List;
-import org.eclipse.draw2d.ConnectionLayer;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.FreeformLayer;
-import org.eclipse.draw2d.FreeformLayout;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.draw2d.ShortestPathConnectionRouter;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.LayerConstants;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.gef.editpolicies.RootComponentEditPolicy;
-import org.eclipse.gef.editpolicies.XYLayoutEditPolicy;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.gef.requests.CreateRequest;
-import org.eclipse.osee.ats.workflow.editor.model.EllipticalShape;
-import org.eclipse.osee.ats.workflow.editor.model.ModelElement;
-import org.eclipse.osee.ats.workflow.editor.model.Shape;
-import org.eclipse.osee.ats.workflow.editor.model.WorkPageShape;
-import org.eclipse.osee.ats.workflow.editor.model.WorkflowDiagram;
-import org.eclipse.osee.ats.workflow.editor.model.commands.ShapeCreateCommand;
-import org.eclipse.osee.ats.workflow.editor.model.commands.ShapeSetConstraintCommand;
-
-/**
- * EditPart for the a WorkflowDiagram instance.
- * <p>
- * This edit part server as the main diagram container, the white area where everything else is in. Also responsible for
- * the container's layout (the way the container rearanges is contents) and the container's capabilities (edit
- * policies).
- * </p>
- * <p>
- * This edit part must implement the PropertyChangeListener interface, so it can be notified of property changes in the
- * corresponding model element.
- * </p>
- *
- * @author Donald G. Dunne
- */
-public class DiagramEditPart extends AbstractGraphicalEditPart implements PropertyChangeListener {
-
- /**
- * Upon activation, attach to the model element as a property change listener.
- */
- @Override
- public void activate() {
- if (!isActive()) {
- super.activate();
- ((ModelElement) getModel()).addPropertyChangeListener(this);
- }
- }
-
- @Override
- protected void createEditPolicies() {
- // disallows the removal of this edit part from its parent
- installEditPolicy(EditPolicy.COMPONENT_ROLE, new RootComponentEditPolicy());
- // handles constraint changes (e.g. moving and/or resizing) of model elements
- // and creation of new model elements
- installEditPolicy(EditPolicy.LAYOUT_ROLE, new ShapesXYLayoutEditPolicy());
- }
-
- @Override
- protected IFigure createFigure() {
- Figure f = new FreeformLayer();
- f.setBorder(new MarginBorder(3));
- f.setLayoutManager(new FreeformLayout());
-
- // Create the static router for the connection layer
- ConnectionLayer connLayer = (ConnectionLayer) getLayer(LayerConstants.CONNECTION_LAYER);
- connLayer.setConnectionRouter(new ShortestPathConnectionRouter(f));
-
- return f;
- }
-
- /**
- * Upon deactivation, detach from the model element as a property change listener.
- */
- @Override
- public void deactivate() {
- if (isActive()) {
- super.deactivate();
- ((ModelElement) getModel()).removePropertyChangeListener(this);
- }
- }
-
- private WorkflowDiagram getCastedModel() {
- return (WorkflowDiagram) getModel();
- }
-
- @Override
- protected List<?> getModelChildren() {
- return getCastedModel().getChildren(); // return a list of shapes
- }
-
- @Override
- public void propertyChange(PropertyChangeEvent evt) {
- String prop = evt.getPropertyName();
- // these properties are fired when Shapes are added into or removed from
- // the ShapeDiagram instance and must cause a call of refreshChildren()
- // to update the diagram's contents.
- if (WorkflowDiagram.CHILD_ADDED_PROP.equals(prop) || WorkflowDiagram.CHILD_REMOVED_PROP.equals(prop)) {
- refreshChildren();
- }
- }
-
- /**
- * EditPolicy for the Figure used by this edit part. Children of XYLayoutEditPolicy can be used in Figures with
- * XYLayout.
- *
- * @author Donald G. Dunne
- */
- private static class ShapesXYLayoutEditPolicy extends XYLayoutEditPolicy {
-
- @Override
- protected Command createChangeConstraintCommand(ChangeBoundsRequest request, EditPart child, Object constraint) {
- if (child instanceof ShapeEditPart && constraint instanceof Rectangle) {
- // return a command that can move and/or resize a Shape
- return new ShapeSetConstraintCommand((Shape) child.getModel(), request, (Rectangle) constraint);
- }
- return super.createChangeConstraintCommand(request, child, constraint);
- }
-
- @Override
- protected Command createChangeConstraintCommand(EditPart child, Object constraint) {
- // not used in this example
- return null;
- }
-
- @Override
- protected Command getCreateCommand(CreateRequest request) {
- Object childClass = request.getNewObjectType();
- if (childClass == EllipticalShape.class || WorkPageShape.class.isAssignableFrom(((Class<?>) childClass))) {
- // return a command that can add a Shape to a WorkflowDiagram
- return new ShapeCreateCommand((Shape) request.getNewObject(), (WorkflowDiagram) getHost().getModel(),
- (Rectangle) getConstraintFor(request));
- }
- return null;
- }
- }
-
+package org.eclipse.osee.ats.workflow.editor.parts;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.List;
+import org.eclipse.draw2d.ConnectionLayer;
+import org.eclipse.draw2d.Figure;
+import org.eclipse.draw2d.FreeformLayer;
+import org.eclipse.draw2d.FreeformLayout;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.MarginBorder;
+import org.eclipse.draw2d.ShortestPathConnectionRouter;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.LayerConstants;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
+import org.eclipse.gef.editpolicies.RootComponentEditPolicy;
+import org.eclipse.gef.editpolicies.XYLayoutEditPolicy;
+import org.eclipse.gef.requests.ChangeBoundsRequest;
+import org.eclipse.gef.requests.CreateRequest;
+import org.eclipse.osee.ats.workflow.editor.model.EllipticalShape;
+import org.eclipse.osee.ats.workflow.editor.model.ModelElement;
+import org.eclipse.osee.ats.workflow.editor.model.Shape;
+import org.eclipse.osee.ats.workflow.editor.model.WorkPageShape;
+import org.eclipse.osee.ats.workflow.editor.model.WorkflowDiagram;
+import org.eclipse.osee.ats.workflow.editor.model.commands.ShapeCreateCommand;
+import org.eclipse.osee.ats.workflow.editor.model.commands.ShapeSetConstraintCommand;
+
+/**
+ * EditPart for the a WorkflowDiagram instance.
+ * <p>
+ * This edit part server as the main diagram container, the white area where everything else is in. Also responsible for
+ * the container's layout (the way the container rearanges is contents) and the container's capabilities (edit
+ * policies).
+ * </p>
+ * <p>
+ * This edit part must implement the PropertyChangeListener interface, so it can be notified of property changes in the
+ * corresponding model element.
+ * </p>
+ *
+ * @author Donald G. Dunne
+ */
+public class DiagramEditPart extends AbstractGraphicalEditPart implements PropertyChangeListener {
+
+ /**
+ * Upon activation, attach to the model element as a property change listener.
+ */
+ @Override
+ public void activate() {
+ if (!isActive()) {
+ super.activate();
+ ((ModelElement) getModel()).addPropertyChangeListener(this);
+ }
+ }
+
+ @Override
+ protected void createEditPolicies() {
+ // disallows the removal of this edit part from its parent
+ installEditPolicy(EditPolicy.COMPONENT_ROLE, new RootComponentEditPolicy());
+ // handles constraint changes (e.g. moving and/or resizing) of model elements
+ // and creation of new model elements
+ installEditPolicy(EditPolicy.LAYOUT_ROLE, new ShapesXYLayoutEditPolicy());
+ }
+
+ @Override
+ protected IFigure createFigure() {
+ Figure f = new FreeformLayer();
+ f.setBorder(new MarginBorder(3));
+ f.setLayoutManager(new FreeformLayout());
+
+ // Create the static router for the connection layer
+ ConnectionLayer connLayer = (ConnectionLayer) getLayer(LayerConstants.CONNECTION_LAYER);
+ connLayer.setConnectionRouter(new ShortestPathConnectionRouter(f));
+
+ return f;
+ }
+
+ /**
+ * Upon deactivation, detach from the model element as a property change listener.
+ */
+ @Override
+ public void deactivate() {
+ if (isActive()) {
+ super.deactivate();
+ ((ModelElement) getModel()).removePropertyChangeListener(this);
+ }
+ }
+
+ private WorkflowDiagram getCastedModel() {
+ return (WorkflowDiagram) getModel();
+ }
+
+ @Override
+ protected List<?> getModelChildren() {
+ return getCastedModel().getChildren(); // return a list of shapes
+ }
+
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ String prop = evt.getPropertyName();
+ // these properties are fired when Shapes are added into or removed from
+ // the ShapeDiagram instance and must cause a call of refreshChildren()
+ // to update the diagram's contents.
+ if (WorkflowDiagram.CHILD_ADDED_PROP.equals(prop) || WorkflowDiagram.CHILD_REMOVED_PROP.equals(prop)) {
+ refreshChildren();
+ }
+ }
+
+ /**
+ * EditPolicy for the Figure used by this edit part. Children of XYLayoutEditPolicy can be used in Figures with
+ * XYLayout.
+ *
+ * @author Donald G. Dunne
+ */
+ private static class ShapesXYLayoutEditPolicy extends XYLayoutEditPolicy {
+
+ @Override
+ protected Command createChangeConstraintCommand(ChangeBoundsRequest request, EditPart child, Object constraint) {
+ if (child instanceof ShapeEditPart && constraint instanceof Rectangle) {
+ // return a command that can move and/or resize a Shape
+ return new ShapeSetConstraintCommand((Shape) child.getModel(), request, (Rectangle) constraint);
+ }
+ return super.createChangeConstraintCommand(request, child, constraint);
+ }
+
+ @Override
+ protected Command createChangeConstraintCommand(EditPart child, Object constraint) {
+ // not used in this example
+ return null;
+ }
+
+ @Override
+ protected Command getCreateCommand(CreateRequest request) {
+ Object childClass = request.getNewObjectType();
+ if (childClass == EllipticalShape.class || WorkPageShape.class.isAssignableFrom(((Class<?>) childClass))) {
+ // return a command that can add a Shape to a WorkflowDiagram
+ return new ShapeCreateCommand((Shape) request.getNewObject(), (WorkflowDiagram) getHost().getModel(),
+ (Rectangle) getConstraintFor(request));
+ }
+ return null;
+ }
+ }
+
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/parts/DiagramTreeEditPart.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/parts/DiagramTreeEditPart.java
index ae3b18c4c67..fadb6782f71 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/parts/DiagramTreeEditPart.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/parts/DiagramTreeEditPart.java
@@ -8,101 +8,101 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.ats.workflow.editor.parts;
-
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.util.List;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.RootEditPart;
-import org.eclipse.gef.editparts.AbstractTreeEditPart;
-import org.eclipse.gef.editpolicies.RootComponentEditPolicy;
-import org.eclipse.osee.ats.workflow.editor.model.ModelElement;
-import org.eclipse.osee.ats.workflow.editor.model.WorkflowDiagram;
-
-/**
- * TreeEditPart for a WorkflowDiagram instance. This is used in the Outline View of the ShapesEditor.
- * <p>
- * This edit part must implement the PropertyChangeListener interface, so it can be notified of property changes in the
- * corresponding model element.
- * </p>
- *
- * @author Donald G. Dunne
- */
-class DiagramTreeEditPart extends AbstractTreeEditPart implements PropertyChangeListener {
-
- /**
- * Create a new instance of this edit part using the given model element.
- *
- * @param model a non-null WorkflowDiagram instance
- */
- DiagramTreeEditPart(WorkflowDiagram model) {
- super(model);
- }
-
- /**
- * Upon activation, attach to the model element as a property change listener.
- */
- @Override
- public void activate() {
- if (!isActive()) {
- super.activate();
- ((ModelElement) getModel()).addPropertyChangeListener(this);
- }
- }
-
- @Override
- protected void createEditPolicies() {
- // If this editpart is the root content of the viewer, then disallow removal
- if (getParent() instanceof RootEditPart) {
- installEditPolicy(EditPolicy.COMPONENT_ROLE, new RootComponentEditPolicy());
- }
- }
-
- /**
- * Upon deactivation, detach from the model element as a property change listener.
- */
- @Override
- public void deactivate() {
- if (isActive()) {
- super.deactivate();
- ((ModelElement) getModel()).removePropertyChangeListener(this);
- }
- }
-
- private WorkflowDiagram getCastedModel() {
- return (WorkflowDiagram) getModel();
- }
-
- /**
- * Convenience method that returns the EditPart corresponding to a given child.
- *
- * @param child a model element instance
- * @return the corresponding EditPart or null
- */
- private EditPart getEditPartForChild(Object child) {
- return (EditPart) getViewer().getEditPartRegistry().get(child);
- }
-
- @Override
- protected List<?> getModelChildren() {
- return getCastedModel().getChildren(); // a list of shapes
- }
-
- @Override
- public void propertyChange(PropertyChangeEvent evt) {
- String prop = evt.getPropertyName();
- if (WorkflowDiagram.CHILD_ADDED_PROP.equals(prop)) {
- // add a child to this edit part
- // causes an additional entry to appear in the tree of the outline view
- addChild(createChild(evt.getNewValue()), -1);
- } else if (WorkflowDiagram.CHILD_REMOVED_PROP.equals(prop)) {
- // remove a child from this edit part
- // causes the corresponding edit part to disappear from the tree in the outline view
- removeChild(getEditPartForChild(evt.getNewValue()));
- } else {
- refreshVisuals();
- }
- }
-}
+package org.eclipse.osee.ats.workflow.editor.parts;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.List;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.RootEditPart;
+import org.eclipse.gef.editparts.AbstractTreeEditPart;
+import org.eclipse.gef.editpolicies.RootComponentEditPolicy;
+import org.eclipse.osee.ats.workflow.editor.model.ModelElement;
+import org.eclipse.osee.ats.workflow.editor.model.WorkflowDiagram;
+
+/**
+ * TreeEditPart for a WorkflowDiagram instance. This is used in the Outline View of the ShapesEditor.
+ * <p>
+ * This edit part must implement the PropertyChangeListener interface, so it can be notified of property changes in the
+ * corresponding model element.
+ * </p>
+ *
+ * @author Donald G. Dunne
+ */
+class DiagramTreeEditPart extends AbstractTreeEditPart implements PropertyChangeListener {
+
+ /**
+ * Create a new instance of this edit part using the given model element.
+ *
+ * @param model a non-null WorkflowDiagram instance
+ */
+ DiagramTreeEditPart(WorkflowDiagram model) {
+ super(model);
+ }
+
+ /**
+ * Upon activation, attach to the model element as a property change listener.
+ */
+ @Override
+ public void activate() {
+ if (!isActive()) {
+ super.activate();
+ ((ModelElement) getModel()).addPropertyChangeListener(this);
+ }
+ }
+
+ @Override
+ protected void createEditPolicies() {
+ // If this editpart is the root content of the viewer, then disallow removal
+ if (getParent() instanceof RootEditPart) {
+ installEditPolicy(EditPolicy.COMPONENT_ROLE, new RootComponentEditPolicy());
+ }
+ }
+
+ /**
+ * Upon deactivation, detach from the model element as a property change listener.
+ */
+ @Override
+ public void deactivate() {
+ if (isActive()) {
+ super.deactivate();
+ ((ModelElement) getModel()).removePropertyChangeListener(this);
+ }
+ }
+
+ private WorkflowDiagram getCastedModel() {
+ return (WorkflowDiagram) getModel();
+ }
+
+ /**
+ * Convenience method that returns the EditPart corresponding to a given child.
+ *
+ * @param child a model element instance
+ * @return the corresponding EditPart or null
+ */
+ private EditPart getEditPartForChild(Object child) {
+ return (EditPart) getViewer().getEditPartRegistry().get(child);
+ }
+
+ @Override
+ protected List<?> getModelChildren() {
+ return getCastedModel().getChildren(); // a list of shapes
+ }
+
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ String prop = evt.getPropertyName();
+ if (WorkflowDiagram.CHILD_ADDED_PROP.equals(prop)) {
+ // add a child to this edit part
+ // causes an additional entry to appear in the tree of the outline view
+ addChild(createChild(evt.getNewValue()), -1);
+ } else if (WorkflowDiagram.CHILD_REMOVED_PROP.equals(prop)) {
+ // remove a child from this edit part
+ // causes the corresponding edit part to disappear from the tree in the outline view
+ removeChild(getEditPartForChild(evt.getNewValue()));
+ } else {
+ refreshVisuals();
+ }
+ }
+}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/parts/ShapeComponentEditPolicy.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/parts/ShapeComponentEditPolicy.java
index 6220f49a704..57e904f2624 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/parts/ShapeComponentEditPolicy.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/parts/ShapeComponentEditPolicy.java
@@ -8,31 +8,31 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.ats.workflow.editor.parts;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.ComponentEditPolicy;
-import org.eclipse.gef.requests.GroupRequest;
-import org.eclipse.osee.ats.workflow.editor.model.Shape;
-import org.eclipse.osee.ats.workflow.editor.model.WorkflowDiagram;
-import org.eclipse.osee.ats.workflow.editor.model.commands.ShapeDeleteCommand;
-
-/**
- * This edit policy enables the removal of a Shapes instance from its container.
- *
- * @see ShapeEditPart#createEditPolicies()
- * @see ShapeTreeEditPart#createEditPolicies()
- * @author Donald G. Dunne
- */
-class ShapeComponentEditPolicy extends ComponentEditPolicy {
-
- @Override
- protected Command createDeleteCommand(GroupRequest deleteRequest) {
- Object parent = getHost().getParent().getModel();
- Object child = getHost().getModel();
- if (parent instanceof WorkflowDiagram && child instanceof Shape) {
- return new ShapeDeleteCommand((WorkflowDiagram) parent, (Shape) child);
- }
- return super.createDeleteCommand(deleteRequest);
- }
+package org.eclipse.osee.ats.workflow.editor.parts;
+
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.ComponentEditPolicy;
+import org.eclipse.gef.requests.GroupRequest;
+import org.eclipse.osee.ats.workflow.editor.model.Shape;
+import org.eclipse.osee.ats.workflow.editor.model.WorkflowDiagram;
+import org.eclipse.osee.ats.workflow.editor.model.commands.ShapeDeleteCommand;
+
+/**
+ * This edit policy enables the removal of a Shapes instance from its container.
+ *
+ * @see ShapeEditPart#createEditPolicies()
+ * @see ShapeTreeEditPart#createEditPolicies()
+ * @author Donald G. Dunne
+ */
+class ShapeComponentEditPolicy extends ComponentEditPolicy {
+
+ @Override
+ protected Command createDeleteCommand(GroupRequest deleteRequest) {
+ Object parent = getHost().getParent().getModel();
+ Object child = getHost().getModel();
+ if (parent instanceof WorkflowDiagram && child instanceof Shape) {
+ return new ShapeDeleteCommand((WorkflowDiagram) parent, (Shape) child);
+ }
+ return super.createDeleteCommand(deleteRequest);
+ }
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/parts/ShapeEditPart.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/parts/ShapeEditPart.java
index 0707295ceb0..a0036f7a0e2 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/parts/ShapeEditPart.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/parts/ShapeEditPart.java
@@ -8,236 +8,236 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.ats.workflow.editor.parts;
-
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.util.List;
-import java.util.logging.Level;
-import org.eclipse.draw2d.ChopboxAnchor;
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.ConnectionAnchor;
-import org.eclipse.draw2d.Ellipse;
-import org.eclipse.draw2d.EllipseAnchor;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.RoundedRectangle;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.ConnectionEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.NodeEditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.gef.editpolicies.GraphicalNodeEditPolicy;
-import org.eclipse.gef.requests.CreateConnectionRequest;
-import org.eclipse.gef.requests.ReconnectRequest;
-import org.eclipse.osee.ats.internal.AtsPlugin;
-import org.eclipse.osee.ats.workflow.editor.model.Connection;
-import org.eclipse.osee.ats.workflow.editor.model.EllipticalShape;
-import org.eclipse.osee.ats.workflow.editor.model.ModelElement;
-import org.eclipse.osee.ats.workflow.editor.model.RectangleShape;
-import org.eclipse.osee.ats.workflow.editor.model.Shape;
-import org.eclipse.osee.ats.workflow.editor.model.commands.ConnectionCreateCommand;
-import org.eclipse.osee.ats.workflow.editor.model.commands.ConnectionReconnectCommand;
-import org.eclipse.osee.framework.core.exception.OseeArgumentException;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.logging.OseeLog;
-
-/**
- * EditPart used for Shape instances (more specific for EllipticalShape and RectangularShape instances).
- * <p>
- * This edit part must implement the PropertyChangeListener interface, so it can be notified of property changes in the
- * corresponding model element.
- * </p>
- *
- * @author Donald G. Dunne
- */
-class ShapeEditPart extends AbstractGraphicalEditPart implements PropertyChangeListener, NodeEditPart {
-
- private ConnectionAnchor anchor;
-
- /**
- * Upon activation, attach to the model element as a property change listener.
- */
- @Override
- public void activate() {
- if (!isActive()) {
- super.activate();
- ((ModelElement) getModel()).addPropertyChangeListener(this);
- }
- }
-
- @Override
- protected void createEditPolicies() {
- // allow removal of the associated model element
- installEditPolicy(EditPolicy.COMPONENT_ROLE, new ShapeComponentEditPolicy());
- // allow the creation of connections and
- // and the reconnection of connections between Shape instances
- installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new GraphicalNodeEditPolicy() {
- @Override
- protected Command getConnectionCompleteCommand(CreateConnectionRequest request) {
- ConnectionCreateCommand cmd = (ConnectionCreateCommand) request.getStartCommand();
- cmd.setTarget((Shape) getHost().getModel());
- return cmd;
- }
-
- @Override
- protected Command getConnectionCreateCommand(CreateConnectionRequest request) {
- Shape source = (Shape) getHost().getModel();
- Class<?> clazz = (Class<?>) request.getNewObjectType();
- ConnectionCreateCommand cmd = new ConnectionCreateCommand(source, clazz);
- request.setStartCommand(cmd);
- return cmd;
- }
-
- @Override
- protected Command getReconnectSourceCommand(ReconnectRequest request) {
- Connection conn = (Connection) request.getConnectionEditPart().getModel();
- Shape newSource = (Shape) getHost().getModel();
- ConnectionReconnectCommand cmd = new ConnectionReconnectCommand(conn);
- cmd.setNewSource(newSource);
- return cmd;
- }
-
- @Override
- protected Command getReconnectTargetCommand(ReconnectRequest request) {
- Connection conn = (Connection) request.getConnectionEditPart().getModel();
- Shape newTarget = (Shape) getHost().getModel();
- ConnectionReconnectCommand cmd = new ConnectionReconnectCommand(conn);
- cmd.setNewTarget(newTarget);
- return cmd;
- }
- });
- }
-
- @Override
- protected IFigure createFigure() {
- IFigure f;
- try {
- f = createFigureForModel();
- f.setOpaque(true); // non-transparent figure
- f.setBackgroundColor(ColorConstants.green);
- return f;
- } catch (OseeCoreException ex) {
- OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
- }
- return null;
- }
-
- /**
- * Return a IFigure depending on the instance of the current model element. This allows this EditPart to be used for
- * both subclasses of Shape.
- */
- protected IFigure createFigureForModel() throws OseeCoreException {
- if (getModel() instanceof EllipticalShape) {
- return new Ellipse();
- }
- if (getModel() instanceof RectangleShape) {
- return new RoundedRectangle();
- }
- // if Shapes gets extended the conditions above must be updated
- throw new OseeArgumentException("Unsupported Shape");
- }
-
- /**
- * Upon deactivation, detach from the model element as a property change listener.
- */
- @Override
- public void deactivate() {
- if (isActive()) {
- super.deactivate();
- ((ModelElement) getModel()).removePropertyChangeListener(this);
- }
- }
-
- private Shape getCastedModel() {
- return (Shape) getModel();
- }
-
- protected ConnectionAnchor getConnectionAnchor() throws OseeCoreException {
- if (anchor == null) {
- if (getModel() instanceof EllipticalShape) {
- anchor = new EllipseAnchor(getFigure());
- } else if (getModel() instanceof RectangleShape) {
- anchor = new ChopboxAnchor(getFigure());
- } else {
- // if Shapes gets extended the conditions above must be updated
- throw new OseeArgumentException("unexpected model");
- }
- }
- return anchor;
- }
-
- @Override
- protected List<?> getModelSourceConnections() {
- return getCastedModel().getSourceConnections();
- }
-
- @Override
- protected List<?> getModelTargetConnections() {
- return getCastedModel().getTargetConnections();
- }
-
- @Override
- public ConnectionAnchor getSourceConnectionAnchor(ConnectionEditPart connection) {
- try {
- return getConnectionAnchor();
- } catch (OseeCoreException ex) {
- OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
- }
- return null;
- }
-
- @Override
- public ConnectionAnchor getSourceConnectionAnchor(Request request) {
- try {
- return getConnectionAnchor();
- } catch (OseeCoreException ex) {
- OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
- }
- return null;
- }
-
- @Override
- public ConnectionAnchor getTargetConnectionAnchor(ConnectionEditPart connection) {
- try {
- return getConnectionAnchor();
- } catch (OseeCoreException ex) {
- OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
- }
- return null;
- }
-
- @Override
- public ConnectionAnchor getTargetConnectionAnchor(Request request) {
- try {
- return getConnectionAnchor();
- } catch (OseeCoreException ex) {
- OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
- }
- return null;
- }
-
- @Override
- public void propertyChange(PropertyChangeEvent evt) {
- String prop = evt.getPropertyName();
- if (Shape.SIZE_PROP.equals(prop) || Shape.LOCATION_PROP.equals(prop)) {
- refreshVisuals();
- } else if (Shape.SOURCE_CONNECTIONS_PROP.equals(prop)) {
- refreshSourceConnections();
- } else if (Shape.TARGET_CONNECTIONS_PROP.equals(prop)) {
- refreshTargetConnections();
- }
- }
-
- @Override
- protected void refreshVisuals() {
- // notify parent container of changed position & location
- // if this line is removed, the XYLayoutManager used by the parent container
- // (the Figure of the ShapesDiagramEditPart), will not know the bounds of this figure
- // and will not draw it correctly.
- Rectangle bounds = new Rectangle(getCastedModel().getLocation(), getCastedModel().getSize());
- ((GraphicalEditPart) getParent()).setLayoutConstraint(this, getFigure(), bounds);
- }
+package org.eclipse.osee.ats.workflow.editor.parts;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.List;
+import java.util.logging.Level;
+import org.eclipse.draw2d.ChopboxAnchor;
+import org.eclipse.draw2d.ColorConstants;
+import org.eclipse.draw2d.ConnectionAnchor;
+import org.eclipse.draw2d.Ellipse;
+import org.eclipse.draw2d.EllipseAnchor;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.RoundedRectangle;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.ConnectionEditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.NodeEditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
+import org.eclipse.gef.editpolicies.GraphicalNodeEditPolicy;
+import org.eclipse.gef.requests.CreateConnectionRequest;
+import org.eclipse.gef.requests.ReconnectRequest;
+import org.eclipse.osee.ats.internal.AtsPlugin;
+import org.eclipse.osee.ats.workflow.editor.model.Connection;
+import org.eclipse.osee.ats.workflow.editor.model.EllipticalShape;
+import org.eclipse.osee.ats.workflow.editor.model.ModelElement;
+import org.eclipse.osee.ats.workflow.editor.model.RectangleShape;
+import org.eclipse.osee.ats.workflow.editor.model.Shape;
+import org.eclipse.osee.ats.workflow.editor.model.commands.ConnectionCreateCommand;
+import org.eclipse.osee.ats.workflow.editor.model.commands.ConnectionReconnectCommand;
+import org.eclipse.osee.framework.core.exception.OseeArgumentException;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+
+/**
+ * EditPart used for Shape instances (more specific for EllipticalShape and RectangularShape instances).
+ * <p>
+ * This edit part must implement the PropertyChangeListener interface, so it can be notified of property changes in the
+ * corresponding model element.
+ * </p>
+ *
+ * @author Donald G. Dunne
+ */
+class ShapeEditPart extends AbstractGraphicalEditPart implements PropertyChangeListener, NodeEditPart {
+
+ private ConnectionAnchor anchor;
+
+ /**
+ * Upon activation, attach to the model element as a property change listener.
+ */
+ @Override
+ public void activate() {
+ if (!isActive()) {
+ super.activate();
+ ((ModelElement) getModel()).addPropertyChangeListener(this);
+ }
+ }
+
+ @Override
+ protected void createEditPolicies() {
+ // allow removal of the associated model element
+ installEditPolicy(EditPolicy.COMPONENT_ROLE, new ShapeComponentEditPolicy());
+ // allow the creation of connections and
+ // and the reconnection of connections between Shape instances
+ installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new GraphicalNodeEditPolicy() {
+ @Override
+ protected Command getConnectionCompleteCommand(CreateConnectionRequest request) {
+ ConnectionCreateCommand cmd = (ConnectionCreateCommand) request.getStartCommand();
+ cmd.setTarget((Shape) getHost().getModel());
+ return cmd;
+ }
+
+ @Override
+ protected Command getConnectionCreateCommand(CreateConnectionRequest request) {
+ Shape source = (Shape) getHost().getModel();
+ Class<?> clazz = (Class<?>) request.getNewObjectType();
+ ConnectionCreateCommand cmd = new ConnectionCreateCommand(source, clazz);
+ request.setStartCommand(cmd);
+ return cmd;
+ }
+
+ @Override
+ protected Command getReconnectSourceCommand(ReconnectRequest request) {
+ Connection conn = (Connection) request.getConnectionEditPart().getModel();
+ Shape newSource = (Shape) getHost().getModel();
+ ConnectionReconnectCommand cmd = new ConnectionReconnectCommand(conn);
+ cmd.setNewSource(newSource);
+ return cmd;
+ }
+
+ @Override
+ protected Command getReconnectTargetCommand(ReconnectRequest request) {
+ Connection conn = (Connection) request.getConnectionEditPart().getModel();
+ Shape newTarget = (Shape) getHost().getModel();
+ ConnectionReconnectCommand cmd = new ConnectionReconnectCommand(conn);
+ cmd.setNewTarget(newTarget);
+ return cmd;
+ }
+ });
+ }
+
+ @Override
+ protected IFigure createFigure() {
+ IFigure f;
+ try {
+ f = createFigureForModel();
+ f.setOpaque(true); // non-transparent figure
+ f.setBackgroundColor(ColorConstants.green);
+ return f;
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ return null;
+ }
+
+ /**
+ * Return a IFigure depending on the instance of the current model element. This allows this EditPart to be used for
+ * both subclasses of Shape.
+ */
+ protected IFigure createFigureForModel() throws OseeCoreException {
+ if (getModel() instanceof EllipticalShape) {
+ return new Ellipse();
+ }
+ if (getModel() instanceof RectangleShape) {
+ return new RoundedRectangle();
+ }
+ // if Shapes gets extended the conditions above must be updated
+ throw new OseeArgumentException("Unsupported Shape");
+ }
+
+ /**
+ * Upon deactivation, detach from the model element as a property change listener.
+ */
+ @Override
+ public void deactivate() {
+ if (isActive()) {
+ super.deactivate();
+ ((ModelElement) getModel()).removePropertyChangeListener(this);
+ }
+ }
+
+ private Shape getCastedModel() {
+ return (Shape) getModel();
+ }
+
+ protected ConnectionAnchor getConnectionAnchor() throws OseeCoreException {
+ if (anchor == null) {
+ if (getModel() instanceof EllipticalShape) {
+ anchor = new EllipseAnchor(getFigure());
+ } else if (getModel() instanceof RectangleShape) {
+ anchor = new ChopboxAnchor(getFigure());
+ } else {
+ // if Shapes gets extended the conditions above must be updated
+ throw new OseeArgumentException("unexpected model");
+ }
+ }
+ return anchor;
+ }
+
+ @Override
+ protected List<?> getModelSourceConnections() {
+ return getCastedModel().getSourceConnections();
+ }
+
+ @Override
+ protected List<?> getModelTargetConnections() {
+ return getCastedModel().getTargetConnections();
+ }
+
+ @Override
+ public ConnectionAnchor getSourceConnectionAnchor(ConnectionEditPart connection) {
+ try {
+ return getConnectionAnchor();
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ return null;
+ }
+
+ @Override
+ public ConnectionAnchor getSourceConnectionAnchor(Request request) {
+ try {
+ return getConnectionAnchor();
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ return null;
+ }
+
+ @Override
+ public ConnectionAnchor getTargetConnectionAnchor(ConnectionEditPart connection) {
+ try {
+ return getConnectionAnchor();
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ return null;
+ }
+
+ @Override
+ public ConnectionAnchor getTargetConnectionAnchor(Request request) {
+ try {
+ return getConnectionAnchor();
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ return null;
+ }
+
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ String prop = evt.getPropertyName();
+ if (Shape.SIZE_PROP.equals(prop) || Shape.LOCATION_PROP.equals(prop)) {
+ refreshVisuals();
+ } else if (Shape.SOURCE_CONNECTIONS_PROP.equals(prop)) {
+ refreshSourceConnections();
+ } else if (Shape.TARGET_CONNECTIONS_PROP.equals(prop)) {
+ refreshTargetConnections();
+ }
+ }
+
+ @Override
+ protected void refreshVisuals() {
+ // notify parent container of changed position & location
+ // if this line is removed, the XYLayoutManager used by the parent container
+ // (the Figure of the ShapesDiagramEditPart), will not know the bounds of this figure
+ // and will not draw it correctly.
+ Rectangle bounds = new Rectangle(getCastedModel().getLocation(), getCastedModel().getSize());
+ ((GraphicalEditPart) getParent()).setLayoutConstraint(this, getFigure(), bounds);
+ }
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/parts/ShapeTreeEditPart.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/parts/ShapeTreeEditPart.java
index b7aa5513f4c..ccde5f0dc79 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/parts/ShapeTreeEditPart.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/parts/ShapeTreeEditPart.java
@@ -8,81 +8,81 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.ats.workflow.editor.parts;
-
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.editparts.AbstractTreeEditPart;
-import org.eclipse.osee.ats.workflow.editor.model.ModelElement;
-import org.eclipse.osee.ats.workflow.editor.model.Shape;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * TreeEditPart used for Shape instances (more specific for EllipticalShape and RectangularShape instances). This is
- * used in the Outline View of the ShapesEditor.
- * <p>
- * This edit part must implement the PropertyChangeListener interface, so it can be notified of property changes in the
- * corresponding model element.
- * </p>
- *
- * @author Donald G. Dunne
- */
-class ShapeTreeEditPart extends AbstractTreeEditPart implements PropertyChangeListener {
-
- /**
- * Create a new instance of this edit part using the given model element.
- *
- * @param model a non-null Shapes instance
- */
- ShapeTreeEditPart(Shape model) {
- super(model);
- }
-
- /**
- * Upon activation, attach to the model element as a property change listener.
- */
- @Override
- public void activate() {
- if (!isActive()) {
- super.activate();
- ((ModelElement) getModel()).addPropertyChangeListener(this);
- }
- }
-
- @Override
- protected void createEditPolicies() {
- // allow removal of the associated model element
- installEditPolicy(EditPolicy.COMPONENT_ROLE, new ShapeComponentEditPolicy());
- }
-
- /**
- * Upon deactivation, detach from the model element as a property change listener.
- */
- @Override
- public void deactivate() {
- if (isActive()) {
- super.deactivate();
- ((ModelElement) getModel()).removePropertyChangeListener(this);
- }
- }
-
- private Shape getCastedModel() {
- return (Shape) getModel();
- }
-
- @Override
- protected Image getImage() {
- return getCastedModel().getIcon();
- }
-
- @Override
- protected String getText() {
- return getCastedModel().toString();
- }
-
- @Override
- public void propertyChange(PropertyChangeEvent evt) {
- refreshVisuals(); // this will cause an invocation of getImage() and getText(), see below
- }
+package org.eclipse.osee.ats.workflow.editor.parts;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.editparts.AbstractTreeEditPart;
+import org.eclipse.osee.ats.workflow.editor.model.ModelElement;
+import org.eclipse.osee.ats.workflow.editor.model.Shape;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * TreeEditPart used for Shape instances (more specific for EllipticalShape and RectangularShape instances). This is
+ * used in the Outline View of the ShapesEditor.
+ * <p>
+ * This edit part must implement the PropertyChangeListener interface, so it can be notified of property changes in the
+ * corresponding model element.
+ * </p>
+ *
+ * @author Donald G. Dunne
+ */
+class ShapeTreeEditPart extends AbstractTreeEditPart implements PropertyChangeListener {
+
+ /**
+ * Create a new instance of this edit part using the given model element.
+ *
+ * @param model a non-null Shapes instance
+ */
+ ShapeTreeEditPart(Shape model) {
+ super(model);
+ }
+
+ /**
+ * Upon activation, attach to the model element as a property change listener.
+ */
+ @Override
+ public void activate() {
+ if (!isActive()) {
+ super.activate();
+ ((ModelElement) getModel()).addPropertyChangeListener(this);
+ }
+ }
+
+ @Override
+ protected void createEditPolicies() {
+ // allow removal of the associated model element
+ installEditPolicy(EditPolicy.COMPONENT_ROLE, new ShapeComponentEditPolicy());
+ }
+
+ /**
+ * Upon deactivation, detach from the model element as a property change listener.
+ */
+ @Override
+ public void deactivate() {
+ if (isActive()) {
+ super.deactivate();
+ ((ModelElement) getModel()).removePropertyChangeListener(this);
+ }
+ }
+
+ private Shape getCastedModel() {
+ return (Shape) getModel();
+ }
+
+ @Override
+ protected Image getImage() {
+ return getCastedModel().getIcon();
+ }
+
+ @Override
+ protected String getText() {
+ return getCastedModel().toString();
+ }
+
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ refreshVisuals(); // this will cause an invocation of getImage() and getText(), see below
+ }
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/parts/ShapesEditPartFactory.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/parts/ShapesEditPartFactory.java
index 9b000e562f2..8739a971d99 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/parts/ShapesEditPartFactory.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/parts/ShapesEditPartFactory.java
@@ -8,59 +8,59 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.ats.workflow.editor.parts;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartFactory;
-import org.eclipse.osee.ats.workflow.editor.model.CancelledWorkPageShape;
-import org.eclipse.osee.ats.workflow.editor.model.CompletedWorkPageShape;
-import org.eclipse.osee.ats.workflow.editor.model.Connection;
-import org.eclipse.osee.ats.workflow.editor.model.Shape;
-import org.eclipse.osee.ats.workflow.editor.model.WorkPageShape;
-import org.eclipse.osee.ats.workflow.editor.model.WorkflowDiagram;
-
-/**
- * Factory that maps model elements to edit parts.
- *
- * @author Donald G. Dunne
- */
-public class ShapesEditPartFactory implements EditPartFactory {
-
- @Override
- public EditPart createEditPart(EditPart context, Object modelElement) {
- // get EditPart for model element
- EditPart part = getPartForElement(modelElement);
- // store model element in EditPart
- part.setModel(modelElement);
- return part;
- }
-
- /**
- * Maps an object to an EditPart.
- *
- * @throws RuntimeException if no match was found (programming error)
- */
- private EditPart getPartForElement(Object modelElement) {
- if (modelElement instanceof WorkflowDiagram) {
- return new DiagramEditPart();
- }
- if (modelElement instanceof CompletedWorkPageShape) {
- return new WorkPageEditPart((CompletedWorkPageShape) modelElement);
- }
- if (modelElement instanceof CancelledWorkPageShape) {
- return new WorkPageEditPart((CancelledWorkPageShape) modelElement);
- }
- if (modelElement instanceof WorkPageShape) {
- return new WorkPageEditPart((WorkPageShape) modelElement);
- }
- if (modelElement instanceof Shape) {
- return new ShapeEditPart();
- }
- if (modelElement instanceof Connection) {
- return new ConnectionEditPart();
- }
- throw new RuntimeException(
- "Can't create part for model element: " + (modelElement != null ? modelElement.getClass().getName() : "null"));
- }
-
+package org.eclipse.osee.ats.workflow.editor.parts;
+
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPartFactory;
+import org.eclipse.osee.ats.workflow.editor.model.CancelledWorkPageShape;
+import org.eclipse.osee.ats.workflow.editor.model.CompletedWorkPageShape;
+import org.eclipse.osee.ats.workflow.editor.model.Connection;
+import org.eclipse.osee.ats.workflow.editor.model.Shape;
+import org.eclipse.osee.ats.workflow.editor.model.WorkPageShape;
+import org.eclipse.osee.ats.workflow.editor.model.WorkflowDiagram;
+
+/**
+ * Factory that maps model elements to edit parts.
+ *
+ * @author Donald G. Dunne
+ */
+public class ShapesEditPartFactory implements EditPartFactory {
+
+ @Override
+ public EditPart createEditPart(EditPart context, Object modelElement) {
+ // get EditPart for model element
+ EditPart part = getPartForElement(modelElement);
+ // store model element in EditPart
+ part.setModel(modelElement);
+ return part;
+ }
+
+ /**
+ * Maps an object to an EditPart.
+ *
+ * @throws RuntimeException if no match was found (programming error)
+ */
+ private EditPart getPartForElement(Object modelElement) {
+ if (modelElement instanceof WorkflowDiagram) {
+ return new DiagramEditPart();
+ }
+ if (modelElement instanceof CompletedWorkPageShape) {
+ return new WorkPageEditPart((CompletedWorkPageShape) modelElement);
+ }
+ if (modelElement instanceof CancelledWorkPageShape) {
+ return new WorkPageEditPart((CancelledWorkPageShape) modelElement);
+ }
+ if (modelElement instanceof WorkPageShape) {
+ return new WorkPageEditPart((WorkPageShape) modelElement);
+ }
+ if (modelElement instanceof Shape) {
+ return new ShapeEditPart();
+ }
+ if (modelElement instanceof Connection) {
+ return new ConnectionEditPart();
+ }
+ throw new RuntimeException(
+ "Can't create part for model element: " + (modelElement != null ? modelElement.getClass().getName() : "null"));
+ }
+
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/parts/ShapesTreeEditPartFactory.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/parts/ShapesTreeEditPartFactory.java
index 35e364e0a9d..b0440fefbc6 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/parts/ShapesTreeEditPartFactory.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/parts/ShapesTreeEditPartFactory.java
@@ -8,29 +8,29 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.ats.workflow.editor.parts;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartFactory;
-import org.eclipse.osee.ats.workflow.editor.model.Shape;
-import org.eclipse.osee.ats.workflow.editor.model.WorkflowDiagram;
-
-/**
- * Factory that maps model elements to TreeEditParts. TreeEditParts are used in the outline view of the ShapesEditor.
- *
- * @author Donald G. Dunne
- */
-public class ShapesTreeEditPartFactory implements EditPartFactory {
-
- @Override
- public EditPart createEditPart(EditPart context, Object model) {
- if (model instanceof Shape) {
- return new ShapeTreeEditPart((Shape) model);
- }
- if (model instanceof WorkflowDiagram) {
- return new DiagramTreeEditPart((WorkflowDiagram) model);
- }
- return null; // will not show an entry for the corresponding model instance
- }
-
-}
+package org.eclipse.osee.ats.workflow.editor.parts;
+
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPartFactory;
+import org.eclipse.osee.ats.workflow.editor.model.Shape;
+import org.eclipse.osee.ats.workflow.editor.model.WorkflowDiagram;
+
+/**
+ * Factory that maps model elements to TreeEditParts. TreeEditParts are used in the outline view of the ShapesEditor.
+ *
+ * @author Donald G. Dunne
+ */
+public class ShapesTreeEditPartFactory implements EditPartFactory {
+
+ @Override
+ public EditPart createEditPart(EditPart context, Object model) {
+ if (model instanceof Shape) {
+ return new ShapeTreeEditPart((Shape) model);
+ }
+ if (model instanceof WorkflowDiagram) {
+ return new DiagramTreeEditPart((WorkflowDiagram) model);
+ }
+ return null; // will not show an entry for the corresponding model instance
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/wizard/AtsWorkflowConfigCreationWizard.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/wizard/AtsWorkflowConfigCreationWizard.java
index 126f6fc79eb..9bdc9879f18 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/wizard/AtsWorkflowConfigCreationWizard.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/wizard/AtsWorkflowConfigCreationWizard.java
@@ -8,157 +8,157 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.ats.workflow.editor.wizard;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.osee.ats.artifact.AtsAttributeTypes;
-import org.eclipse.osee.ats.artifact.TeamDefinitionArtifact;
-import org.eclipse.osee.ats.config.AtsConfigManager;
-import org.eclipse.osee.ats.internal.AtsPlugin;
-import org.eclipse.osee.ats.util.AtsUtil;
-import org.eclipse.osee.ats.workflow.item.AtsWorkDefinitions;
-import org.eclipse.osee.ats.workflow.item.AtsWorkDefinitions.RuleWorkItemId;
-import org.eclipse.osee.ats.workflow.page.AtsCancelledWorkPageDefinition;
-import org.eclipse.osee.ats.workflow.page.AtsCompletedWorkPageDefinition;
-import org.eclipse.osee.ats.workflow.page.AtsEndorseWorkPageDefinition;
-import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.logging.OseeLevel;
-import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
-import org.eclipse.osee.framework.ui.skynet.render.PresentationType;
-import org.eclipse.osee.framework.ui.skynet.render.RendererManager;
-import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkFlowDefinition;
-import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkFlowDefinition.TransitionType;
-import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkItemDefinition.WriteType;
-import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkItemDefinitionFactory;
-import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPageDefinition;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
-
-/**
- * Create new new .shape-file. Those files can be used with the ShapesEditor (see plugin.xml).
- *
- * @author Donald G. Dunne
- */
-public class AtsWorkflowConfigCreationWizard extends Wizard implements INewWizard {
-
- private NewWorkflowConfigPage1 page1;
-
- @Override
- public void addPages() {
- // add pages to this wizard
- addPage(page1);
- }
-
- @Override
- public void init(IWorkbench workbench, IStructuredSelection selection) {
- // create pages for this wizard
- page1 = new NewWorkflowConfigPage1(this);
- }
-
- @Override
- public boolean performFinish() {
-
- try {
- final String namespace = page1.getNamespace();
- final String startingWorkflow = page1.getStartingWorkflow();
- try {
- if (WorkItemDefinitionFactory.getWorkItemDefinition(namespace) != null) {
- AWorkbench.popup("ERROR", "Namespace already used, choose a unique namespace.");
- return false;
- }
- } catch (OseeCoreException ex) {
- // do nothing
- }
- SkynetTransaction transaction = new SkynetTransaction(AtsUtil.getAtsBranch(), "ATS Config Wizard");
- WorkFlowDefinition workflow = null;
- if (startingWorkflow.contains("Simple")) {
- workflow = generateSimpleWorkflow(namespace, transaction, null).getWorkDefinition();
- } else {
- WorkflowData workflowData = AtsConfigManager.generateDefaultWorkflow(namespace, transaction, null);
- workflow = workflowData.getWorkDefinition();
- }
- transaction.execute();
-
- RendererManager.open(workflow.getArtifact(), PresentationType.SPECIALIZED_EDIT);
- } catch (Exception ex) {
- OseeLog.log(AtsPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- }
- return true;
-
- }
- public static class WorkflowData {
- private final WorkFlowDefinition workDefinition;
- private final Artifact workFlowArtifact;
-
- public WorkflowData(WorkFlowDefinition workDefinition, Artifact workFlowArtifact) {
- this.workDefinition = workDefinition;
- this.workFlowArtifact = workFlowArtifact;
- }
-
- /**
- * @return the workDefinition
- */
- public WorkFlowDefinition getWorkDefinition() {
- return workDefinition;
- }
-
- /**
- * @return the workFlowArtifact
- */
- public Artifact getWorkFlowArtifact() {
- return workFlowArtifact;
- }
- }
-
- public static WorkflowData generateSimpleWorkflow(String namespace, SkynetTransaction transaction, TeamDefinitionArtifact teamDef) throws OseeCoreException {
- WorkFlowDefinition workflow = new WorkFlowDefinition(namespace, namespace, null);
- WorkPageDefinition endorsePage =
- new WorkPageDefinition("Endorse", namespace + ".Endorse", AtsEndorseWorkPageDefinition.ID);
-
- workflow.setStartPageId(endorsePage.getPageName());
-
- WorkPageDefinition implementPage = new WorkPageDefinition("Implement", namespace + ".Implement", null);
- implementPage.addWorkItem(RuleWorkItemId.atsRequireStateHourSpentPrompt.name());
- implementPage.addWorkItem(AtsAttributeTypes.WorkPackage);
- implementPage.addWorkItem(AtsAttributeTypes.Resolution);
-
- WorkPageDefinition completedPage =
- new WorkPageDefinition("Completed", namespace + ".Completed", AtsCompletedWorkPageDefinition.ID);
-
- WorkPageDefinition cancelledPage =
- new WorkPageDefinition("Cancelled", namespace + ".Cancelled", AtsCancelledWorkPageDefinition.ID);
-
- workflow.addPageTransition(endorsePage.getPageName(), implementPage.getPageName(), TransitionType.ToPageAsDefault);
- workflow.addPageTransition(implementPage.getPageName(), endorsePage.getPageName(), TransitionType.ToPageAsReturn);
- workflow.addPageTransition(cancelledPage.getPageName(), endorsePage.getPageName(), TransitionType.ToPageAsReturn);
- workflow.addPageTransition(implementPage.getPageName(), completedPage.getPageName(),
- TransitionType.ToPageAsDefault);
- workflow.addPageTransition(endorsePage.getPageName(), cancelledPage.getPageName(), TransitionType.ToPage);
-
- List<Artifact> artifacts = new ArrayList<Artifact>();
- artifacts.add(endorsePage.toArtifact(WriteType.New));
- artifacts.add(implementPage.toArtifact(WriteType.New));
- artifacts.add(completedPage.toArtifact(WriteType.New));
- artifacts.add(cancelledPage.toArtifact(WriteType.New));
- Artifact workflowArt = workflow.toArtifact(WriteType.New);
- if (teamDef != null) {
- teamDef.addRelation(CoreRelationTypes.WorkItem__Child, workflowArt);
- artifacts.add(teamDef);
- }
- artifacts.add(workflowArt);
- workflow.loadPageData(true);
-
- for (Artifact artifact : artifacts) {
- AtsWorkDefinitions.addUpdateWorkItemToDefaultHeirarchy(artifact, transaction);
- artifact.persist(transaction);
- }
- return new WorkflowData(workflow, workflowArt);
- }
-}
+package org.eclipse.osee.ats.workflow.editor.wizard;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.osee.ats.artifact.AtsAttributeTypes;
+import org.eclipse.osee.ats.artifact.TeamDefinitionArtifact;
+import org.eclipse.osee.ats.config.AtsConfigManager;
+import org.eclipse.osee.ats.internal.AtsPlugin;
+import org.eclipse.osee.ats.util.AtsUtil;
+import org.eclipse.osee.ats.workflow.item.AtsWorkDefinitions;
+import org.eclipse.osee.ats.workflow.item.AtsWorkDefinitions.RuleWorkItemId;
+import org.eclipse.osee.ats.workflow.page.AtsCancelledWorkPageDefinition;
+import org.eclipse.osee.ats.workflow.page.AtsCompletedWorkPageDefinition;
+import org.eclipse.osee.ats.workflow.page.AtsEndorseWorkPageDefinition;
+import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLevel;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.framework.ui.skynet.render.PresentationType;
+import org.eclipse.osee.framework.ui.skynet.render.RendererManager;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkFlowDefinition;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkFlowDefinition.TransitionType;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkItemDefinition.WriteType;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkItemDefinitionFactory;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPageDefinition;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+
+/**
+ * Create new new .shape-file. Those files can be used with the ShapesEditor (see plugin.xml).
+ *
+ * @author Donald G. Dunne
+ */
+public class AtsWorkflowConfigCreationWizard extends Wizard implements INewWizard {
+
+ private NewWorkflowConfigPage1 page1;
+
+ @Override
+ public void addPages() {
+ // add pages to this wizard
+ addPage(page1);
+ }
+
+ @Override
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ // create pages for this wizard
+ page1 = new NewWorkflowConfigPage1(this);
+ }
+
+ @Override
+ public boolean performFinish() {
+
+ try {
+ final String namespace = page1.getNamespace();
+ final String startingWorkflow = page1.getStartingWorkflow();
+ try {
+ if (WorkItemDefinitionFactory.getWorkItemDefinition(namespace) != null) {
+ AWorkbench.popup("ERROR", "Namespace already used, choose a unique namespace.");
+ return false;
+ }
+ } catch (OseeCoreException ex) {
+ // do nothing
+ }
+ SkynetTransaction transaction = new SkynetTransaction(AtsUtil.getAtsBranch(), "ATS Config Wizard");
+ WorkFlowDefinition workflow = null;
+ if (startingWorkflow.contains("Simple")) {
+ workflow = generateSimpleWorkflow(namespace, transaction, null).getWorkDefinition();
+ } else {
+ WorkflowData workflowData = AtsConfigManager.generateDefaultWorkflow(namespace, transaction, null);
+ workflow = workflowData.getWorkDefinition();
+ }
+ transaction.execute();
+
+ RendererManager.open(workflow.getArtifact(), PresentationType.SPECIALIZED_EDIT);
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ return true;
+
+ }
+ public static class WorkflowData {
+ private final WorkFlowDefinition workDefinition;
+ private final Artifact workFlowArtifact;
+
+ public WorkflowData(WorkFlowDefinition workDefinition, Artifact workFlowArtifact) {
+ this.workDefinition = workDefinition;
+ this.workFlowArtifact = workFlowArtifact;
+ }
+
+ /**
+ * @return the workDefinition
+ */
+ public WorkFlowDefinition getWorkDefinition() {
+ return workDefinition;
+ }
+
+ /**
+ * @return the workFlowArtifact
+ */
+ public Artifact getWorkFlowArtifact() {
+ return workFlowArtifact;
+ }
+ }
+
+ public static WorkflowData generateSimpleWorkflow(String namespace, SkynetTransaction transaction, TeamDefinitionArtifact teamDef) throws OseeCoreException {
+ WorkFlowDefinition workflow = new WorkFlowDefinition(namespace, namespace, null);
+ WorkPageDefinition endorsePage =
+ new WorkPageDefinition("Endorse", namespace + ".Endorse", AtsEndorseWorkPageDefinition.ID);
+
+ workflow.setStartPageId(endorsePage.getPageName());
+
+ WorkPageDefinition implementPage = new WorkPageDefinition("Implement", namespace + ".Implement", null);
+ implementPage.addWorkItem(RuleWorkItemId.atsRequireStateHourSpentPrompt.name());
+ implementPage.addWorkItem(AtsAttributeTypes.WorkPackage);
+ implementPage.addWorkItem(AtsAttributeTypes.Resolution);
+
+ WorkPageDefinition completedPage =
+ new WorkPageDefinition("Completed", namespace + ".Completed", AtsCompletedWorkPageDefinition.ID);
+
+ WorkPageDefinition cancelledPage =
+ new WorkPageDefinition("Cancelled", namespace + ".Cancelled", AtsCancelledWorkPageDefinition.ID);
+
+ workflow.addPageTransition(endorsePage.getPageName(), implementPage.getPageName(), TransitionType.ToPageAsDefault);
+ workflow.addPageTransition(implementPage.getPageName(), endorsePage.getPageName(), TransitionType.ToPageAsReturn);
+ workflow.addPageTransition(cancelledPage.getPageName(), endorsePage.getPageName(), TransitionType.ToPageAsReturn);
+ workflow.addPageTransition(implementPage.getPageName(), completedPage.getPageName(),
+ TransitionType.ToPageAsDefault);
+ workflow.addPageTransition(endorsePage.getPageName(), cancelledPage.getPageName(), TransitionType.ToPage);
+
+ List<Artifact> artifacts = new ArrayList<Artifact>();
+ artifacts.add(endorsePage.toArtifact(WriteType.New));
+ artifacts.add(implementPage.toArtifact(WriteType.New));
+ artifacts.add(completedPage.toArtifact(WriteType.New));
+ artifacts.add(cancelledPage.toArtifact(WriteType.New));
+ Artifact workflowArt = workflow.toArtifact(WriteType.New);
+ if (teamDef != null) {
+ teamDef.addRelation(CoreRelationTypes.WorkItem__Child, workflowArt);
+ artifacts.add(teamDef);
+ }
+ artifacts.add(workflowArt);
+ workflow.loadPageData(true);
+
+ for (Artifact artifact : artifacts) {
+ AtsWorkDefinitions.addUpdateWorkItemToDefaultHeirarchy(artifact, transaction);
+ artifact.persist(transaction);
+ }
+ return new WorkflowData(workflow, workflowArt);
+ }
+}
diff --git a/plugins/org.eclipse.osee.coverage/src-gen/org/eclipse/osee/coverage/msgs/CoverageChange1.java b/plugins/org.eclipse.osee.coverage/src-gen/org/eclipse/osee/coverage/msgs/CoverageChange1.java
index 7fa6a411d67..5abb6133075 100644
--- a/plugins/org.eclipse.osee.coverage/src-gen/org/eclipse/osee/coverage/msgs/CoverageChange1.java
+++ b/plugins/org.eclipse.osee.coverage/src-gen/org/eclipse/osee/coverage/msgs/CoverageChange1.java
@@ -1,119 +1,119 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2010.09.20 at 02:51:29 PM MST
-//
-
-
-package org.eclipse.osee.coverage.msgs;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-
-
-/**
- * <p>Java class for CoverageChange1 complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * &lt;complexType name="CoverageChange1">
- * &lt;complexContent>
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * &lt;sequence>
- * &lt;element name="name" type="{http://www.w3.org/2001/XMLSchema}string"/>
- * &lt;element name="guid" type="{http://www.w3.org/2001/XMLSchema}string"/>
- * &lt;element name="modTypeGuid" type="{http://www.w3.org/2001/XMLSchema}string"/>
- * &lt;/sequence>
- * &lt;/restriction>
- * &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- *
- *
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "CoverageChange1", propOrder = {
- "name",
- "guid",
- "modTypeGuid"
-})
-public class CoverageChange1 {
-
- @XmlElement(required = true)
- protected String name;
- @XmlElement(required = true)
- protected String guid;
- @XmlElement(required = true)
- protected String modTypeGuid;
-
- /**
- * Gets the value of the name property.
- *
- * possible object is
- * {@link String }
- *
- */
- public String getName() {
- return name;
- }
-
- /**
- * Sets the value of the name property.
- *
- * allowed object is
- * {@link String }
- *
- */
- public void setName(String value) {
- this.name = value;
- }
-
- /**
- * Gets the value of the guid property.
- *
- * possible object is
- * {@link String }
- *
- */
- public String getGuid() {
- return guid;
- }
-
- /**
- * Sets the value of the guid property.
- *
- * allowed object is
- * {@link String }
- *
- */
- public void setGuid(String value) {
- this.guid = value;
- }
-
- /**
- * Gets the value of the modTypeGuid property.
- *
- * possible object is
- * {@link String }
- *
- */
- public String getModTypeGuid() {
- return modTypeGuid;
- }
-
- /**
- * Sets the value of the modTypeGuid property.
- *
- * allowed object is
- * {@link String }
- *
- */
- public void setModTypeGuid(String value) {
- this.modTypeGuid = value;
- }
-
-}
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2010.09.20 at 02:51:29 PM MST
+//
+
+
+package org.eclipse.osee.coverage.msgs;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for CoverageChange1 complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="CoverageChange1">
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;sequence>
+ * &lt;element name="name" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="guid" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="modTypeGuid" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;/sequence>
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "CoverageChange1", propOrder = {
+ "name",
+ "guid",
+ "modTypeGuid"
+})
+public class CoverageChange1 {
+
+ @XmlElement(required = true)
+ protected String name;
+ @XmlElement(required = true)
+ protected String guid;
+ @XmlElement(required = true)
+ protected String modTypeGuid;
+
+ /**
+ * Gets the value of the name property.
+ *
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Sets the value of the name property.
+ *
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setName(String value) {
+ this.name = value;
+ }
+
+ /**
+ * Gets the value of the guid property.
+ *
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getGuid() {
+ return guid;
+ }
+
+ /**
+ * Sets the value of the guid property.
+ *
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setGuid(String value) {
+ this.guid = value;
+ }
+
+ /**
+ * Gets the value of the modTypeGuid property.
+ *
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getModTypeGuid() {
+ return modTypeGuid;
+ }
+
+ /**
+ * Sets the value of the modTypeGuid property.
+ *
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setModTypeGuid(String value) {
+ this.modTypeGuid = value;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.coverage/src-gen/org/eclipse/osee/coverage/msgs/CoveragePackageEvent1.java b/plugins/org.eclipse.osee.coverage/src-gen/org/eclipse/osee/coverage/msgs/CoveragePackageEvent1.java
index d9e130b9e99..c847b941659 100644
--- a/plugins/org.eclipse.osee.coverage/src-gen/org/eclipse/osee/coverage/msgs/CoveragePackageEvent1.java
+++ b/plugins/org.eclipse.osee.coverage/src-gen/org/eclipse/osee/coverage/msgs/CoveragePackageEvent1.java
@@ -1,128 +1,128 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2010.09.20 at 02:51:29 PM MST
-//
-
-
-package org.eclipse.osee.coverage.msgs;
-
-import java.util.ArrayList;
-import java.util.List;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-
-
-/**
- * <p>Java class for CoveragePackageEvent1 complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * &lt;complexType name="CoveragePackageEvent1">
- * &lt;complexContent>
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * &lt;sequence>
- * &lt;element name="package" type="{}CoverageChange1"/>
- * &lt;element name="coverages" type="{}CoverageChange1" maxOccurs="unbounded"/>
- * &lt;element name="sessionId" type="{http://www.w3.org/2001/XMLSchema}string"/>
- * &lt;/sequence>
- * &lt;/restriction>
- * &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- *
- *
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "CoveragePackageEvent1", propOrder = {
- "_package",
- "coverages",
- "sessionId"
-})
-public class CoveragePackageEvent1 {
-
- @XmlElement(name = "package", required = true)
- protected CoverageChange1 _package;
- @XmlElement(required = true)
- protected List<CoverageChange1> coverages;
- @XmlElement(required = true)
- protected String sessionId;
-
- /**
- * Gets the value of the package property.
- *
- * possible object is
- * {@link CoverageChange1 }
- *
- */
- public CoverageChange1 getPackage() {
- return _package;
- }
-
- /**
- * Sets the value of the package property.
- *
- * allowed object is
- * {@link CoverageChange1 }
- *
- */
- public void setPackage(CoverageChange1 value) {
- this._package = value;
- }
-
- /**
- * Gets the value of the coverages property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the coverages property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getCoverages().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link CoverageChange1 }
- *
- *
- */
- public List<CoverageChange1> getCoverages() {
- if (coverages == null) {
- coverages = new ArrayList<CoverageChange1>();
- }
- return this.coverages;
- }
-
- /**
- * Gets the value of the sessionId property.
- *
- * possible object is
- * {@link String }
- *
- */
- public String getSessionId() {
- return sessionId;
- }
-
- /**
- * Sets the value of the sessionId property.
- *
- * allowed object is
- * {@link String }
- *
- */
- public void setSessionId(String value) {
- this.sessionId = value;
- }
-
-}
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2010.09.20 at 02:51:29 PM MST
+//
+
+
+package org.eclipse.osee.coverage.msgs;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for CoveragePackageEvent1 complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="CoveragePackageEvent1">
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;sequence>
+ * &lt;element name="package" type="{}CoverageChange1"/>
+ * &lt;element name="coverages" type="{}CoverageChange1" maxOccurs="unbounded"/>
+ * &lt;element name="sessionId" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;/sequence>
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "CoveragePackageEvent1", propOrder = {
+ "_package",
+ "coverages",
+ "sessionId"
+})
+public class CoveragePackageEvent1 {
+
+ @XmlElement(name = "package", required = true)
+ protected CoverageChange1 _package;
+ @XmlElement(required = true)
+ protected List<CoverageChange1> coverages;
+ @XmlElement(required = true)
+ protected String sessionId;
+
+ /**
+ * Gets the value of the package property.
+ *
+ * possible object is
+ * {@link CoverageChange1 }
+ *
+ */
+ public CoverageChange1 getPackage() {
+ return _package;
+ }
+
+ /**
+ * Sets the value of the package property.
+ *
+ * allowed object is
+ * {@link CoverageChange1 }
+ *
+ */
+ public void setPackage(CoverageChange1 value) {
+ this._package = value;
+ }
+
+ /**
+ * Gets the value of the coverages property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the coverages property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getCoverages().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link CoverageChange1 }
+ *
+ *
+ */
+ public List<CoverageChange1> getCoverages() {
+ if (coverages == null) {
+ coverages = new ArrayList<CoverageChange1>();
+ }
+ return this.coverages;
+ }
+
+ /**
+ * Gets the value of the sessionId property.
+ *
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getSessionId() {
+ return sessionId;
+ }
+
+ /**
+ * Sets the value of the sessionId property.
+ *
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setSessionId(String value) {
+ this.sessionId = value;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.coverage/src-gen/org/eclipse/osee/coverage/msgs/ObjectFactory.java b/plugins/org.eclipse.osee.coverage/src-gen/org/eclipse/osee/coverage/msgs/ObjectFactory.java
index 755dc320e9c..814a1f43336 100644
--- a/plugins/org.eclipse.osee.coverage/src-gen/org/eclipse/osee/coverage/msgs/ObjectFactory.java
+++ b/plugins/org.eclipse.osee.coverage/src-gen/org/eclipse/osee/coverage/msgs/ObjectFactory.java
@@ -1,68 +1,68 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2010.09.20 at 02:51:29 PM MST
-//
-
-
-package org.eclipse.osee.coverage.msgs;
-
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.annotation.XmlElementDecl;
-import javax.xml.bind.annotation.XmlRegistry;
-import javax.xml.namespace.QName;
-
-
-/**
- * This object contains factory methods for each
- * Java content interface and Java element interface
- * generated in the org.eclipse.osee.coverage.msgs package.
- * <p>An ObjectFactory allows you to programatically
- * construct new instances of the Java representation
- * for XML content. The Java representation of XML
- * content can consist of schema derived interfaces
- * and classes representing the binding of schema
- * type definitions, element declarations and model
- * groups. Factory methods for each of these are
- * provided in this class.
- *
- */
-@XmlRegistry
-public class ObjectFactory {
-
- private final static QName _CoveragePackageEvent1_QNAME = new QName("", "CoveragePackageEvent1");
-
- /**
- * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.eclipse.osee.coverage.msgs
- *
- */
- public ObjectFactory() {
- }
-
- /**
- * Create an instance of {@link CoveragePackageEvent1 }
- *
- */
- public CoveragePackageEvent1 createCoveragePackageEvent1() {
- return new CoveragePackageEvent1();
- }
-
- /**
- * Create an instance of {@link CoverageChange1 }
- *
- */
- public CoverageChange1 createCoverageChange1() {
- return new CoverageChange1();
- }
-
- /**
- * Create an instance of {@link JAXBElement }{@code <}{@link CoveragePackageEvent1 }{@code >}}
- *
- */
- @XmlElementDecl(namespace = "", name = "CoveragePackageEvent1")
- public JAXBElement<CoveragePackageEvent1> createCoveragePackageEvent1(CoveragePackageEvent1 value) {
- return new JAXBElement<CoveragePackageEvent1>(_CoveragePackageEvent1_QNAME, CoveragePackageEvent1 .class, null, value);
- }
-
-}
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2010.09.20 at 02:51:29 PM MST
+//
+
+
+package org.eclipse.osee.coverage.msgs;
+
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.annotation.XmlElementDecl;
+import javax.xml.bind.annotation.XmlRegistry;
+import javax.xml.namespace.QName;
+
+
+/**
+ * This object contains factory methods for each
+ * Java content interface and Java element interface
+ * generated in the org.eclipse.osee.coverage.msgs package.
+ * <p>An ObjectFactory allows you to programatically
+ * construct new instances of the Java representation
+ * for XML content. The Java representation of XML
+ * content can consist of schema derived interfaces
+ * and classes representing the binding of schema
+ * type definitions, element declarations and model
+ * groups. Factory methods for each of these are
+ * provided in this class.
+ *
+ */
+@XmlRegistry
+public class ObjectFactory {
+
+ private final static QName _CoveragePackageEvent1_QNAME = new QName("", "CoveragePackageEvent1");
+
+ /**
+ * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.eclipse.osee.coverage.msgs
+ *
+ */
+ public ObjectFactory() {
+ }
+
+ /**
+ * Create an instance of {@link CoveragePackageEvent1 }
+ *
+ */
+ public CoveragePackageEvent1 createCoveragePackageEvent1() {
+ return new CoveragePackageEvent1();
+ }
+
+ /**
+ * Create an instance of {@link CoverageChange1 }
+ *
+ */
+ public CoverageChange1 createCoverageChange1() {
+ return new CoverageChange1();
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link CoveragePackageEvent1 }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "", name = "CoveragePackageEvent1")
+ public JAXBElement<CoveragePackageEvent1> createCoveragePackageEvent1(CoveragePackageEvent1 value) {
+ return new JAXBElement<CoveragePackageEvent1>(_CoveragePackageEvent1_QNAME, CoveragePackageEvent1 .class, null, value);
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/event/CoverageChange.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/event/CoverageChange.java
index 63e79e5c2f5..70be52725c2 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/event/CoverageChange.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/event/CoverageChange.java
@@ -1,57 +1,57 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2010.09.20 at 02:02:40 PM MST
-//
-
-package org.eclipse.osee.coverage.event;
-
-import org.eclipse.osee.coverage.model.ICoverage;
-
-public class CoverageChange {
-
- protected String name;
- protected String guid;
- protected CoverageEventType coverageEventType;
-
- public CoverageChange(ICoverage coverage, CoverageEventType coverageEventType) {
- this(coverage.getName(), coverage.getGuid(), coverageEventType);
- }
-
- public CoverageChange(String name, String guid, CoverageEventType coverageEventType) {
- super();
- this.name = name;
- this.guid = guid;
- this.coverageEventType = coverageEventType;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String value) {
- this.name = value;
- }
-
- public String getGuid() {
- return guid;
- }
-
- public void setGuid(String value) {
- this.guid = value;
- }
-
- public CoverageEventType getEventType() {
- return coverageEventType;
- }
-
- public void setEventType(CoverageEventType coverageEventType) {
- this.coverageEventType = coverageEventType;
- }
-
- @Override
- public String toString() {
- return String.format("[%s - %s - %s]", this.coverageEventType, this.guid, this.name);
- }
-}
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2010.09.20 at 02:02:40 PM MST
+//
+
+package org.eclipse.osee.coverage.event;
+
+import org.eclipse.osee.coverage.model.ICoverage;
+
+public class CoverageChange {
+
+ protected String name;
+ protected String guid;
+ protected CoverageEventType coverageEventType;
+
+ public CoverageChange(ICoverage coverage, CoverageEventType coverageEventType) {
+ this(coverage.getName(), coverage.getGuid(), coverageEventType);
+ }
+
+ public CoverageChange(String name, String guid, CoverageEventType coverageEventType) {
+ super();
+ this.name = name;
+ this.guid = guid;
+ this.coverageEventType = coverageEventType;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String value) {
+ this.name = value;
+ }
+
+ public String getGuid() {
+ return guid;
+ }
+
+ public void setGuid(String value) {
+ this.guid = value;
+ }
+
+ public CoverageEventType getEventType() {
+ return coverageEventType;
+ }
+
+ public void setEventType(CoverageEventType coverageEventType) {
+ this.coverageEventType = coverageEventType;
+ }
+
+ @Override
+ public String toString() {
+ return String.format("[%s - %s - %s]", this.coverageEventType, this.guid, this.name);
+ }
+}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/event/CoveragePackageEvent.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/event/CoveragePackageEvent.java
index ec3915e2090..146fe89ff85 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/event/CoveragePackageEvent.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/event/CoveragePackageEvent.java
@@ -1,62 +1,62 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2010.09.20 at 02:02:40 PM MST
-//
-
-package org.eclipse.osee.coverage.event;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.logging.Level;
-import org.eclipse.osee.coverage.internal.Activator;
-import org.eclipse.osee.coverage.model.CoveragePackage;
-import org.eclipse.osee.framework.core.client.ClientSessionManager;
-import org.eclipse.osee.framework.jdk.core.util.GUID;
-import org.eclipse.osee.framework.logging.OseeLog;
-
-public class CoveragePackageEvent {
-
- protected CoverageChange _package;
- protected List<CoverageChange> coverages;
- protected String sessionId;
-
- public CoveragePackageEvent(String coveragePackageName, String coveragePackageGuid, CoverageEventType coverageEventType, String sessionId) {
- _package = new CoverageChange(coveragePackageName, coveragePackageGuid, coverageEventType);
- }
-
- public CoveragePackageEvent(CoveragePackage coveragePackage, CoverageEventType coverageEventType) {
- try {
- this.sessionId = ClientSessionManager.getSessionId();
- } catch (Exception ex) {
- OseeLog.log(Activator.class, Level.SEVERE, "Can't get sessionId", ex);
- this.sessionId = GUID.create();
- }
- _package = new CoverageChange(coveragePackage, coverageEventType);
- }
-
- public CoverageChange getPackage() {
- return _package;
- }
-
- public void setPackage(CoverageChange value) {
- this._package = value;
- }
-
- public List<CoverageChange> getCoverages() {
- if (coverages == null) {
- coverages = new ArrayList<CoverageChange>();
- }
- return this.coverages;
- }
-
- public String getSessionId() {
- return sessionId;
- }
-
- public void setSessionId(String value) {
- this.sessionId = value;
- }
-
-}
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2010.09.20 at 02:02:40 PM MST
+//
+
+package org.eclipse.osee.coverage.event;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.logging.Level;
+import org.eclipse.osee.coverage.internal.Activator;
+import org.eclipse.osee.coverage.model.CoveragePackage;
+import org.eclipse.osee.framework.core.client.ClientSessionManager;
+import org.eclipse.osee.framework.jdk.core.util.GUID;
+import org.eclipse.osee.framework.logging.OseeLog;
+
+public class CoveragePackageEvent {
+
+ protected CoverageChange _package;
+ protected List<CoverageChange> coverages;
+ protected String sessionId;
+
+ public CoveragePackageEvent(String coveragePackageName, String coveragePackageGuid, CoverageEventType coverageEventType, String sessionId) {
+ _package = new CoverageChange(coveragePackageName, coveragePackageGuid, coverageEventType);
+ }
+
+ public CoveragePackageEvent(CoveragePackage coveragePackage, CoverageEventType coverageEventType) {
+ try {
+ this.sessionId = ClientSessionManager.getSessionId();
+ } catch (Exception ex) {
+ OseeLog.log(Activator.class, Level.SEVERE, "Can't get sessionId", ex);
+ this.sessionId = GUID.create();
+ }
+ _package = new CoverageChange(coveragePackage, coverageEventType);
+ }
+
+ public CoverageChange getPackage() {
+ return _package;
+ }
+
+ public void setPackage(CoverageChange value) {
+ this._package = value;
+ }
+
+ public List<CoverageChange> getCoverages() {
+ if (coverages == null) {
+ coverages = new ArrayList<CoverageChange>();
+ }
+ return this.coverages;
+ }
+
+ public String getSessionId() {
+ return sessionId;
+ }
+
+ public void setSessionId(String value) {
+ this.sessionId = value;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/schema/operations/DatabaseDataExtractor.java b/plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/schema/operations/DatabaseDataExtractor.java
index eb857203963..bbdc59a3162 100644
--- a/plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/schema/operations/DatabaseDataExtractor.java
+++ b/plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/schema/operations/DatabaseDataExtractor.java
@@ -226,7 +226,7 @@ public class DatabaseDataExtractor extends AbstractOperation {
private String handleSpecialCharacters(String value) {
// \0 An ASCII 0 (NUL) character.
- // '' A single quote (�'�) character.
+ // '' A single quote character.
// \b A backspace character.
// \n A newline (linefeed) character.
// \r A carriage return character.
diff --git a/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/mock/MockPropertyStore.java b/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/mock/MockPropertyStore.java
index 69bf6226592..d17bc5140af 100644
--- a/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/mock/MockPropertyStore.java
+++ b/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/mock/MockPropertyStore.java
@@ -1,54 +1,54 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.jdk.core.test.mock;
-
-import java.util.Properties;
-import org.eclipse.osee.framework.jdk.core.type.PropertyStore;
-
-/**
- * @author Roberto E. Escobar
- */
-public class MockPropertyStore extends PropertyStore {
-
- private static final long serialVersionUID = 750608597542081776L;
-
- public MockPropertyStore() {
- super();
- }
-
- public MockPropertyStore(String id) {
- super(id);
- }
-
- public MockPropertyStore(Properties properties) {
- super(properties);
- }
-
- @Override
- public void setId(String name) {
- super.setId(name);
- }
-
- @Override
- public Properties getItems() {
- return super.getItems();
- }
-
- @Override
- public Properties getArrays() {
- return super.getArrays();
- }
-
- @Override
- public Properties getPropertyStores() {
- return super.getPropertyStores();
- }
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.framework.jdk.core.test.mock;
+
+import java.util.Properties;
+import org.eclipse.osee.framework.jdk.core.type.PropertyStore;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class MockPropertyStore extends PropertyStore {
+
+ private static final long serialVersionUID = 750608597542081776L;
+
+ public MockPropertyStore() {
+ super();
+ }
+
+ public MockPropertyStore(String id) {
+ super(id);
+ }
+
+ public MockPropertyStore(Properties properties) {
+ super(properties);
+ }
+
+ @Override
+ public void setId(String name) {
+ super.setId(name);
+ }
+
+ @Override
+ public Properties getItems() {
+ return super.getItems();
+ }
+
+ @Override
+ public Properties getArrays() {
+ return super.getArrays();
+ }
+
+ @Override
+ public Properties getPropertyStores() {
+ return super.getPropertyStores();
+ }
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/ReservedCharacters.java b/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/ReservedCharacters.java
index c44da1b2b47..b096db98d38 100644
--- a/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/ReservedCharacters.java
+++ b/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/ReservedCharacters.java
@@ -1,154 +1,154 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.jdk.core.util;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.UnsupportedEncodingException;
-import java.net.URL;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Map.Entry;
-
-/**
- * <pre>
- * Character Entity Name Description
- * &quot; &amp;quot; quotation mark
- * ' &amp;apos; apostrophe
- * &amp; &amp;amp; ampersand
- * &lt; &amp;lt; less-than
- * &gt; &amp;gt; greater-than
- *
- * ISO 8859-1 Symbols
- * Character Entity Name Description
- * &amp;nbsp; non-breaking space
- * ¡ &amp;iexcl inverted exclamation mark
- * ¢ &amp;cent cent
- * ÂŁ &amp;pound pound
- * ¤ &amp;curren currency
- * ÂĄ &amp;yen yen
- * ¦ &amp;brvbar broken vertical bar
- * § &amp;sect section
- * ¨ &amp;uml spacing diaeresis
- * © &amp;copy copyright
- * ÂŞ &amp;ordf feminine ordinal indicator
- * « &amp;laquo angle quotation mark (left)
- * ¬ &amp;not negation
- * ­ &amp;shy soft hyphen
- * ® &amp;reg registered trademark
- * ÂŻ &amp;macr spacing macron
- * ° &amp;deg degree
- * ± &amp;plusmn plus-or-minus
- * ² &amp;sup2 superscript 2
- * Âł &amp;sup3 superscript 3
- * ´ &amp;acute spacing acute
- * µ &amp;micro micro
- * ¶ &amp;para paragraph
- * · &amp;middot middle dot
- * ¸ &amp;cedil spacing cedilla
- * Âą &amp;sup1 superscript 1
- * Âş &amp;ordm masculine ordinal indicator
- * » &amp;raquo angle quotation mark (right)
- * ÂĽ &amp;frac14 fraction 1/4
- * ½ &amp;frac12 fraction 1/2
- * Âľ &amp;frac34 fraction 3/4
- * Âż &amp;iquest inverted question mark
- * Ă— &amp;times multiplication
- * Ă· &amp;divide division
- * </pre>
- *
- * @author Roberto E. Escobar
- */
-public final class ReservedCharacters {
-
- private static Map<String, Character> reservedCharacters = new HashMap<String, Character>();
- private static Map<Character, String> charsToEncoding = new HashMap<Character, String>();
- private static Map<Character, String> xmlEntitiesMap = new HashMap<Character, String>();
- static {
- try {
- loadReservedChars();
- } catch (Exception ex) {
- throw new IllegalStateException(ex);
- }
- xmlEntitiesMap.put('"', "&quot;");
- xmlEntitiesMap.put('\'', "&apos;");
- xmlEntitiesMap.put('&', "&amp;");
- xmlEntitiesMap.put('<', "&lt;");
- xmlEntitiesMap.put('>', "&gt;");
-
- for (Entry<String, Character> entry : reservedCharacters.entrySet()) {
- charsToEncoding.put(entry.getValue(), entry.getKey());
- }
- for (Entry<Character, String> entry : xmlEntitiesMap.entrySet()) {
- charsToEncoding.put(entry.getKey(), entry.getValue());
- reservedCharacters.put(entry.getValue(), entry.getKey());
- }
- }
-
- private static void loadReservedChars() throws UnsupportedEncodingException, IOException {
- BufferedReader reader = null;
- try {
- URL url = ReservedCharacters.class.getResource("ReservedCharacters.txt");
- reader = new BufferedReader(new InputStreamReader(url.openStream(), "UTF-8"));
- String line = null;
- while ((line = reader.readLine()) != null) {
- String[] items = line.split(",\\s*");
- String key = items[0];
- String value = items[1];
- Character charValue = value.charAt(1);
- reservedCharacters.put(key, charValue);
- }
- } finally {
- Lib.close(reader);
- }
- }
-
- private ReservedCharacters() {
- // Utility class
- }
-
- public static String encode(String original) {
- return encode(original, charsToEncoding);
- }
-
- public static String encodeXmlEntities(String original) {
- return encode(original, xmlEntitiesMap);
- }
-
- private static String encode(String original, Map<Character, String> charactersToEntityMap) {
- StringBuilder encodedItem = new StringBuilder();
- for (int index = 0; index < original.length(); index++) {
- char item = original.charAt(index);
- String encode = charactersToEntityMap.get(item);
- if (encode != null) {
- encodedItem.append(encode);
- } else {
- encodedItem.append(item);
- }
- }
- return encodedItem.toString();
- }
-
- public static Character toCharacter(String entity) {
- Character toReturn = null;
- if (Strings.isValid(entity)) {
- entity = entity.trim();
- toReturn = reservedCharacters.get(entity);
- }
- return toReturn;
- }
-
- public static Collection<Character> getChars() {
- return reservedCharacters.values();
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.framework.jdk.core.util;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.UnsupportedEncodingException;
+import java.net.URL;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+
+/**
+ * <pre>
+ * Character Entity Name Description
+ * &quot; &amp;quot; quotation mark
+ * ' &amp;apos; apostrophe
+ * &amp; &amp;amp; ampersand
+ * &lt; &amp;lt; less-than
+ * &gt; &amp;gt; greater-than
+ *
+ * ISO 8859-1 Symbols
+ * Character Entity Name Description
+ * &amp;nbsp; non-breaking space
+ * ¡ &amp;iexcl inverted exclamation mark
+ * ¢ &amp;cent cent
+ * ÂŁ &amp;pound pound
+ * ¤ &amp;curren currency
+ * ÂĄ &amp;yen yen
+ * ¦ &amp;brvbar broken vertical bar
+ * § &amp;sect section
+ * ¨ &amp;uml spacing diaeresis
+ * © &amp;copy copyright
+ * ÂŞ &amp;ordf feminine ordinal indicator
+ * « &amp;laquo angle quotation mark (left)
+ * ¬ &amp;not negation
+ * ­ &amp;shy soft hyphen
+ * ® &amp;reg registered trademark
+ * ÂŻ &amp;macr spacing macron
+ * ° &amp;deg degree
+ * ± &amp;plusmn plus-or-minus
+ * ² &amp;sup2 superscript 2
+ * Âł &amp;sup3 superscript 3
+ * ´ &amp;acute spacing acute
+ * µ &amp;micro micro
+ * ¶ &amp;para paragraph
+ * · &amp;middot middle dot
+ * ¸ &amp;cedil spacing cedilla
+ * Âą &amp;sup1 superscript 1
+ * Âş &amp;ordm masculine ordinal indicator
+ * » &amp;raquo angle quotation mark (right)
+ * ÂĽ &amp;frac14 fraction 1/4
+ * ½ &amp;frac12 fraction 1/2
+ * Âľ &amp;frac34 fraction 3/4
+ * Âż &amp;iquest inverted question mark
+ * Ă— &amp;times multiplication
+ * Ă· &amp;divide division
+ * </pre>
+ *
+ * @author Roberto E. Escobar
+ */
+public final class ReservedCharacters {
+
+ private static Map<String, Character> reservedCharacters = new HashMap<String, Character>();
+ private static Map<Character, String> charsToEncoding = new HashMap<Character, String>();
+ private static Map<Character, String> xmlEntitiesMap = new HashMap<Character, String>();
+ static {
+ try {
+ loadReservedChars();
+ } catch (Exception ex) {
+ throw new IllegalStateException(ex);
+ }
+ xmlEntitiesMap.put('"', "&quot;");
+ xmlEntitiesMap.put('\'', "&apos;");
+ xmlEntitiesMap.put('&', "&amp;");
+ xmlEntitiesMap.put('<', "&lt;");
+ xmlEntitiesMap.put('>', "&gt;");
+
+ for (Entry<String, Character> entry : reservedCharacters.entrySet()) {
+ charsToEncoding.put(entry.getValue(), entry.getKey());
+ }
+ for (Entry<Character, String> entry : xmlEntitiesMap.entrySet()) {
+ charsToEncoding.put(entry.getKey(), entry.getValue());
+ reservedCharacters.put(entry.getValue(), entry.getKey());
+ }
+ }
+
+ private static void loadReservedChars() throws UnsupportedEncodingException, IOException {
+ BufferedReader reader = null;
+ try {
+ URL url = ReservedCharacters.class.getResource("ReservedCharacters.txt");
+ reader = new BufferedReader(new InputStreamReader(url.openStream(), "UTF-8"));
+ String line = null;
+ while ((line = reader.readLine()) != null) {
+ String[] items = line.split(",\\s*");
+ String key = items[0];
+ String value = items[1];
+ Character charValue = value.charAt(1);
+ reservedCharacters.put(key, charValue);
+ }
+ } finally {
+ Lib.close(reader);
+ }
+ }
+
+ private ReservedCharacters() {
+ // Utility class
+ }
+
+ public static String encode(String original) {
+ return encode(original, charsToEncoding);
+ }
+
+ public static String encodeXmlEntities(String original) {
+ return encode(original, xmlEntitiesMap);
+ }
+
+ private static String encode(String original, Map<Character, String> charactersToEntityMap) {
+ StringBuilder encodedItem = new StringBuilder();
+ for (int index = 0; index < original.length(); index++) {
+ char item = original.charAt(index);
+ String encode = charactersToEntityMap.get(item);
+ if (encode != null) {
+ encodedItem.append(encode);
+ } else {
+ encodedItem.append(item);
+ }
+ }
+ return encodedItem.toString();
+ }
+
+ public static Character toCharacter(String entity) {
+ Character toReturn = null;
+ if (Strings.isValid(entity)) {
+ entity = entity.trim();
+ toReturn = reservedCharacters.get(entity);
+ }
+ return toReturn;
+ }
+
+ public static Collection<Character> getChars() {
+ return reservedCharacters.values();
+ }
+}
diff --git a/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/xml/Xml.java b/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/xml/Xml.java
index 6d64f5ea32c..23bb2a1fff3 100644
--- a/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/xml/Xml.java
+++ b/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/xml/Xml.java
@@ -1,464 +1,464 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.jdk.core.util.xml;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.TransformerException;
-import javax.xml.xpath.XPath;
-import javax.xml.xpath.XPathConstants;
-import javax.xml.xpath.XPathExpressionException;
-import javax.xml.xpath.XPathFactory;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.SAXException;
-
-/**
- * @author David Diepenbrock
- * @author Paul K. Waldfogel
- */
-public class Xml {
- private static final String[] XML_CHARS = new String[] {"[&]", "[<]", "[>]", "[\"]"};
- private static final String[] XML_ESCAPES = new String[] {"&amp;", "&lt;", "&gt;", "&quot;"};
- private static final String LINEFEED = "&#10;";
- private static final String CARRIAGE_RETURN = "&#13;";
- private static final Pattern squareBracket = Pattern.compile("\\]");
- public final static XPathFactory myXPathFactory = XPathFactory.newInstance();
- public final static XPath myXPath = myXPathFactory.newXPath();
- public final static String wordLeader1 =
- "<?xml version='1.0' encoding='UTF-8' standalone='yes'?>" + "<?mso-application progid='Word.Document'?>";
- public final static String wordLeader2 =
- "<w:wordDocument xmlns:w='http://schemas.microsoft.com/office/word/2003/wordml' xmlns:v='urn:schemas-microsoft-com:vml' xmlns:w10='urn:schemas-microsoft-com:office:word' xmlns:sl='http://schemas.microsoft.com/schemaLibrary/2003/core' xmlns:aml='http://schemas.microsoft.com/aml/2001/core' xmlns:wx='http://schemas.microsoft.com/office/word/2003/auxHint' xmlns:o='urn:schemas-microsoft-com:office:office' xmlns:dt='uuid:C2F41010-65B3-11d1-A29F-00AA00C14882' xmlns:wsp='http://schemas.microsoft.com/office/word/2003/wordml/sp2' xmlns:ns0='http://www.w3.org/2001/XMLSchema' xmlns:ns1='http://eclipse.org/artifact.xsd' xmlns:st1='urn:schemas-microsoft-com:office:smarttags' w:macrosPresent='no' w:embeddedObjPresent='no' w:ocxPresent='no' xml:space='preserve'>";
- public final static String wordLeader = wordLeader1.concat(wordLeader2);
- public final static String wordBody = "<w:body></w:body>";
- public final static String wordTrailer = "</w:wordDocument> ";
- public final SimpleNamespaceContext mySimpleNamespaceContext = new SimpleNamespaceContext();
- public final static Matcher theFunnyQuoteMatcher = Pattern.compile("ďż˝").matcher("");
-
- /**
- * TODO Optimize algorithm
- *
- * @return Returns a string with entity reference characters unescaped.
- */
- public static StringBuilder unescape(String text) {
- StringBuilder strB = new StringBuilder();
- int startIndex, endIndex;
- char chr;
-
- for (int index = 0; index < text.length(); index++) {
- chr = text.charAt(index);
- if (chr == '&') {
- startIndex = index;
- endIndex = text.indexOf(';', startIndex) + 1;
- if (endIndex > startIndex && endIndex < startIndex + 6) {
- String entityReference = text.substring(startIndex, endIndex);
- if (entityReference.equals("&amp;")) {
- strB.append('&');
- } else if (entityReference.equals("&lt;")) {
- strB.append('<');
- } else if (entityReference.equals("&gt;")) {
- strB.append('>');
- } else if (entityReference.equals("&nbsp;")) {
- strB.append(' ');
- } else if (entityReference.equals("&quot;")) {
- strB.append('"');
- } else {
- throw new IllegalArgumentException(
- "unknown entity reference: " + text.substring(startIndex, endIndex));
- }
- index = endIndex - 1;
- } else {
- strB.append(chr);
- }
- } else {
- strB.append(chr);
- }
- }
- return strB;
- }
-
- /**
- * TODO Optimize algorithm
- *
- * @return Returns a string with entity reference characters escaped.
- */
- public static CharSequence escape(CharSequence text) {
- String textString = text.toString();
- for (int x = 0; x < XML_CHARS.length; x++) {
- textString = textString.replaceAll(XML_CHARS[x], XML_ESCAPES[x]);
- }
-
- return textString;
- }
-
- public static void writeAsCdata(Appendable appendable, String string) throws IOException {
- if (string.indexOf('<') == -1 && string.indexOf('&') == -1 && string.indexOf("]]>") == -1) {
- writeData(appendable, string);
- } else {
- if (string.indexOf(']') == -1) {
- writeCdata(appendable, string);
- } else {
- // work around bug in excel xml parsing that thinks a single ] closes CDATA
- String[] tokens = squareBracket.split(string);
- for (int i = 0; i < tokens.length; i++) {
- writeCdata(appendable, tokens[i]);
- if (i != tokens.length - 1) { // the last token would not have been followed by ]
- appendable.append(']');
- }
- }
- }
- }
- }
-
- private static void writeCdata(Appendable appendable, String content) throws IOException {
- appendable.append("<![CDATA[");
- appendable.append(content);
- appendable.append("]]>");
- }
-
- private static void writeData(Appendable appendable, String string) throws IOException {
- for (int index = 0; index < string.length(); index++) {
- char value = string.charAt(index);
- if (value == '\r') {
- appendable.append(CARRIAGE_RETURN);
- } else if (value == '\n') {
- appendable.append(LINEFEED);
- } else {
- appendable.append(value);
- }
- }
- }
-
- public static String treatNonUTF8Characters(String contentString) {
- String resultString = contentString;
- String[][] nonUTF8CharactersOfInterest = { {"ďż˝", "-"}, {"ďż˝", "'"}, {"ďż˝", "'"}, {"ďż˝", "\""}, {"ďż˝", "\""}};//Wider than usual dash , smaller than usual bullet
- for (int i = 0; i < nonUTF8CharactersOfInterest.length; i++) {
- String[] splitsOfNonUTF8 = resultString.split(nonUTF8CharactersOfInterest[i][0]);//Wider than usual dash or bullet
- if (splitsOfNonUTF8.length > 1) {
- StringBuffer myStringBuffer = new StringBuffer();
- for (int j = 0; j < splitsOfNonUTF8.length; j++) {
- myStringBuffer.append(splitsOfNonUTF8[j]);
- if (splitsOfNonUTF8[j].length() > 0 && j < splitsOfNonUTF8.length - 1) {
- myStringBuffer.append(nonUTF8CharactersOfInterest[i][1]);
- }
- }
- resultString = myStringBuffer.toString();
- }
- }
- String[] splits = resultString.split("[^\\p{Space}\\p{Graph}]");
- int stringPosition = 0;
- if (splits.length > 1) {
- StringBuffer myStringBuffer = new StringBuffer();
- for (int i = 0; i < splits.length; i++) {
- stringPosition = stringPosition + splits[i].length();
- myStringBuffer.append(splits[i]);
- stringPosition = stringPosition + 1;
- if (splits[i].length() > 0 && i < splits.length - 1) {
- myStringBuffer.append("-");
- }
- }
- resultString = myStringBuffer.toString();
- }
-
- return resultString;
- }
-
- public static final Element appendNewElementWithText(Node parentNode, String newElementTagName, String newText) {
- Element newElement = null;
- try {
- Document ownerDocument =
- parentNode.getNodeType() == Node.DOCUMENT_NODE ? (Document) parentNode : parentNode.getOwnerDocument();
- newElement = ownerDocument.createElement(newElementTagName);
- parentNode.appendChild(newElement);
- if (newText != null) {
- Node newTextNode = ownerDocument.createTextNode(newText);
- newElement.appendChild(newTextNode);
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- ;
- return newElement;
- }
-
- public static final Element appendNewElementWithTextCData(Node parentNode, String newElementTagName, String newText) {
- Element newElement = null;
- try {
- Document ownerDocument =
- parentNode.getNodeType() == Node.DOCUMENT_NODE ? (Document) parentNode : parentNode.getOwnerDocument();
- newElement = ownerDocument.createElement(newElementTagName);
- parentNode.appendChild(newElement);
- if (newText != null) {
- Node newTextNode = ownerDocument.createCDATASection(newText);
- newElement.appendChild(newTextNode);
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- ;
- return newElement;
- }
-
- public static final Element appendNewElementWithTextAndAttributes(Node parentNode, String newElementTagName, String newText, String[][] attributes) {
- Element newElement = null;
- try {
- Document ownerDocument =
- parentNode.getNodeType() == Node.DOCUMENT_NODE ? (Document) parentNode : parentNode.getOwnerDocument();
- newElement = ownerDocument.createElement(newElementTagName);
- parentNode.appendChild(newElement);
- if (newText != null) {
- Node newTextNode = ownerDocument.createTextNode(newText);
- newElement.appendChild(newTextNode);
- }
- if (attributes != null) {
- for (String[] attribute : attributes) {
- newElement.setAttribute(attribute[0], attribute[1]);
- }
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- return newElement;
- }
-
- public static final Element[] appendNewElementsWithText(Node parentNode, String newElementsTagName, String[] textInstances) {
- Element[] newElements = null;
- try {
- if (textInstances != null) {
- newElements = new Element[textInstances.length];
- Document ownerDocument =
- parentNode.getNodeType() == Node.DOCUMENT_NODE ? (Document) parentNode : parentNode.getOwnerDocument();
- for (int i = 0; i < textInstances.length; i++) {
- newElements[i] = ownerDocument.createElement(newElementsTagName);
- parentNode.appendChild(newElements[i]);
- String textInstance = textInstances[i] == null ? "null" : textInstances[i];
- textInstance = textInstance.length() == 0 ? "null" : textInstance;
- newElements[i].appendChild(ownerDocument.createTextNode(textInstance));
- }
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- return newElements;
- }
-
- public static final Element appendNewElementWithTextAndOneAttribute(Node parentNode, String newElementTagName, String newText, String attributeName, String attributeValue) {
- Element newElement = null;
- try {
- newElement = appendNewElementWithText(parentNode, newElementTagName, newText);
- newElement.setAttribute(attributeName, attributeValue);
- } catch (Exception e) {
- e.printStackTrace();
- }
- ;
- return newElement;
- }
-
- public final static String restartNumberingWhenPreparingToEditWithWord(InputStream myInputStream) throws XPathExpressionException, ParserConfigurationException, TransformerException, SAXException, IOException {
- SimpleNamespaceContext mySimpleNamespaceContext = new SimpleNamespaceContext();
- addNamespacesForWordMarkupLanguage(myXPath, mySimpleNamespaceContext);
- Document myDocument = Jaxp.readXmlDocumentNamespaceAware(myInputStream);
- Element myDocumentElement = myDocument.getDocumentElement();
- Node[] myListss = selectNodeList(myDocumentElement, "descendant::w:lists");
- Node[] myLists = selectNodeList(myDocumentElement, "descendant::w:lists/w:list");
- if (myLists.length > 0 && myListss.length > 0) {
- Node[] mywilfo = selectNodeList(myLists[myLists.length - 1], "@w:ilfo");
- if (mywilfo.length > 0) {
- String myLastUsedListInitializeListFormat = mywilfo[0].getNodeValue();//
- int myNextILFO = Integer.parseInt(myLastUsedListInitializeListFormat);
- Node[] myListDefinition =
- selectNodeList(myDocumentElement,
- "descendant::w:listDef[child::w:lvl[1]/w:pStyle/@w:val = 'listlvl1'][1]");//<w:pStyle w:val="listlvl1"/>
- if (myListDefinition.length > 0) {
- String mylistDefaultID = selectNodeList(myListDefinition[0], "@w:listDefId")[0].getNodeValue();
- Node[] myWord_Formatted_Contents = selectNodeList(myDocument, "descendant::ns1:Word_Formatted_Content");
- for (int i = 0; i < myWord_Formatted_Contents.length; i++) {
- Node[] myPStyles =
- selectNodeList(myWord_Formatted_Contents[i],
- "descendant::w:pPr[child::w:pStyle[@w:val = 'listlvl1']]");
- for (int j = 0; j < Math.min(1, myPStyles.length); j++) {
- Node[] myListProperties = selectNodeList(myPStyles[j], "child::w:listPr");
- if (myListProperties.length > 0) {
- myNextILFO++;
- Element newWList =
- appendNewElementWithTextAndOneAttribute(myListss[0], "w:list", null, "w:ilfo",
- "" + myNextILFO);
- appendNewElementWithTextAndOneAttribute(newWList, "w:ilst", null, "w:val", mylistDefaultID);
- Element new_lvlOverride =
- appendNewElementWithTextAndOneAttribute(newWList, "w:lvlOverride", null, "w:ilvl", "0");
- appendNewElementWithTextAndOneAttribute(new_lvlOverride, "w:startOverride", null, "w:val", "1");
- appendNewElementWithTextAndOneAttribute(myListProperties[0], "w:ilvl", null, "w:val", "0");
- appendNewElementWithTextAndOneAttribute(myListProperties[0], "w:ilfo", null, "w:val",
- "" + myNextILFO);
- }
- }
- }
- }
- }
- }
- String myString = Jaxp.xmlToString(myDocument, Jaxp.getPrettyFormat(myDocument));
- return myString;
- }
-
- public static Document readWordFormattedContent(String myInputString) throws IOException, ParserConfigurationException, SAXException {
- Document myDocument = null;
- myDocument = Jaxp.readXmlDocumentNamespaceAware(wordLeader.concat(myInputString).concat(wordTrailer));
- return myDocument;
- }
-
- public static final Object addNamespacesForWordMarkupLanguage(XPath myXPath, SimpleNamespaceContext mySimpleNamespaceContext) {
- try {
- if (myXPath.getNamespaceContext() == null) {
- mySimpleNamespaceContext.addNamespace("w", "http://schemas.microsoft.com/office/word/2003/wordml");
- mySimpleNamespaceContext.addNamespace("wx", "http://schemas.microsoft.com/office/word/2003/auxHint");
- mySimpleNamespaceContext.addNamespace("o", "urn:schemas-microsoft-com:office:office");
- mySimpleNamespaceContext.addNamespace("v", "urn:schemas-microsoft-com:vml");
- mySimpleNamespaceContext.addNamespace("aml", "http://schemas.microsoft.com/aml/2001/core");
- mySimpleNamespaceContext.addNamespace("dt", "uuid:C2F41010-65B3-11d1-A29F-00AA00C14882");
- mySimpleNamespaceContext.addNamespace("ns0", "http://www.w3.org/2001/XMLSchema");
- mySimpleNamespaceContext.addNamespace("ns1", "http://eclipse.org/artifact.xsd");
- mySimpleNamespaceContext.addNamespace("ns2", "urn:schemas-microsoft-com:office:smarttags");
- mySimpleNamespaceContext.addNamespace("sl", "http://schemas.microsoft.com/schemaLibrary/2003/core");
- mySimpleNamespaceContext.addNamespace("st0", "urn:schemas-microsoft-com:office:smarttags");
- mySimpleNamespaceContext.addNamespace("st1", "urn:schemas-microsoft-com:office:smarttags");
- mySimpleNamespaceContext.addNamespace("st2", "urn:schemas-microsoft-com:office:smarttags");
- mySimpleNamespaceContext.addNamespace("st3", "urn:schemas-microsoft-com:office:smarttags");
- mySimpleNamespaceContext.addNamespace("st4", "urn:schemas-microsoft-com:office:smarttags");
- mySimpleNamespaceContext.addNamespace("w10", "urn:schemas-microsoft-com:office:word");
- mySimpleNamespaceContext.addNamespace("wsp", "http://schemas.microsoft.com/office/word/2003/wordml/sp2");
- mySimpleNamespaceContext.addNamespace("foo", "http://apache.org/foo");
- mySimpleNamespaceContext.addNamespace("bar", "http://apache.org/bar");
- myXPath.setNamespaceContext(mySimpleNamespaceContext);
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- return null;
- }
-
- public static final boolean isSeriousXPath(String xPathExpression) {
- return xPathExpression.indexOf("[") > -1 || xPathExpression.indexOf("]") > -1 || xPathExpression.indexOf("(") > -1 || xPathExpression.indexOf(")") > -1 || xPathExpression.indexOf(":") > -1;
- }
-
- public static final Node[] selectNodeList(Node startingNode, String xPathExpression) throws XPathExpressionException {
- Node[] resultNodes = null;
- if (!isSeriousXPath(xPathExpression) && startingNode.getNodeType() == Node.ELEMENT_NODE) {
- List<Element> resultElementList = Jaxp.findElements((Element) startingNode, xPathExpression);
- resultNodes = resultElementList.toArray(new Node[0]);
- } else {
- Object publisherNodeSet = null;
- publisherNodeSet = myXPath.evaluate(xPathExpression, startingNode, XPathConstants.NODESET);
-
- NodeList myNodeList = (NodeList) publisherNodeSet;
- resultNodes = new Node[myNodeList.getLength()];
- for (int i = 0; i < resultNodes.length; i++) {
- resultNodes[i] = myNodeList.item(i);
- }
- }
- return resultNodes;
- }
-
- public static final String selectNodesText(Node startingNode, String xPathExpression) throws XPathExpressionException {
- String resultString = null;
- if (!isSeriousXPath(xPathExpression) && startingNode.getNodeType() == Node.ELEMENT_NODE) {
- Element foundElement = Jaxp.findElement((Element) startingNode, xPathExpression);
- if (foundElement != null) {
- resultString = selectNodesText(foundElement).trim();
- }
- } else {
- Node[] selectedNodes = selectNodeList(startingNode, xPathExpression);
- if (selectedNodes.length > 0) {
- resultString = selectNodesText(selectedNodes[0]).trim();
- }
- }
- return resultString;
- }
-
- public static final String selectNodesText(Node startingNode) {
- StringBuffer resultStringBuffer = new StringBuffer();
- NodeList childNodes = startingNode.getChildNodes();
- for (int i = 0; i < childNodes.getLength(); i++) {
- if (childNodes.item(i).getNodeType() == Node.CDATA_SECTION_NODE || childNodes.item(i).getNodeType() == Node.TEXT_NODE) {
- resultStringBuffer.append(childNodes.item(i).getNodeValue().trim());
- }
- }
- return resultStringBuffer.toString();
- }
-
- public static final Element makeTable(Element parentDivElement, String caption, String[][] columnDescriptors) {
- Element newTableElement =
- appendNewElementWithTextAndAttributes(parentDivElement, "table", null, new String[][] {
- {"border", "1"},
- {"cellpadding", "3"},
- {"cellspacing", "0"},
- {"width", "100%"}});
- appendNewElementWithText(newTableElement, "caption", caption);
- Element columnGroupElement =
- appendNewElementWithTextAndAttributes(newTableElement, "colgroup", null, new String[][] {{"align", "left"}});
- String[] columnNames = new String[columnDescriptors.length];
- for (int i = 0; i < columnDescriptors.length; i++) {
- columnNames[i] = columnDescriptors[i][0];
- appendNewElementWithTextAndAttributes(columnGroupElement, "col", null, new String[][] {{
- "width",
- columnDescriptors[i][1]}});//width,33
- }
- Element headingTableRowElement = appendNewElementWithText(newTableElement, "tr", null);
- appendNewElementsWithText(headingTableRowElement, "th", columnNames);
- return newTableElement;
- }
-
- public static final Element[] makeDivElementAndTableElement(Element parentDivElement, String caption, String[][] columnDescriptors) {
- Element[] divAndTableElements =
- new Element[] {parentDivElement, parentDivElement.getOwnerDocument().createElement("div"), null};
- divAndTableElements[2] = makeTable(divAndTableElements[1], caption, columnDescriptors);
- return divAndTableElements;
- }
-
- public static final Element[] makeTableRow(Element[] devAndTableElements, String[] cellContents) {
- Element nextRow = Xml.appendNewElementWithText(devAndTableElements[2], "tr", null);
- appendNewElementsWithText(nextRow, "td", cellContents);
- return devAndTableElements;
- }
-
- public static final Element makeTableRow(Element[] devAndTableElements, String[][] cellContentsAndStyle) {
- Element nextRow = Xml.appendNewElementWithText(devAndTableElements[2], "tr", null);
- for (String[] cellContentsAndStyleArray : cellContentsAndStyle) {
- if (cellContentsAndStyleArray.length > 1) {
- appendNewElementWithTextAndOneAttribute(nextRow, "td", cellContentsAndStyleArray[0],
- cellContentsAndStyleArray[1], cellContentsAndStyleArray[2]);
- } else {
- appendNewElementsWithText(nextRow, "td", new String[] {cellContentsAndStyleArray[0]});
- }
- }
- return nextRow;
- }
-
- public static final Node writePrettyXML(Node aNode, File resultXmlFile) {
- try {
- Node[] notUTF8Nodes = Xml.selectNodeList(aNode, "descendant::text()[contains(.,'ďż˝')]");
- for (int i = 0; i < notUTF8Nodes.length; i++) {
- notUTF8Nodes[i].setNodeValue(theFunnyQuoteMatcher.reset(notUTF8Nodes[i].getNodeValue()).replaceAll("'"));
- }
- Jaxp.writeXmlDocument(aNode.getOwnerDocument(), resultXmlFile, Jaxp.getPrettyFormat(aNode.getOwnerDocument()));
- } catch (Exception e) {
- e.printStackTrace();
- }
- return aNode;
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.framework.jdk.core.util.xml;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.TransformerException;
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathConstants;
+import javax.xml.xpath.XPathExpressionException;
+import javax.xml.xpath.XPathFactory;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+/**
+ * @author David Diepenbrock
+ * @author Paul K. Waldfogel
+ */
+public class Xml {
+ private static final String[] XML_CHARS = new String[] {"[&]", "[<]", "[>]", "[\"]"};
+ private static final String[] XML_ESCAPES = new String[] {"&amp;", "&lt;", "&gt;", "&quot;"};
+ private static final String LINEFEED = "&#10;";
+ private static final String CARRIAGE_RETURN = "&#13;";
+ private static final Pattern squareBracket = Pattern.compile("\\]");
+ public final static XPathFactory myXPathFactory = XPathFactory.newInstance();
+ public final static XPath myXPath = myXPathFactory.newXPath();
+ public final static String wordLeader1 =
+ "<?xml version='1.0' encoding='UTF-8' standalone='yes'?>" + "<?mso-application progid='Word.Document'?>";
+ public final static String wordLeader2 =
+ "<w:wordDocument xmlns:w='http://schemas.microsoft.com/office/word/2003/wordml' xmlns:v='urn:schemas-microsoft-com:vml' xmlns:w10='urn:schemas-microsoft-com:office:word' xmlns:sl='http://schemas.microsoft.com/schemaLibrary/2003/core' xmlns:aml='http://schemas.microsoft.com/aml/2001/core' xmlns:wx='http://schemas.microsoft.com/office/word/2003/auxHint' xmlns:o='urn:schemas-microsoft-com:office:office' xmlns:dt='uuid:C2F41010-65B3-11d1-A29F-00AA00C14882' xmlns:wsp='http://schemas.microsoft.com/office/word/2003/wordml/sp2' xmlns:ns0='http://www.w3.org/2001/XMLSchema' xmlns:ns1='http://eclipse.org/artifact.xsd' xmlns:st1='urn:schemas-microsoft-com:office:smarttags' w:macrosPresent='no' w:embeddedObjPresent='no' w:ocxPresent='no' xml:space='preserve'>";
+ public final static String wordLeader = wordLeader1.concat(wordLeader2);
+ public final static String wordBody = "<w:body></w:body>";
+ public final static String wordTrailer = "</w:wordDocument> ";
+ public final SimpleNamespaceContext mySimpleNamespaceContext = new SimpleNamespaceContext();
+ public final static Matcher theFunnyQuoteMatcher = Pattern.compile("ďż˝").matcher("");
+
+ /**
+ * TODO Optimize algorithm
+ *
+ * @return Returns a string with entity reference characters unescaped.
+ */
+ public static StringBuilder unescape(String text) {
+ StringBuilder strB = new StringBuilder();
+ int startIndex, endIndex;
+ char chr;
+
+ for (int index = 0; index < text.length(); index++) {
+ chr = text.charAt(index);
+ if (chr == '&') {
+ startIndex = index;
+ endIndex = text.indexOf(';', startIndex) + 1;
+ if (endIndex > startIndex && endIndex < startIndex + 6) {
+ String entityReference = text.substring(startIndex, endIndex);
+ if (entityReference.equals("&amp;")) {
+ strB.append('&');
+ } else if (entityReference.equals("&lt;")) {
+ strB.append('<');
+ } else if (entityReference.equals("&gt;")) {
+ strB.append('>');
+ } else if (entityReference.equals("&nbsp;")) {
+ strB.append(' ');
+ } else if (entityReference.equals("&quot;")) {
+ strB.append('"');
+ } else {
+ throw new IllegalArgumentException(
+ "unknown entity reference: " + text.substring(startIndex, endIndex));
+ }
+ index = endIndex - 1;
+ } else {
+ strB.append(chr);
+ }
+ } else {
+ strB.append(chr);
+ }
+ }
+ return strB;
+ }
+
+ /**
+ * TODO Optimize algorithm
+ *
+ * @return Returns a string with entity reference characters escaped.
+ */
+ public static CharSequence escape(CharSequence text) {
+ String textString = text.toString();
+ for (int x = 0; x < XML_CHARS.length; x++) {
+ textString = textString.replaceAll(XML_CHARS[x], XML_ESCAPES[x]);
+ }
+
+ return textString;
+ }
+
+ public static void writeAsCdata(Appendable appendable, String string) throws IOException {
+ if (string.indexOf('<') == -1 && string.indexOf('&') == -1 && string.indexOf("]]>") == -1) {
+ writeData(appendable, string);
+ } else {
+ if (string.indexOf(']') == -1) {
+ writeCdata(appendable, string);
+ } else {
+ // work around bug in excel xml parsing that thinks a single ] closes CDATA
+ String[] tokens = squareBracket.split(string);
+ for (int i = 0; i < tokens.length; i++) {
+ writeCdata(appendable, tokens[i]);
+ if (i != tokens.length - 1) { // the last token would not have been followed by ]
+ appendable.append(']');
+ }
+ }
+ }
+ }
+ }
+
+ private static void writeCdata(Appendable appendable, String content) throws IOException {
+ appendable.append("<![CDATA[");
+ appendable.append(content);
+ appendable.append("]]>");
+ }
+
+ private static void writeData(Appendable appendable, String string) throws IOException {
+ for (int index = 0; index < string.length(); index++) {
+ char value = string.charAt(index);
+ if (value == '\r') {
+ appendable.append(CARRIAGE_RETURN);
+ } else if (value == '\n') {
+ appendable.append(LINEFEED);
+ } else {
+ appendable.append(value);
+ }
+ }
+ }
+
+ public static String treatNonUTF8Characters(String contentString) {
+ String resultString = contentString;
+ String[][] nonUTF8CharactersOfInterest = { {"ďż˝", "-"}, {"ďż˝", "'"}, {"ďż˝", "'"}, {"ďż˝", "\""}, {"ďż˝", "\""}};//Wider than usual dash , smaller than usual bullet
+ for (int i = 0; i < nonUTF8CharactersOfInterest.length; i++) {
+ String[] splitsOfNonUTF8 = resultString.split(nonUTF8CharactersOfInterest[i][0]);//Wider than usual dash or bullet
+ if (splitsOfNonUTF8.length > 1) {
+ StringBuffer myStringBuffer = new StringBuffer();
+ for (int j = 0; j < splitsOfNonUTF8.length; j++) {
+ myStringBuffer.append(splitsOfNonUTF8[j]);
+ if (splitsOfNonUTF8[j].length() > 0 && j < splitsOfNonUTF8.length - 1) {
+ myStringBuffer.append(nonUTF8CharactersOfInterest[i][1]);
+ }
+ }
+ resultString = myStringBuffer.toString();
+ }
+ }
+ String[] splits = resultString.split("[^\\p{Space}\\p{Graph}]");
+ int stringPosition = 0;
+ if (splits.length > 1) {
+ StringBuffer myStringBuffer = new StringBuffer();
+ for (int i = 0; i < splits.length; i++) {
+ stringPosition = stringPosition + splits[i].length();
+ myStringBuffer.append(splits[i]);
+ stringPosition = stringPosition + 1;
+ if (splits[i].length() > 0 && i < splits.length - 1) {
+ myStringBuffer.append("-");
+ }
+ }
+ resultString = myStringBuffer.toString();
+ }
+
+ return resultString;
+ }
+
+ public static final Element appendNewElementWithText(Node parentNode, String newElementTagName, String newText) {
+ Element newElement = null;
+ try {
+ Document ownerDocument =
+ parentNode.getNodeType() == Node.DOCUMENT_NODE ? (Document) parentNode : parentNode.getOwnerDocument();
+ newElement = ownerDocument.createElement(newElementTagName);
+ parentNode.appendChild(newElement);
+ if (newText != null) {
+ Node newTextNode = ownerDocument.createTextNode(newText);
+ newElement.appendChild(newTextNode);
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ ;
+ return newElement;
+ }
+
+ public static final Element appendNewElementWithTextCData(Node parentNode, String newElementTagName, String newText) {
+ Element newElement = null;
+ try {
+ Document ownerDocument =
+ parentNode.getNodeType() == Node.DOCUMENT_NODE ? (Document) parentNode : parentNode.getOwnerDocument();
+ newElement = ownerDocument.createElement(newElementTagName);
+ parentNode.appendChild(newElement);
+ if (newText != null) {
+ Node newTextNode = ownerDocument.createCDATASection(newText);
+ newElement.appendChild(newTextNode);
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ ;
+ return newElement;
+ }
+
+ public static final Element appendNewElementWithTextAndAttributes(Node parentNode, String newElementTagName, String newText, String[][] attributes) {
+ Element newElement = null;
+ try {
+ Document ownerDocument =
+ parentNode.getNodeType() == Node.DOCUMENT_NODE ? (Document) parentNode : parentNode.getOwnerDocument();
+ newElement = ownerDocument.createElement(newElementTagName);
+ parentNode.appendChild(newElement);
+ if (newText != null) {
+ Node newTextNode = ownerDocument.createTextNode(newText);
+ newElement.appendChild(newTextNode);
+ }
+ if (attributes != null) {
+ for (String[] attribute : attributes) {
+ newElement.setAttribute(attribute[0], attribute[1]);
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return newElement;
+ }
+
+ public static final Element[] appendNewElementsWithText(Node parentNode, String newElementsTagName, String[] textInstances) {
+ Element[] newElements = null;
+ try {
+ if (textInstances != null) {
+ newElements = new Element[textInstances.length];
+ Document ownerDocument =
+ parentNode.getNodeType() == Node.DOCUMENT_NODE ? (Document) parentNode : parentNode.getOwnerDocument();
+ for (int i = 0; i < textInstances.length; i++) {
+ newElements[i] = ownerDocument.createElement(newElementsTagName);
+ parentNode.appendChild(newElements[i]);
+ String textInstance = textInstances[i] == null ? "null" : textInstances[i];
+ textInstance = textInstance.length() == 0 ? "null" : textInstance;
+ newElements[i].appendChild(ownerDocument.createTextNode(textInstance));
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return newElements;
+ }
+
+ public static final Element appendNewElementWithTextAndOneAttribute(Node parentNode, String newElementTagName, String newText, String attributeName, String attributeValue) {
+ Element newElement = null;
+ try {
+ newElement = appendNewElementWithText(parentNode, newElementTagName, newText);
+ newElement.setAttribute(attributeName, attributeValue);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ ;
+ return newElement;
+ }
+
+ public final static String restartNumberingWhenPreparingToEditWithWord(InputStream myInputStream) throws XPathExpressionException, ParserConfigurationException, TransformerException, SAXException, IOException {
+ SimpleNamespaceContext mySimpleNamespaceContext = new SimpleNamespaceContext();
+ addNamespacesForWordMarkupLanguage(myXPath, mySimpleNamespaceContext);
+ Document myDocument = Jaxp.readXmlDocumentNamespaceAware(myInputStream);
+ Element myDocumentElement = myDocument.getDocumentElement();
+ Node[] myListss = selectNodeList(myDocumentElement, "descendant::w:lists");
+ Node[] myLists = selectNodeList(myDocumentElement, "descendant::w:lists/w:list");
+ if (myLists.length > 0 && myListss.length > 0) {
+ Node[] mywilfo = selectNodeList(myLists[myLists.length - 1], "@w:ilfo");
+ if (mywilfo.length > 0) {
+ String myLastUsedListInitializeListFormat = mywilfo[0].getNodeValue();//
+ int myNextILFO = Integer.parseInt(myLastUsedListInitializeListFormat);
+ Node[] myListDefinition =
+ selectNodeList(myDocumentElement,
+ "descendant::w:listDef[child::w:lvl[1]/w:pStyle/@w:val = 'listlvl1'][1]");//<w:pStyle w:val="listlvl1"/>
+ if (myListDefinition.length > 0) {
+ String mylistDefaultID = selectNodeList(myListDefinition[0], "@w:listDefId")[0].getNodeValue();
+ Node[] myWord_Formatted_Contents = selectNodeList(myDocument, "descendant::ns1:Word_Formatted_Content");
+ for (int i = 0; i < myWord_Formatted_Contents.length; i++) {
+ Node[] myPStyles =
+ selectNodeList(myWord_Formatted_Contents[i],
+ "descendant::w:pPr[child::w:pStyle[@w:val = 'listlvl1']]");
+ for (int j = 0; j < Math.min(1, myPStyles.length); j++) {
+ Node[] myListProperties = selectNodeList(myPStyles[j], "child::w:listPr");
+ if (myListProperties.length > 0) {
+ myNextILFO++;
+ Element newWList =
+ appendNewElementWithTextAndOneAttribute(myListss[0], "w:list", null, "w:ilfo",
+ "" + myNextILFO);
+ appendNewElementWithTextAndOneAttribute(newWList, "w:ilst", null, "w:val", mylistDefaultID);
+ Element new_lvlOverride =
+ appendNewElementWithTextAndOneAttribute(newWList, "w:lvlOverride", null, "w:ilvl", "0");
+ appendNewElementWithTextAndOneAttribute(new_lvlOverride, "w:startOverride", null, "w:val", "1");
+ appendNewElementWithTextAndOneAttribute(myListProperties[0], "w:ilvl", null, "w:val", "0");
+ appendNewElementWithTextAndOneAttribute(myListProperties[0], "w:ilfo", null, "w:val",
+ "" + myNextILFO);
+ }
+ }
+ }
+ }
+ }
+ }
+ String myString = Jaxp.xmlToString(myDocument, Jaxp.getPrettyFormat(myDocument));
+ return myString;
+ }
+
+ public static Document readWordFormattedContent(String myInputString) throws IOException, ParserConfigurationException, SAXException {
+ Document myDocument = null;
+ myDocument = Jaxp.readXmlDocumentNamespaceAware(wordLeader.concat(myInputString).concat(wordTrailer));
+ return myDocument;
+ }
+
+ public static final Object addNamespacesForWordMarkupLanguage(XPath myXPath, SimpleNamespaceContext mySimpleNamespaceContext) {
+ try {
+ if (myXPath.getNamespaceContext() == null) {
+ mySimpleNamespaceContext.addNamespace("w", "http://schemas.microsoft.com/office/word/2003/wordml");
+ mySimpleNamespaceContext.addNamespace("wx", "http://schemas.microsoft.com/office/word/2003/auxHint");
+ mySimpleNamespaceContext.addNamespace("o", "urn:schemas-microsoft-com:office:office");
+ mySimpleNamespaceContext.addNamespace("v", "urn:schemas-microsoft-com:vml");
+ mySimpleNamespaceContext.addNamespace("aml", "http://schemas.microsoft.com/aml/2001/core");
+ mySimpleNamespaceContext.addNamespace("dt", "uuid:C2F41010-65B3-11d1-A29F-00AA00C14882");
+ mySimpleNamespaceContext.addNamespace("ns0", "http://www.w3.org/2001/XMLSchema");
+ mySimpleNamespaceContext.addNamespace("ns1", "http://eclipse.org/artifact.xsd");
+ mySimpleNamespaceContext.addNamespace("ns2", "urn:schemas-microsoft-com:office:smarttags");
+ mySimpleNamespaceContext.addNamespace("sl", "http://schemas.microsoft.com/schemaLibrary/2003/core");
+ mySimpleNamespaceContext.addNamespace("st0", "urn:schemas-microsoft-com:office:smarttags");
+ mySimpleNamespaceContext.addNamespace("st1", "urn:schemas-microsoft-com:office:smarttags");
+ mySimpleNamespaceContext.addNamespace("st2", "urn:schemas-microsoft-com:office:smarttags");
+ mySimpleNamespaceContext.addNamespace("st3", "urn:schemas-microsoft-com:office:smarttags");
+ mySimpleNamespaceContext.addNamespace("st4", "urn:schemas-microsoft-com:office:smarttags");
+ mySimpleNamespaceContext.addNamespace("w10", "urn:schemas-microsoft-com:office:word");
+ mySimpleNamespaceContext.addNamespace("wsp", "http://schemas.microsoft.com/office/word/2003/wordml/sp2");
+ mySimpleNamespaceContext.addNamespace("foo", "http://apache.org/foo");
+ mySimpleNamespaceContext.addNamespace("bar", "http://apache.org/bar");
+ myXPath.setNamespaceContext(mySimpleNamespaceContext);
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ public static final boolean isSeriousXPath(String xPathExpression) {
+ return xPathExpression.indexOf("[") > -1 || xPathExpression.indexOf("]") > -1 || xPathExpression.indexOf("(") > -1 || xPathExpression.indexOf(")") > -1 || xPathExpression.indexOf(":") > -1;
+ }
+
+ public static final Node[] selectNodeList(Node startingNode, String xPathExpression) throws XPathExpressionException {
+ Node[] resultNodes = null;
+ if (!isSeriousXPath(xPathExpression) && startingNode.getNodeType() == Node.ELEMENT_NODE) {
+ List<Element> resultElementList = Jaxp.findElements((Element) startingNode, xPathExpression);
+ resultNodes = resultElementList.toArray(new Node[0]);
+ } else {
+ Object publisherNodeSet = null;
+ publisherNodeSet = myXPath.evaluate(xPathExpression, startingNode, XPathConstants.NODESET);
+
+ NodeList myNodeList = (NodeList) publisherNodeSet;
+ resultNodes = new Node[myNodeList.getLength()];
+ for (int i = 0; i < resultNodes.length; i++) {
+ resultNodes[i] = myNodeList.item(i);
+ }
+ }
+ return resultNodes;
+ }
+
+ public static final String selectNodesText(Node startingNode, String xPathExpression) throws XPathExpressionException {
+ String resultString = null;
+ if (!isSeriousXPath(xPathExpression) && startingNode.getNodeType() == Node.ELEMENT_NODE) {
+ Element foundElement = Jaxp.findElement((Element) startingNode, xPathExpression);
+ if (foundElement != null) {
+ resultString = selectNodesText(foundElement).trim();
+ }
+ } else {
+ Node[] selectedNodes = selectNodeList(startingNode, xPathExpression);
+ if (selectedNodes.length > 0) {
+ resultString = selectNodesText(selectedNodes[0]).trim();
+ }
+ }
+ return resultString;
+ }
+
+ public static final String selectNodesText(Node startingNode) {
+ StringBuffer resultStringBuffer = new StringBuffer();
+ NodeList childNodes = startingNode.getChildNodes();
+ for (int i = 0; i < childNodes.getLength(); i++) {
+ if (childNodes.item(i).getNodeType() == Node.CDATA_SECTION_NODE || childNodes.item(i).getNodeType() == Node.TEXT_NODE) {
+ resultStringBuffer.append(childNodes.item(i).getNodeValue().trim());
+ }
+ }
+ return resultStringBuffer.toString();
+ }
+
+ public static final Element makeTable(Element parentDivElement, String caption, String[][] columnDescriptors) {
+ Element newTableElement =
+ appendNewElementWithTextAndAttributes(parentDivElement, "table", null, new String[][] {
+ {"border", "1"},
+ {"cellpadding", "3"},
+ {"cellspacing", "0"},
+ {"width", "100%"}});
+ appendNewElementWithText(newTableElement, "caption", caption);
+ Element columnGroupElement =
+ appendNewElementWithTextAndAttributes(newTableElement, "colgroup", null, new String[][] {{"align", "left"}});
+ String[] columnNames = new String[columnDescriptors.length];
+ for (int i = 0; i < columnDescriptors.length; i++) {
+ columnNames[i] = columnDescriptors[i][0];
+ appendNewElementWithTextAndAttributes(columnGroupElement, "col", null, new String[][] {{
+ "width",
+ columnDescriptors[i][1]}});//width,33
+ }
+ Element headingTableRowElement = appendNewElementWithText(newTableElement, "tr", null);
+ appendNewElementsWithText(headingTableRowElement, "th", columnNames);
+ return newTableElement;
+ }
+
+ public static final Element[] makeDivElementAndTableElement(Element parentDivElement, String caption, String[][] columnDescriptors) {
+ Element[] divAndTableElements =
+ new Element[] {parentDivElement, parentDivElement.getOwnerDocument().createElement("div"), null};
+ divAndTableElements[2] = makeTable(divAndTableElements[1], caption, columnDescriptors);
+ return divAndTableElements;
+ }
+
+ public static final Element[] makeTableRow(Element[] devAndTableElements, String[] cellContents) {
+ Element nextRow = Xml.appendNewElementWithText(devAndTableElements[2], "tr", null);
+ appendNewElementsWithText(nextRow, "td", cellContents);
+ return devAndTableElements;
+ }
+
+ public static final Element makeTableRow(Element[] devAndTableElements, String[][] cellContentsAndStyle) {
+ Element nextRow = Xml.appendNewElementWithText(devAndTableElements[2], "tr", null);
+ for (String[] cellContentsAndStyleArray : cellContentsAndStyle) {
+ if (cellContentsAndStyleArray.length > 1) {
+ appendNewElementWithTextAndOneAttribute(nextRow, "td", cellContentsAndStyleArray[0],
+ cellContentsAndStyleArray[1], cellContentsAndStyleArray[2]);
+ } else {
+ appendNewElementsWithText(nextRow, "td", new String[] {cellContentsAndStyleArray[0]});
+ }
+ }
+ return nextRow;
+ }
+
+ public static final Node writePrettyXML(Node aNode, File resultXmlFile) {
+ try {
+ Node[] notUTF8Nodes = Xml.selectNodeList(aNode, "descendant::text()[contains(.,'ďż˝')]");
+ for (int i = 0; i < notUTF8Nodes.length; i++) {
+ notUTF8Nodes[i].setNodeValue(theFunnyQuoteMatcher.reset(notUTF8Nodes[i].getNodeValue()).replaceAll("'"));
+ }
+ Jaxp.writeXmlDocument(aNode.getOwnerDocument(), resultXmlFile, Jaxp.getPrettyFormat(aNode.getOwnerDocument()));
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return aNode;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.framework.search.engine.test/src/org/eclipse/osee/framework/search/engine/test/utility/SearchTagQueryBuilderTest.java b/plugins/org.eclipse.osee.framework.search.engine.test/src/org/eclipse/osee/framework/search/engine/test/utility/SearchTagQueryBuilderTest.java
index b2768fe62b3..2307eff67d0 100644
--- a/plugins/org.eclipse.osee.framework.search.engine.test/src/org/eclipse/osee/framework/search/engine/test/utility/SearchTagQueryBuilderTest.java
+++ b/plugins/org.eclipse.osee.framework.search.engine.test/src/org/eclipse/osee/framework/search/engine/test/utility/SearchTagQueryBuilderTest.java
@@ -1,109 +1,109 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.search.engine.test.utility;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import junit.framework.Assert;
-import org.eclipse.osee.framework.search.engine.utility.SearchTagQueryBuilder;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-import org.junit.runners.Parameterized.Parameters;
-
-/**
- * Test Case for {@link SearchTagQueryBuilder}
- *
- * @author Roberto E. Escobar
- */
-@RunWith(Parameterized.class)
-public class SearchTagQueryBuilderTest {
-
- private final int numberOfItems;
- private final boolean useAttributeTypeJoin;
- private final int branchId;
- private final boolean includeDeleted;
-
- public SearchTagQueryBuilderTest(int numberOfItems, boolean useAttributeTypeJoin, int branchId, boolean includeDeleted) {
- super();
- this.numberOfItems = numberOfItems;
- this.useAttributeTypeJoin = useAttributeTypeJoin;
- this.branchId = branchId;
- this.includeDeleted = includeDeleted;
- }
-
- @Test
- public void testCase() {
- SearchTagQueryBuilder builder = new SearchTagQueryBuilder();
- String actualQuery = builder.getQuery(numberOfItems, useAttributeTypeJoin, branchId, includeDeleted);
- String expectedQuery = createExpected(numberOfItems, useAttributeTypeJoin, branchId, includeDeleted);
- Assert.assertEquals(expectedQuery, actualQuery);
- }
-
- @Parameters
- public static Collection<Object[]> data() {
- List<Object[]> data = new ArrayList<Object[]>();
-
- data.add(new Object[] {1, true, 2, false});
- data.add(new Object[] {1, false, -1, false});
- data.add(new Object[] {1, true, -1, false});
- data.add(new Object[] {1, false, -1, true});
-
- data.add(new Object[] {3, false, 2, false});
- data.add(new Object[] {3, true, 2, false});
- data.add(new Object[] {3, false, -1, false});
- data.add(new Object[] {3, true, -1, false});
- data.add(new Object[] {3, false, -1, true});
-
- data.add(new Object[] {4, true, 2, false});
- data.add(new Object[] {4, false, -1, false});
- data.add(new Object[] {4, true, 6, false});
- data.add(new Object[] {4, false, -1, true});
- return data;
- }
-
- private static String createExpected(int count, boolean hasJoin, int branchId, boolean includeDeleted) {
- StringBuilder builder = new StringBuilder();
- builder.append("SELECT /*+ ordered FIRST_ROWS */ attr1.art_id, attr1.gamma_id, attr1.value, attr1.uri, attr1.attr_type_id, txs1.branch_id FROM \n");
-
- for (int index = 0; index < count; index++) {
- builder.append(String.format("osee_search_tags ost%s, \n", index));
- }
- if (hasJoin) {
- builder.append(" osee_join_id idj,");
- }
- builder.append(" osee_attribute attr1, osee_txs txs1 WHERE \n");
-
- for (int index = 0; index < count; index++) {
- builder.append(String.format("ost%s.coded_tag_id = ? AND\n", index));
- }
-
- for (int index = 0; index < count - 1; index++) {
- builder.append(String.format("ost%s.gamma_id = ost%s.gamma_id AND \n", index, index + 1));
- }
- builder.append(String.format("ost%s.gamma_id = attr1.gamma_id AND\n", count - 1));
- builder.append(" attr1.gamma_id = txs1.gamma_id\n");
-
- if (hasJoin) {
- builder.append(" AND attr1.attr_type_id = idj.id AND idj.query_id = ?\n");
- }
- if (branchId > -1) {
- builder.append(" AND txs1.branch_id = ?");
- }
- if (includeDeleted) {
- builder.append(" AND txs1.tx_current IN (1,3)");
- } else {
- builder.append(" AND txs1.tx_current = 1");
- }
- return builder.toString();
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.framework.search.engine.test.utility;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import junit.framework.Assert;
+import org.eclipse.osee.framework.search.engine.utility.SearchTagQueryBuilder;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+
+/**
+ * Test Case for {@link SearchTagQueryBuilder}
+ *
+ * @author Roberto E. Escobar
+ */
+@RunWith(Parameterized.class)
+public class SearchTagQueryBuilderTest {
+
+ private final int numberOfItems;
+ private final boolean useAttributeTypeJoin;
+ private final int branchId;
+ private final boolean includeDeleted;
+
+ public SearchTagQueryBuilderTest(int numberOfItems, boolean useAttributeTypeJoin, int branchId, boolean includeDeleted) {
+ super();
+ this.numberOfItems = numberOfItems;
+ this.useAttributeTypeJoin = useAttributeTypeJoin;
+ this.branchId = branchId;
+ this.includeDeleted = includeDeleted;
+ }
+
+ @Test
+ public void testCase() {
+ SearchTagQueryBuilder builder = new SearchTagQueryBuilder();
+ String actualQuery = builder.getQuery(numberOfItems, useAttributeTypeJoin, branchId, includeDeleted);
+ String expectedQuery = createExpected(numberOfItems, useAttributeTypeJoin, branchId, includeDeleted);
+ Assert.assertEquals(expectedQuery, actualQuery);
+ }
+
+ @Parameters
+ public static Collection<Object[]> data() {
+ List<Object[]> data = new ArrayList<Object[]>();
+
+ data.add(new Object[] {1, true, 2, false});
+ data.add(new Object[] {1, false, -1, false});
+ data.add(new Object[] {1, true, -1, false});
+ data.add(new Object[] {1, false, -1, true});
+
+ data.add(new Object[] {3, false, 2, false});
+ data.add(new Object[] {3, true, 2, false});
+ data.add(new Object[] {3, false, -1, false});
+ data.add(new Object[] {3, true, -1, false});
+ data.add(new Object[] {3, false, -1, true});
+
+ data.add(new Object[] {4, true, 2, false});
+ data.add(new Object[] {4, false, -1, false});
+ data.add(new Object[] {4, true, 6, false});
+ data.add(new Object[] {4, false, -1, true});
+ return data;
+ }
+
+ private static String createExpected(int count, boolean hasJoin, int branchId, boolean includeDeleted) {
+ StringBuilder builder = new StringBuilder();
+ builder.append("SELECT /*+ ordered FIRST_ROWS */ attr1.art_id, attr1.gamma_id, attr1.value, attr1.uri, attr1.attr_type_id, txs1.branch_id FROM \n");
+
+ for (int index = 0; index < count; index++) {
+ builder.append(String.format("osee_search_tags ost%s, \n", index));
+ }
+ if (hasJoin) {
+ builder.append(" osee_join_id idj,");
+ }
+ builder.append(" osee_attribute attr1, osee_txs txs1 WHERE \n");
+
+ for (int index = 0; index < count; index++) {
+ builder.append(String.format("ost%s.coded_tag_id = ? AND\n", index));
+ }
+
+ for (int index = 0; index < count - 1; index++) {
+ builder.append(String.format("ost%s.gamma_id = ost%s.gamma_id AND \n", index, index + 1));
+ }
+ builder.append(String.format("ost%s.gamma_id = attr1.gamma_id AND\n", count - 1));
+ builder.append(" attr1.gamma_id = txs1.gamma_id\n");
+
+ if (hasJoin) {
+ builder.append(" AND attr1.attr_type_id = idj.id AND idj.query_id = ?\n");
+ }
+ if (branchId > -1) {
+ builder.append(" AND txs1.branch_id = ?");
+ }
+ if (includeDeleted) {
+ builder.append(" AND txs1.tx_current IN (1,3)");
+ } else {
+ builder.append(" AND txs1.tx_current = 1");
+ }
+ return builder.toString();
+ }
+}
diff --git a/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/utility/SearchTagQueryBuilder.java b/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/utility/SearchTagQueryBuilder.java
index 550dd24a48c..907963832a7 100644
--- a/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/utility/SearchTagQueryBuilder.java
+++ b/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/utility/SearchTagQueryBuilder.java
@@ -1,79 +1,79 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.search.engine.utility;
-
-import org.eclipse.osee.framework.jdk.core.type.CompositeKeyHashMap;
-
-/**
- * @author Roberto E. Escobar
- */
-public final class SearchTagQueryBuilder {
- private static final String RESTRICT_BY_BRANCH = " AND txs1.branch_id = ?";
-
- private static final CompositeKeyHashMap<Integer, Boolean, String> queryCache =
- new CompositeKeyHashMap<Integer, Boolean, String>();
-
- public SearchTagQueryBuilder() {
- super();
- }
-
- public String getQuery(int numberOfTags, boolean useAttrTypeJoin, final int branchId, final boolean includeDeleted) {
- String baseQuery = getTagQuery(numberOfTags, useAttrTypeJoin);
-
- StringBuilder toReturn = new StringBuilder();
- toReturn.append(baseQuery);
- if (branchId > -1) {
- toReturn.append(RESTRICT_BY_BRANCH);
- }
- // txs1 is for attributes, txs2 is for artifact
- if (includeDeleted) {
- toReturn.append(" AND txs1.tx_current IN (1,3)");
- } else {
- toReturn.append(" AND txs1.tx_current = 1");
- }
- return toReturn.toString();
- }
-
- private static synchronized String getTagQuery(int numberOfTags, boolean useAttrTypeJoin) {
- String query = queryCache.get(numberOfTags, useAttrTypeJoin);
- if (query == null) {
- query = createTagQuery(numberOfTags, useAttrTypeJoin);
- queryCache.put(numberOfTags, useAttrTypeJoin, query);
- }
- return query;
- }
-
- private static String createTagQuery(int numberOfTags, boolean useAttrTypeJoin) {
- StringBuilder codedTag = new StringBuilder();
- codedTag.append("SELECT /*+ ordered FIRST_ROWS */ attr1.art_id, attr1.gamma_id, attr1.value, attr1.uri, attr1.attr_type_id, txs1.branch_id FROM \n");
- for (int index = 0; index < numberOfTags; index++) {
- codedTag.append(String.format("osee_search_tags ost%d, \n", index));
- }
- if (useAttrTypeJoin) {
- codedTag.append(" osee_join_id idj,");
- }
- codedTag.append(" osee_attribute attr1, osee_txs txs1 WHERE \n");
-
- for (int index = 0; index < numberOfTags; index++) {
- codedTag.append(String.format("ost%d.coded_tag_id = ? AND\n", index));
- }
- for (int index = 1; index < numberOfTags; index++) {
- codedTag.append(String.format("ost%d.gamma_id = ost%d.gamma_id AND \n", index - 1, index));
- }
- codedTag.append(String.format("ost%d.gamma_id = attr1.gamma_id AND\n attr1.gamma_id = txs1.gamma_id\n",
- numberOfTags - 1));
-
- if (useAttrTypeJoin) {
- codedTag.append(" AND attr1.attr_type_id = idj.id AND idj.query_id = ?\n");
- }
- return codedTag.toString();
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.framework.search.engine.utility;
+
+import org.eclipse.osee.framework.jdk.core.type.CompositeKeyHashMap;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public final class SearchTagQueryBuilder {
+ private static final String RESTRICT_BY_BRANCH = " AND txs1.branch_id = ?";
+
+ private static final CompositeKeyHashMap<Integer, Boolean, String> queryCache =
+ new CompositeKeyHashMap<Integer, Boolean, String>();
+
+ public SearchTagQueryBuilder() {
+ super();
+ }
+
+ public String getQuery(int numberOfTags, boolean useAttrTypeJoin, final int branchId, final boolean includeDeleted) {
+ String baseQuery = getTagQuery(numberOfTags, useAttrTypeJoin);
+
+ StringBuilder toReturn = new StringBuilder();
+ toReturn.append(baseQuery);
+ if (branchId > -1) {
+ toReturn.append(RESTRICT_BY_BRANCH);
+ }
+ // txs1 is for attributes, txs2 is for artifact
+ if (includeDeleted) {
+ toReturn.append(" AND txs1.tx_current IN (1,3)");
+ } else {
+ toReturn.append(" AND txs1.tx_current = 1");
+ }
+ return toReturn.toString();
+ }
+
+ private static synchronized String getTagQuery(int numberOfTags, boolean useAttrTypeJoin) {
+ String query = queryCache.get(numberOfTags, useAttrTypeJoin);
+ if (query == null) {
+ query = createTagQuery(numberOfTags, useAttrTypeJoin);
+ queryCache.put(numberOfTags, useAttrTypeJoin, query);
+ }
+ return query;
+ }
+
+ private static String createTagQuery(int numberOfTags, boolean useAttrTypeJoin) {
+ StringBuilder codedTag = new StringBuilder();
+ codedTag.append("SELECT /*+ ordered FIRST_ROWS */ attr1.art_id, attr1.gamma_id, attr1.value, attr1.uri, attr1.attr_type_id, txs1.branch_id FROM \n");
+ for (int index = 0; index < numberOfTags; index++) {
+ codedTag.append(String.format("osee_search_tags ost%d, \n", index));
+ }
+ if (useAttrTypeJoin) {
+ codedTag.append(" osee_join_id idj,");
+ }
+ codedTag.append(" osee_attribute attr1, osee_txs txs1 WHERE \n");
+
+ for (int index = 0; index < numberOfTags; index++) {
+ codedTag.append(String.format("ost%d.coded_tag_id = ? AND\n", index));
+ }
+ for (int index = 1; index < numberOfTags; index++) {
+ codedTag.append(String.format("ost%d.gamma_id = ost%d.gamma_id AND \n", index - 1, index));
+ }
+ codedTag.append(String.format("ost%d.gamma_id = attr1.gamma_id AND\n attr1.gamma_id = txs1.gamma_id\n",
+ numberOfTags - 1));
+
+ if (useAttrTypeJoin) {
+ codedTag.append(" AND attr1.attr_type_id = idj.id AND idj.query_id = ?\n");
+ }
+ return codedTag.toString();
+ }
+}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/importing/parsers/WordOutlineTest.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/importing/parsers/WordOutlineTest.java
index dc67897ef39..a1e54bb2e6d 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/importing/parsers/WordOutlineTest.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/importing/parsers/WordOutlineTest.java
@@ -1,224 +1,224 @@
-/*******************************************************************************
- * Copyright (c) 2010 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.skynet.core.test.importing.parsers;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import junit.framework.Assert;
-import org.eclipse.osee.framework.jdk.core.util.Lib;
-import org.eclipse.osee.framework.jdk.core.util.ReservedCharacters;
-import org.eclipse.osee.framework.jdk.core.util.Strings;
-import org.eclipse.osee.framework.skynet.core.importing.parsers.WordOutlineExtractorDelegate;
-import org.junit.After;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-import org.junit.runners.Parameterized.Parameters;
-
-/**
- * Tests different forms of outline numbers and titles
- *
- * @author Karol M. Wilk
- */
-@RunWith(Parameterized.class)
-public final class WordOutlineTest {
-
- private static final Pattern PARAGRAPH_REGEX = Pattern.compile("<w:p[ >].*?</w:p>");
- private static final Pattern OUTLINE_NUMBER_PATTERN = Pattern.compile("((?>\\d+\\.)+\\d*)\\s*");
-
- private static final String OUTLINE_WITH_NUMBER = "outlineNameWithNumber.xml";
- private static final String OUTLINE_WITH_NUMBER_AND_CONTENT = "outlineNameNumberAndContent.xml";
- private static final String NUMBER_EMBED_IN_CONTENT = "numberEmbeddedInTheContent.xml";
-
- private final WordOutlineExtractorDelegate delegate;
- private final String dataFileName;
- private final DelegateData[] expectedData;
-
- public WordOutlineTest(String dataFileName, DelegateData... expectedData) {
- this.delegate = new WordOutlineExtractorDelegate();
- this.dataFileName = dataFileName;
- this.expectedData = expectedData;
- }
-
- //@formatter:off
- /**
- * Note: some of the data objects need to repeat data
- * from previous test because they are considered to
- * be lastHeaderNumber or lastHeaderName or lastContent
- *
- * @return collection of data sets used as input for parameterized unit test
- */
- @Parameters
- public static Collection<Object[]> getData() {
- List<Object[]> data = new ArrayList<Object[]>();
- addTest(data, OUTLINE_WITH_NUMBER, data("1.", "Outline TITLE", ""));
- addTest(data, OUTLINE_WITH_NUMBER_AND_CONTENT, data("5.", "SCOPE", ""), data("5.", "SCOPE", "content content content more content"));
-
- StringBuilder builder = new StringBuilder();
- builder.append("This 1.6 is some interesting content 2.3SAMPL");
- builder.append(ReservedCharacters.toCharacter("&acirc;"));
- builder.append(ReservedCharacters.toCharacter("&euro;"));
- builder.append(ReservedCharacters.toCharacter("&ldquo;"));
- builder.append("10.");
-
- addTest(data, NUMBER_EMBED_IN_CONTENT, data("1.", "SCOPE", ""), data("1.", "SCOPE", builder.toString()));
- return data;
- }
- //@formatter:on
-
- private static void addTest(List<Object[]> data, String dataFileName, DelegateData... expectedData) {
- data.add(new Object[] {dataFileName, expectedData});
- }
-
- private static DelegateData data(String headerNumber, String headerName, String content) {
- return new DelegateData(headerNumber, headerName, content);
- }
-
- private static String getResourceData(String name) throws IOException {
- InputStream inputStream = null;
- try {
- inputStream = WordOutlineTest.class.getResourceAsStream(name);
- String data = Lib.inputStreamToString(inputStream);
- Assert.assertTrue(Strings.isValid(data));
- return data;
- } finally {
- Lib.close(inputStream);
- }
- }
-
- @Test
- public void testDelegate() throws Exception {
- delegate.initialize();
-
- String rawData = getResourceData(dataFileName);
- Matcher matcher = PARAGRAPH_REGEX.matcher(rawData);
- boolean foundSomething = false;
-
- List<DelegateData> actualData = new ArrayList<DelegateData>();
-
- while (matcher.find()) {
- foundSomething = true;
- String data = matcher.group();
- delegate.processContent(null, false, false, null, null, null, data, false);
-
- String headerNumber = delegate.getLastHeaderNumber().trim();
- String headerName = delegate.getLastHeaderName().trim();
- String content = delegate.getLastContent().trim();
-
- actualData.add(data(headerNumber, headerName, content));
- }
-
- Assert.assertTrue("WordOutlineTester no paragraphs found...", foundSomething);
- for (int index = 0; index < expectedData.length; index++) {
- DelegateData expected = expectedData[index];
- DelegateData actual = actualData.get(index);
- Assert.assertEquals(
- String.format(
- "\nChecking %s of %s,\nEXPECTED: \n\t Number:\"%s\" \n\t Title:\"%s\" \n\t Content:\"%s\"\nACTUAL: \n\t Number:\"%s\" \n\t Title:\"%s\" \n\t Content:\"%s\"\n",
- index, dataFileName, expected.getHeaderNumber(), expected.getHeaderName(), expected.getContent(),
- actual.getHeaderNumber(), actual.getHeaderName(), actual.getContent()), expected, actual);
- if (Strings.isValid(expected.getHeaderNumber())) {
- Assert.assertTrue("WordOutlineTester doesn't look like a outline number...",
- OUTLINE_NUMBER_PATTERN.matcher(actual.getHeaderNumber()).matches());
- }
- }
- }
-
- @After
- public void testCleanup() {
- delegate.dispose();
- Assert.assertNull(delegate.getLastHeaderNumber());
- Assert.assertNull(delegate.getLastHeaderName());
- Assert.assertNull(delegate.getLastContent());
- }
-
- private static final class DelegateData {
- private final String headerNumber;
- private final String headerName;
- private final String content;
-
- public DelegateData(String headerNumber, String headerName, String content) {
- super();
- this.headerNumber = headerNumber;
- this.headerName = headerName;
- this.content = content;
- }
-
- public String getHeaderNumber() {
- return this.headerNumber;
- }
-
- public String getHeaderName() {
- return this.headerName;
- }
-
- public String getContent() {
- return this.content;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + (content == null ? 0 : content.hashCode());
- result = prime * result + (headerName == null ? 0 : headerName.hashCode());
- result = prime * result + (headerNumber == null ? 0 : headerNumber.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- DelegateData other = (DelegateData) obj;
- if (content == null) {
- if (other.content != null) {
- return false;
- }
- } else if (!content.equals(other.content)) {
- return false;
- }
- if (headerName == null) {
- if (other.headerName != null) {
- return false;
- }
- } else if (!headerName.equals(other.headerName)) {
- return false;
- }
- if (headerNumber == null) {
- if (other.headerNumber != null) {
- return false;
- }
- } else if (!headerNumber.equals(other.headerNumber)) {
- return false;
- }
- return true;
- }
-
- @Override
- public String toString() {
- return "DelegateData [headerNumber=" + headerNumber + ", headerName=" + headerName + ", content=" + content + "]";
- }
-
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2010 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.framework.skynet.core.test.importing.parsers;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import junit.framework.Assert;
+import org.eclipse.osee.framework.jdk.core.util.Lib;
+import org.eclipse.osee.framework.jdk.core.util.ReservedCharacters;
+import org.eclipse.osee.framework.jdk.core.util.Strings;
+import org.eclipse.osee.framework.skynet.core.importing.parsers.WordOutlineExtractorDelegate;
+import org.junit.After;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+
+/**
+ * Tests different forms of outline numbers and titles
+ *
+ * @author Karol M. Wilk
+ */
+@RunWith(Parameterized.class)
+public final class WordOutlineTest {
+
+ private static final Pattern PARAGRAPH_REGEX = Pattern.compile("<w:p[ >].*?</w:p>");
+ private static final Pattern OUTLINE_NUMBER_PATTERN = Pattern.compile("((?>\\d+\\.)+\\d*)\\s*");
+
+ private static final String OUTLINE_WITH_NUMBER = "outlineNameWithNumber.xml";
+ private static final String OUTLINE_WITH_NUMBER_AND_CONTENT = "outlineNameNumberAndContent.xml";
+ private static final String NUMBER_EMBED_IN_CONTENT = "numberEmbeddedInTheContent.xml";
+
+ private final WordOutlineExtractorDelegate delegate;
+ private final String dataFileName;
+ private final DelegateData[] expectedData;
+
+ public WordOutlineTest(String dataFileName, DelegateData... expectedData) {
+ this.delegate = new WordOutlineExtractorDelegate();
+ this.dataFileName = dataFileName;
+ this.expectedData = expectedData;
+ }
+
+ //@formatter:off
+ /**
+ * Note: some of the data objects need to repeat data
+ * from previous test because they are considered to
+ * be lastHeaderNumber or lastHeaderName or lastContent
+ *
+ * @return collection of data sets used as input for parameterized unit test
+ */
+ @Parameters
+ public static Collection<Object[]> getData() {
+ List<Object[]> data = new ArrayList<Object[]>();
+ addTest(data, OUTLINE_WITH_NUMBER, data("1.", "Outline TITLE", ""));
+ addTest(data, OUTLINE_WITH_NUMBER_AND_CONTENT, data("5.", "SCOPE", ""), data("5.", "SCOPE", "content content content more content"));
+
+ StringBuilder builder = new StringBuilder();
+ builder.append("This 1.6 is some interesting content 2.3SAMPL");
+ builder.append(ReservedCharacters.toCharacter("&acirc;"));
+ builder.append(ReservedCharacters.toCharacter("&euro;"));
+ builder.append(ReservedCharacters.toCharacter("&ldquo;"));
+ builder.append("10.");
+
+ addTest(data, NUMBER_EMBED_IN_CONTENT, data("1.", "SCOPE", ""), data("1.", "SCOPE", builder.toString()));
+ return data;
+ }
+ //@formatter:on
+
+ private static void addTest(List<Object[]> data, String dataFileName, DelegateData... expectedData) {
+ data.add(new Object[] {dataFileName, expectedData});
+ }
+
+ private static DelegateData data(String headerNumber, String headerName, String content) {
+ return new DelegateData(headerNumber, headerName, content);
+ }
+
+ private static String getResourceData(String name) throws IOException {
+ InputStream inputStream = null;
+ try {
+ inputStream = WordOutlineTest.class.getResourceAsStream(name);
+ String data = Lib.inputStreamToString(inputStream);
+ Assert.assertTrue(Strings.isValid(data));
+ return data;
+ } finally {
+ Lib.close(inputStream);
+ }
+ }
+
+ @Test
+ public void testDelegate() throws Exception {
+ delegate.initialize();
+
+ String rawData = getResourceData(dataFileName);
+ Matcher matcher = PARAGRAPH_REGEX.matcher(rawData);
+ boolean foundSomething = false;
+
+ List<DelegateData> actualData = new ArrayList<DelegateData>();
+
+ while (matcher.find()) {
+ foundSomething = true;
+ String data = matcher.group();
+ delegate.processContent(null, false, false, null, null, null, data, false);
+
+ String headerNumber = delegate.getLastHeaderNumber().trim();
+ String headerName = delegate.getLastHeaderName().trim();
+ String content = delegate.getLastContent().trim();
+
+ actualData.add(data(headerNumber, headerName, content));
+ }
+
+ Assert.assertTrue("WordOutlineTester no paragraphs found...", foundSomething);
+ for (int index = 0; index < expectedData.length; index++) {
+ DelegateData expected = expectedData[index];
+ DelegateData actual = actualData.get(index);
+ Assert.assertEquals(
+ String.format(
+ "\nChecking %s of %s,\nEXPECTED: \n\t Number:\"%s\" \n\t Title:\"%s\" \n\t Content:\"%s\"\nACTUAL: \n\t Number:\"%s\" \n\t Title:\"%s\" \n\t Content:\"%s\"\n",
+ index, dataFileName, expected.getHeaderNumber(), expected.getHeaderName(), expected.getContent(),
+ actual.getHeaderNumber(), actual.getHeaderName(), actual.getContent()), expected, actual);
+ if (Strings.isValid(expected.getHeaderNumber())) {
+ Assert.assertTrue("WordOutlineTester doesn't look like a outline number...",
+ OUTLINE_NUMBER_PATTERN.matcher(actual.getHeaderNumber()).matches());
+ }
+ }
+ }
+
+ @After
+ public void testCleanup() {
+ delegate.dispose();
+ Assert.assertNull(delegate.getLastHeaderNumber());
+ Assert.assertNull(delegate.getLastHeaderName());
+ Assert.assertNull(delegate.getLastContent());
+ }
+
+ private static final class DelegateData {
+ private final String headerNumber;
+ private final String headerName;
+ private final String content;
+
+ public DelegateData(String headerNumber, String headerName, String content) {
+ super();
+ this.headerNumber = headerNumber;
+ this.headerName = headerName;
+ this.content = content;
+ }
+
+ public String getHeaderNumber() {
+ return this.headerNumber;
+ }
+
+ public String getHeaderName() {
+ return this.headerName;
+ }
+
+ public String getContent() {
+ return this.content;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + (content == null ? 0 : content.hashCode());
+ result = prime * result + (headerName == null ? 0 : headerName.hashCode());
+ result = prime * result + (headerNumber == null ? 0 : headerNumber.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ DelegateData other = (DelegateData) obj;
+ if (content == null) {
+ if (other.content != null) {
+ return false;
+ }
+ } else if (!content.equals(other.content)) {
+ return false;
+ }
+ if (headerName == null) {
+ if (other.headerName != null) {
+ return false;
+ }
+ } else if (!headerName.equals(other.headerName)) {
+ return false;
+ }
+ if (headerNumber == null) {
+ if (other.headerNumber != null) {
+ return false;
+ }
+ } else if (!headerNumber.equals(other.headerNumber)) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return "DelegateData [headerNumber=" + headerNumber + ", headerName=" + headerName + ", content=" + content + "]";
+ }
+
+ }
+}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/mocks/MockLinker.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/mocks/MockLinker.java
index ac398d62490..58eecdcbf70 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/mocks/MockLinker.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/mocks/MockLinker.java
@@ -1,54 +1,54 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *public static final CoreAttributeTypes Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.skynet.core.test.mocks;
-
-import org.eclipse.osee.framework.core.data.IRelationType;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.core.model.Branch;
-import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.relation.RelationLink.ArtifactLinker;
-
-/**
- * @author Roberto E. Escobar
- */
-public class MockLinker implements ArtifactLinker {
-
- private final String name;
-
- public MockLinker(String name) {
- super();
- this.name = name;
- }
-
- public MockLinker() {
- this(null);
- }
-
- @Override
- public void updateCachedArtifact(int artId, Branch branch) {
- //
- }
-
- @Override
- public Artifact getArtifact(int ArtId, Branch branch) {
- return null;
- }
-
- @Override
- public String getLazyArtifactName(int aArtifactId, Branch branch) {
- return name;
- }
-
- @Override
- public void deleteFromRelationOrder(Artifact aArtifact, Artifact bArtifact, IRelationType relationType) throws OseeCoreException {
- //
- }
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *public static final CoreAttributeTypes Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.framework.skynet.core.test.mocks;
+
+import org.eclipse.osee.framework.core.data.IRelationType;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.model.Branch;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.relation.RelationLink.ArtifactLinker;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class MockLinker implements ArtifactLinker {
+
+ private final String name;
+
+ public MockLinker(String name) {
+ super();
+ this.name = name;
+ }
+
+ public MockLinker() {
+ this(null);
+ }
+
+ @Override
+ public void updateCachedArtifact(int artId, Branch branch) {
+ //
+ }
+
+ @Override
+ public Artifact getArtifact(int ArtId, Branch branch) {
+ return null;
+ }
+
+ @Override
+ public String getLazyArtifactName(int aArtifactId, Branch branch) {
+ return name;
+ }
+
+ @Override
+ public void deleteFromRelationOrder(Artifact aArtifact, Artifact bArtifact, IRelationType relationType) throws OseeCoreException {
+ //
+ }
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/reference/compare_two_artifacts.html b/plugins/org.eclipse.osee.framework.ui.skynet/reference/compare_two_artifacts.html
index e0d10d4e913..409cd43ad0b 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/reference/compare_two_artifacts.html
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/reference/compare_two_artifacts.html
@@ -1,24 +1,24 @@
-<html>
-<!--
- Copyright (c) 2004, 2007 Boeing.
- All rights reserved. This program and the accompanying materials
- are made available under the terms of the Eclipse Public License v1.0
- which accompanies this distribution, and is available at
- http://www.eclipse.org/legal/epl-v10.html
- Contributors:
- Boeing - initial API and implementation
--->
- <head>
- <title>compare tow artifacts</title>
- <LINK rel="stylesheet" type="text/css" href="../../osee.help/html/style.css">
- </head>
-
- <body>
- <h1>Compare two artifacts</h1>
- <h2>What it is</h2>
- <p> It compares two artifact's word contents to each other.</p>
-
- <h2>How to do it</h2>
- <p>Select two artifacts and right click and select “Compare two Artifacts”. A word document will be displayed showing the differences between each of the artifact’s word content.</p>
-</body>
+<html>
+<!--
+ Copyright (c) 2004, 2007 Boeing.
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+ Contributors:
+ Boeing - initial API and implementation
+-->
+ <head>
+ <title>compare tow artifacts</title>
+ <LINK rel="stylesheet" type="text/css" href="../../osee.help/html/style.css">
+ </head>
+
+ <body>
+ <h1>Compare two artifacts</h1>
+ <h2>What it is</h2>
+ <p> It compares two artifact's word contents to each other.</p>
+
+ <h2>How to do it</h2>
+ <p>Select two artifacts and right click and select <code>Compare two Artifacts</code>. A word document will be displayed showing the differences between each of the artifact&#39;s word content.</p>
+</body>
</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/reference/creating_new_links.html b/plugins/org.eclipse.osee.framework.ui.skynet/reference/creating_new_links.html
index 1a7212b0ccd..c3486885a10 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/reference/creating_new_links.html
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/reference/creating_new_links.html
@@ -1,28 +1,27 @@
-<html>
-<!--
- Copyright (c) 2004, 2007 Boeing.
- All rights reserved. This program and the accompanying materials
- are made available under the terms of the Eclipse Public License v1.0
- which accompanies this distribution, and is available at
- http://www.eclipse.org/legal/epl-v10.html
- Contributors:
- Boeing - initial API and implementation
--->
- <head>
- <title>Creating a new Link</title>
- <LINK rel="stylesheet" type="text/css" href="../../osee.help/html/style.css">
- </head>
-
- <body>
- <h1>Creating a new Link</h1>
- <h2>What it is</h2>
- <p>Linking artifacts to each other.</p>
-
- <h2>How to do it</h2>
- <p>New relation links can be created one of two ways.</p>
- <ul>
- <li>If the relation link group desired exists on the artifact a new link may be created by dragging another artifact onto the relation link group. </li>
- <li>If the relation group does not already exist a new relation group may be created by right clicking in the relation page then select “New Relation” and selecting the desired relation group. Only valid relation groups for the specific artifact will be enabling in the menu list. Menus where either artifact can be valid for either side will contain “…” after the text. When selected a dialog box will be displayed where the relation side of the source artifact will be placed.</li>
- </ul>
-</body>
+<html>
+<!--
+ Copyright (c) 2004, 2007 Boeing.
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+ Contributors:
+ Boeing - initial API and implementation
+-->
+ <head>
+ <title>Creating a new Link</title>
+ <LINK rel="stylesheet" type="text/css" href="../../osee.help/html/style.css">
+ </head>
+
+ <body>
+ <h1>Creating a new Link</h1>
+ <h2>What it is</h2>
+ <p>Linking artifacts to each other.</p>
+
+ <h2>How to do it</h2>
+ <p>New relation links can be created one of two ways.</p>
+ <ul>
+ <li>If the relation link group desired exists on the artifact a new link may be created by dragging another artifact onto the relation link group. </li>
+ </ul>
+</body>
</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/reference/deleting_artifacts.html b/plugins/org.eclipse.osee.framework.ui.skynet/reference/deleting_artifacts.html
index 1c6b1ab2813..5a8ad7a8dc3 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/reference/deleting_artifacts.html
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/reference/deleting_artifacts.html
@@ -1,29 +1,29 @@
-<html>
-<!--
- Copyright (c) 2004, 2007 Boeing.
- All rights reserved. This program and the accompanying materials
- are made available under the terms of the Eclipse Public License v1.0
- which accompanies this distribution, and is available at
- http://www.eclipse.org/legal/epl-v10.html
- Contributors:
- Boeing - initial API and implementation
--->
- <head>
- <title>Deleting Artifacts</title>
- <LINK rel="stylesheet" type="text/css" href="../../osee.help/html/style.css">
- </head>
-
- <body>
- <h1>Deleting Artifacts</h1>
- <h2>What it is</h2>
- <p>Artifacts may be deleted from the Artifact Explorer.
- <br>
- <b>Caution</b> should be taken in performing this task because along with the artifact all of its default hierarchy children will also be deleted.</p>
-
- <h2>How to do it</h2>
- <p>To delete an artifact and its children select the desired artifact and the right click, next select the “Delete Artifact” menu item. A dialog will be displayed asking for deletion confirmation.</p>
- <br>
- <h2>Note:</h2>
- <p>An artifact may also be deleted by selecting an artifact and pressing the delete key.</p>
-</body>
+<html>
+<!--
+ Copyright (c) 2004, 2007 Boeing.
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+ Contributors:
+ Boeing - initial API and implementation
+-->
+ <head>
+ <title>Deleting Artifacts</title>
+ <LINK rel="stylesheet" type="text/css" href="../../osee.help/html/style.css">
+ </head>
+
+ <body>
+ <h1>Deleting Artifacts</h1>
+ <h2>What it is</h2>
+ <p>Artifacts may be deleted from the Artifact Explorer.
+ <br>
+ <b>Caution</b> should be taken in performing this task because along with the artifact all of its default hierarchy children will also be deleted.</p>
+
+ <h2>How to do it</h2>
+ <p>To delete an artifact and its children select the desired artifact and the right click, next select the <code>Delete Artifact</code> menu item. A dialog will be displayed asking for deletion confirmation.</p>
+ <br>
+ <h2>Note:</h2>
+ <p>An artifact may also be deleted by selecting an artifact and pressing the delete key.</p>
+</body>
</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/reference/deleting_link.html b/plugins/org.eclipse.osee.framework.ui.skynet/reference/deleting_link.html
index 3bca9d0a247..8b03ff1a4b7 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/reference/deleting_link.html
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/reference/deleting_link.html
@@ -1,24 +1,24 @@
-<html>
-<!--
- Copyright (c) 2004, 2007 Boeing.
- All rights reserved. This program and the accompanying materials
- are made available under the terms of the Eclipse Public License v1.0
- which accompanies this distribution, and is available at
- http://www.eclipse.org/legal/epl-v10.html
- Contributors:
- Boeing - initial API and implementation
--->
- <head>
- <title>Deleting a Link</title>
- <LINK rel="stylesheet" type="text/css" href="../../osee.help/html/style.css">
- </head>
-
- <body>
- <h1>Deleting a Link</h1>
- <h2>What it is</h2>
- <p>Removing a link between two artifacts.</p>
-
- <h2>How to do it</h2>
- <p>A link can de deleted by selecting the desired link to be removed then right clicking and selecting the “Delete” menu item. A dialog will be displayed for confirmation.</p>
-</body>
+<html>
+<!--
+ Copyright (c) 2004, 2007 Boeing.
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+ Contributors:
+ Boeing - initial API and implementation
+-->
+ <head>
+ <title>Deleting a Link</title>
+ <LINK rel="stylesheet" type="text/css" href="../../osee.help/html/style.css">
+ </head>
+
+ <body>
+ <h1>Deleting a Link</h1>
+ <h2>What it is</h2>
+ <p>Removing a link between two artifacts.</p>
+
+ <h2>How to do it</h2>
+ <p>A link can de deleted by selecting the desired link to be removed then right clicking and selecting the <code>Delete</code> menu item. A dialog will be displayed for confirmation.</p>
+</body>
</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/reference/go_into.html b/plugins/org.eclipse.osee.framework.ui.skynet/reference/go_into.html
index c0a84494335..ed73acc6266 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/reference/go_into.html
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/reference/go_into.html
@@ -1,24 +1,24 @@
-<html>
-<!--
- Copyright (c) 2004, 2007 Boeing.
- All rights reserved. This program and the accompanying materials
- are made available under the terms of the Eclipse Public License v1.0
- which accompanies this distribution, and is available at
- http://www.eclipse.org/legal/epl-v10.html
- Contributors:
- Boeing - initial API and implementation
--->
- <head>
- <title>Rooting on an artifact</title>
- <LINK rel="stylesheet" type="text/css" href="../../osee.help/html/style.css">
- </head>
-
- <body>
- <h1>Rooting on an artifact</h1>
- <h2>What it is</h2>
- <p>It changes the root artifact in the Artifact Explorer to the selected artifact.</p>
-
- <h2>How to do it</h2>
- <p>Select the desired artifact from the Artifact Explorer right click and select the “Go Into” menu item.</p>
-</body>
+<html>
+<!--
+ Copyright (c) 2004, 2007 Boeing.
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+ Contributors:
+ Boeing - initial API and implementation
+-->
+ <head>
+ <title>Rooting on an artifact</title>
+ <LINK rel="stylesheet" type="text/css" href="../../osee.help/html/style.css">
+ </head>
+
+ <body>
+ <h1>Rooting on an artifact</h1>
+ <h2>What it is</h2>
+ <p>It changes the root artifact in the Artifact Explorer to the selected artifact.</p>
+
+ <h2>How to do it</h2>
+ <p>Select the desired artifact from the Artifact Explorer right click and select the <code>Go Into</code> menu item.</p>
+</body>
</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.support.admin/openDO/meeting.txt b/plugins/org.eclipse.osee.support.admin/openDO/meeting.txt
index aedb68c1d51..cd4d1dd5747 100644
--- a/plugins/org.eclipse.osee.support.admin/openDO/meeting.txt
+++ b/plugins/org.eclipse.osee.support.admin/openDO/meeting.txt
@@ -1,74 +1,74 @@
-Paul Meyers - manager of advances services group
-development process to produce high integrity software
-everything must be requirement driven
-source, test, test output, coverage output
-
-http://www.stsc.hill.af.mil/crosstalk/2008/11/0811FromtheSponsor.html
-Ms. Kristen Baldwin serves as Deputy Director for Software Engineering and System Assurance in the Office of the Under Secretary of Defense for Acquisition, Technology and Logistics (OUSD (AT&L)).
-
-gps
-
-gnat bench
-
-use ECORE for meta-data model
-Doug Gaff and Wind River
-
-Open DO-178B
-
-config set of DO-178B workflows into OSEE
-import the DO-178B into OSEE
-integrate output from project coverage
-
-___________________________________
-2008-11-20
-Bruce Lewis worked with SEI - came up with an idea with AADL - University in Pairs working on AADL OSATE
-
-DO-178x categories:
- development tools - has possibility of introducing
- verification tools -
- applications
-
-Willie Fizpatrick
-
-Topcased to become and Eclipse project
-
-http://www.slideshare.net/AdaCore/opendo-initial-concepts-and-idea
-
-
-need: PSAC, SAS, DTP, 66 objectives,
-software development plan can be the PSAC
-Configuration Management Plan
-Plan of Software Aspects of Certification
-workflows should have a review with a checklist of what should be in the document
-get DO-178B: www.avionics.com
-DO-254
-DO-248: clarification
-DO-278: for ground systems
-CAS papers of FAA website
-
-Vance Hilderman and Tony Baghai
-
-
-
-
-
-Egineering Process Group: CCMI
-__________________________________
-
-Test Suite - parent of test cases and/or test suites
-
-Test Case - test program the traces to the software requiements and verifies the code unit
-
-Code Unit - application code that traces to the software requiements
-
-
-need attribute to reference workspace file
-on edit launch the predefined workspace editor
-preview should translate to html
-
-inside test case use an annotation like "@Interesting 1" and "@InterestingEnd 1" to mark section of file
-
-
-fitnesse ochem@adacore.com
-
-AdaCore is a major sponsor of this event and Franco Gasperoni will be giving a talk entitled “Open-DO: A Call to Action for DO-178B and other Safety-Critical Software” \ No newline at end of file
+Paul Meyers - manager of advances services group
+development process to produce high integrity software
+everything must be requirement driven
+source, test, test output, coverage output
+
+http://www.stsc.hill.af.mil/crosstalk/2008/11/0811FromtheSponsor.html
+Ms. Kristen Baldwin serves as Deputy Director for Software Engineering and System Assurance in the Office of the Under Secretary of Defense for Acquisition, Technology and Logistics (OUSD (AT&L)).
+
+gps
+
+gnat bench
+
+use ECORE for meta-data model
+Doug Gaff and Wind River
+
+Open DO-178B
+
+config set of DO-178B workflows into OSEE
+import the DO-178B into OSEE
+integrate output from project coverage
+
+___________________________________
+2008-11-20
+Bruce Lewis worked with SEI - came up with an idea with AADL - University in Pairs working on AADL OSATE
+
+DO-178x categories:
+ development tools - has possibility of introducing
+ verification tools -
+ applications
+
+Willie Fizpatrick
+
+Topcased to become and Eclipse project
+
+http://www.slideshare.net/AdaCore/opendo-initial-concepts-and-idea
+
+
+need: PSAC, SAS, DTP, 66 objectives,
+software development plan can be the PSAC
+Configuration Management Plan
+Plan of Software Aspects of Certification
+workflows should have a review with a checklist of what should be in the document
+get DO-178B: www.avionics.com
+DO-254
+DO-248: clarification
+DO-278: for ground systems
+CAS papers of FAA website
+
+Vance Hilderman and Tony Baghai
+
+
+
+
+
+Egineering Process Group: CCMI
+__________________________________
+
+Test Suite - parent of test cases and/or test suites
+
+Test Case - test program the traces to the software requiements and verifies the code unit
+
+Code Unit - application code that traces to the software requiements
+
+
+need attribute to reference workspace file
+on edit launch the predefined workspace editor
+preview should translate to html
+
+inside test case use an annotation like "@Interesting 1" and "@InterestingEnd 1" to mark section of file
+
+
+fitnesse ochem@adacore.com
+
+AdaCore is a major sponsor of this event and Franco Gasperoni will be giving a talk entitled "Open-DO: A Call to Action for DO-178B and other Safety-Critical Software" \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.support.admin/presentations_publications/EclipseCon2009_Developing_High_Integrity_Software.html b/plugins/org.eclipse.osee.support.admin/presentations_publications/EclipseCon2009_Developing_High_Integrity_Software.html
index 0884c0612f5..a7add66c47e 100644
--- a/plugins/org.eclipse.osee.support.admin/presentations_publications/EclipseCon2009_Developing_High_Integrity_Software.html
+++ b/plugins/org.eclipse.osee.support.admin/presentations_publications/EclipseCon2009_Developing_High_Integrity_Software.html
@@ -1,27 +1,37 @@
-Title: Developing High Integrity Software
-Difficulty: Intermediate
-Category: Eclipse Ecosystem - Business and Industry
-
-
-<p>Whether you develop mission/safety-critical systems or simply want the benefits of high quality engineering processes, this talk is for you.</p>
-
-<p>The development of high-integrity systems is governed by stringent standards which require engineers to provide sufficient evidence of the quality of the developed artifacts. For instance, DO-178B "Software Considerations in Airborne Systems and Equipment Certification" provides guidelines for the production of avionics software: any software flying on civil aircraft must follow DO-178. Similar standards exist for other domains, such as automotive and industrial automation.</p>
-
-<p>One of the most costly processes to put in place when developing high-quality software is providing end-to-end traceability between requirements, design elements, source code, test cases, and documentation. This evidence is needed to increase the confidence that the software satisfies stakeholders’ expectations. Since this evidence involves artifacts across the full development life-cycle, an integrated solution is needed in order to provide the required evidence in a cost effective manner.</p>
-
-<p><a href="http://www.eclipse.org/osee">Open System Engineering Environment</a> (OSEE) is an integrated environment that enables developers to apply software engineering principles needed to build high integrity software. Using a user definable process and workflow and bidirectional traceability across the full development life-cycle, OSEE facilities the creation and management of the engineering artifacts that can be used as evidence when certifying the product’s integrity.</p>
-
-<p>In this presentation and live demonstration, we show how OSEE facilitates the qualification of a verification tool in the context of DO-178 level A (the highest criticality level). We use OSEE to design a traceability model across all development artifacts, and to put them in relation with our specific workflow, so as to assure that each development step is allocated, tracked and produces the expected output. In addition, we exploit OSEE’s reporting capabilities to generate documented evidence of end-to-end traceability.</p>
-
-<p>This presentation is prepared by Boeing and AdaCore. The OSEE team at Boeing provided support in the use of OSEE for the qualification of AdaCore tools in the context of DO-178. The lessons learned from this collaboration are expected to be applicable to anyone involved with DO-178B and more generally to those who are developing high integrity software.</p>
-
-_____________OLD
-
-
-<p>Whether you develop mission/safety-critical systems or simply value high quality code, this talk is for you. Developing high integrity software in a cost effective manner, especially for complex systems, requires an integrated engineering environment to guide developers through the development process and facilitate and automate as many engineering steps as possible.</p>
-
-<p>The <a href="http://www.eclipse.org/osee">Open System Engineering Environment</a> (OSEE) enables developers to apply software engineering principles needed to build high integrity software. Using an integrated, user definable process and workflow and bidirectional traceability across the full development life-cycle, OSEE facilities the creation and management of the engineering artifacts that can be used as evidence when certifying the product’s integrity.</p>
-
-<p>AdaCore is the leading provider of commercial, open software solutions for long-lived applications where reliability, efficiency and safety are absolutely critical. AdaCore is working with the OSEE project to use OSEE for tool qualification for DO-178B of some of AdaCore’s tools such as GNATcheck and its open source code coverage tool. The lessons learned from this collaboration are expected to be useful to anyone involved with DO-178B and more generally those developing high integrity software.</p>
-
-<p>DO-178B "Software Considerations in Airborne Systems and Equipment Certification" provides guidelines for the production of avionics software and its use it accepted by certification authorities such as the FAA and EASA.</p>
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+ <head>
+ <title>Developing High Integrity Software</title>
+ </head>
+ <body>
+Difficulty: Intermediate
+Category: Eclipse Ecosystem - Business and Industry
+
+<p>Whether you develop mission/safety-critical systems or simply want the benefits of high quality engineering processes, this talk is for you.</p>
+
+<p>The development of high-integrity systems is governed by stringent standards which require engineers to provide sufficient evidence of the quality of the developed artifacts. For instance, DO-178B "Software Considerations in Airborne Systems and Equipment Certification" provides guidelines for the production of avionics software: any software flying on civil aircraft must follow DO-178. Similar standards exist for other domains, such as automotive and industrial automation.</p>
+
+<p>One of the most costly processes to put in place when developing high-quality software is providing end-to-end traceability between requirements, design elements, source code, test cases, and documentation. This evidence is needed to increase the confidence that the software satisfies stakeholders&#39; expectations. Since this evidence involves artifacts across the full development life-cycle, an integrated solution is needed in order to provide the required evidence in a cost effective manner.</p>
+
+<p><a href="http://www.eclipse.org/osee">Open System Engineering Environment</a> (OSEE) is an integrated environment that enables developers to apply software engineering principles needed to build high integrity software. Using a user definable process and workflow and bidirectional traceability across the full development life-cycle, OSEE facilities the creation and management of the engineering artifacts that can be used as evidence when certifying the product&#39;s integrity.</p>
+
+<p>In this presentation and live demonstration, we show how OSEE facilitates the qualification of a verification tool in the context of DO-178 level A (the highest criticality level). We use OSEE to design a traceability model across all development artifacts, and to put them in relation with our specific workflow, so as to assure that each development step is allocated, tracked and produces the expected output. In addition, we exploit OSEE&#39;s reporting capabilities to generate documented evidence of end-to-end traceability.</p>
+
+<p>This presentation is prepared by Boeing and AdaCore. The OSEE team at Boeing provided support in the use of OSEE for the qualification of AdaCore tools in the context of DO-178. The lessons learned from this collaboration are expected to be applicable to anyone involved with DO-178B and more generally to those who are developing high integrity software.</p>
+
+<h4>Original Version</h4>
+
+<p>Whether you develop mission/safety-critical systems or simply value high quality code, this talk is for you. Developing high integrity software in a cost effective manner, especially for complex systems, requires an integrated engineering environment to guide developers through the development process and facilitate and automate as many engineering steps as possible.</p>
+
+<p>The <a href="http://www.eclipse.org/osee">Open System Engineering Environment</a> (OSEE) enables developers to apply software engineering principles needed to build high integrity software. Using an integrated, user definable process and workflow and bidirectional traceability across the full development life-cycle, OSEE facilities the creation and management of the engineering artifacts that can be used as evidence when certifying the product&#39;s integrity.</p>
+
+<p>AdaCore is the leading provider of commercial, open software solutions for long-lived applications where reliability, efficiency and safety are absolutely critical. AdaCore is working with the OSEE project to use OSEE for tool qualification for DO-178B of some of AdaCore&#39;s tools such as GNATcheck and its open source code coverage tool. The lessons learned from this collaboration are expected to be useful to anyone involved with DO-178B and more generally those developing high integrity software.</p>
+
+<p>DO-178B "Software Considerations in Airborne Systems and Equipment Certification" provides guidelines for the production of avionics software and its use it accepted by certification authorities such as the FAA and EASA.</p>
+
+ </body>
+</html>
+
+
+

Back to the top