Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2014-02-07 16:25:54 +0000
committerRyan T. Baldwin2014-02-07 16:25:54 +0000
commit7d7ae0462d901368c34c5d2f2d1869dd54be750b (patch)
tree5ea7bb9ca119cd593ca4b6fa961840629c641543 /plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditor.java
parente2060f3963266959d2e6d863b25a97250a633a6f (diff)
downloadorg.eclipse.osee-7d7ae0462d901368c34c5d2f2d1869dd54be750b.tar.gz
org.eclipse.osee-7d7ae0462d901368c34c5d2f2d1869dd54be750b.tar.xz
org.eclipse.osee-7d7ae0462d901368c34c5d2f2d1869dd54be750b.zip
bug[ats_ATS19553]: ATS World editor shows errors on restart
Diffstat (limited to 'plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditor.java')
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditor.java46
1 files changed, 31 insertions, 15 deletions
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditor.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditor.java
index e5239f0feb1..d5023f96adb 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditor.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditor.java
@@ -12,6 +12,7 @@ package org.eclipse.osee.ats.world;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
import java.util.List;
import java.util.logging.Level;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -140,25 +141,28 @@ public class WorldEditor extends FormEditor implements IWorldEditor, IDirtiableE
@Override
protected void addPages() {
-
try {
OseeStatusContributionItemFactory.addTo(this, true);
IWorldEditorProvider provider = getWorldEditorProvider();
- if (provider instanceof IWorldEditorConsumer) {
- ((IWorldEditorConsumer) provider).setWorldEditor(this);
- }
-
- createMainTab();
- createMetricsTab();
- setActivePage(0);
-
setPartName(provider.getSelectedName(SearchType.Search));
+ if (getWorldEditorInput().isReload()) {
+ createReloadTab();
+ setActivePage(0);
+ } else {
+ if (provider instanceof IWorldEditorConsumer) {
+ ((IWorldEditorConsumer) provider).setWorldEditor(this);
+ }
+ createMainTab();
+ createMetricsTab();
+ setActivePage(WorldXWidgetActionPage.ID);
+ }
- getSite().setSelectionProvider(getWorldComposite().getXViewer());
-
- // Until WorldEditor has different help, just use WorldView's help
- HelpUtil.setHelp(worldXWidgetActionPage.getWorldComposite().getControl(), AtsHelpContext.WORLD_VIEW);
+ if (!getWorldEditorInput().isReload()) {
+ getSite().setSelectionProvider(getWorldComposite().getXViewer());
+ // Until WorldEditor has different help, just use WorldView's help
+ HelpUtil.setHelp(worldXWidgetActionPage.getWorldComposite().getControl(), AtsHelpContext.WORLD_VIEW);
+ }
} catch (Exception ex) {
OseeLog.log(Activator.class, Level.SEVERE, ex);
}
@@ -184,12 +188,17 @@ public class WorldEditor extends FormEditor implements IWorldEditor, IDirtiableE
@Override
public IWorldEditorProvider getWorldEditorProvider() throws OseeArgumentException {
+ WorldEditorInput worldEditorInput = getWorldEditorInput();
+ worldEditorInput.setEditor(this);
+ return worldEditorInput.getIWorldEditorProvider();
+ }
+
+ public WorldEditorInput getWorldEditorInput() {
IEditorInput editorInput = getEditorInput();
if (!(editorInput instanceof WorldEditorInput)) {
throw new OseeArgumentException("Editor Input not WorldEditorInput");
}
- WorldEditorInput worldEditorInput = (WorldEditorInput) editorInput;
- return worldEditorInput.getIWorldEditorProvider();
+ return (WorldEditorInput) editorInput;
}
@Override
@@ -197,6 +206,10 @@ public class WorldEditor extends FormEditor implements IWorldEditor, IDirtiableE
worldXWidgetActionPage.reSearch();
}
+ private void createReloadTab() throws PartInitException {
+ addPage(new WorldReloadTab(this, (WorldEditorReloadProvider) getWorldEditorProvider()));
+ }
+
private void createMainTab() throws PartInitException {
worldXWidgetActionPage = new WorldXWidgetActionPage(this);
addPage(worldXWidgetActionPage);
@@ -210,6 +223,9 @@ public class WorldEditor extends FormEditor implements IWorldEditor, IDirtiableE
}
public List<Artifact> getLoadedArtifacts() {
+ if (worldXWidgetActionPage == null || worldXWidgetActionPage.getWorldComposite() == null) {
+ return Collections.emptyList();
+ }
return worldXWidgetActionPage.getWorldComposite().getLoadedArtifacts();
}

Back to the top