summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkwilk2011-01-11 15:40:39 (EST)
committer Ryan D. Brooks2011-01-11 15:40:39 (EST)
commite2214eee6e3126d291381989234dd6f92c157d12 (patch)
tree109889b99cbaeffeda38887c8b155bb288308986
parent65da98278455193b5f4dfd5664371015e3e48c44 (diff)
downloadorg.eclipse.osee-e2214eee6e3126d291381989234dd6f92c157d12.zip
org.eclipse.osee-e2214eee6e3126d291381989234dd6f92c157d12.tar.gz
org.eclipse.osee-e2214eee6e3126d291381989234dd6f92c157d12.tar.bz2
bug[bgz_333909]: Fix for setFocus() problem in widgets inheriting from XWidget and ViewPart
-rw-r--r--plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/test/AtsTest_Demo_Suite.java4
-rw-r--r--plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/test/util/AtsXWidgetsExampleBlamTest.java60
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/history/XHistoryViewer.java44
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/HyperView.java4
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/NavigateView.java4
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranch.java45
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/XCommitManager.java31
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/XDefectViewer.java24
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/SMAStatusDialog.java4
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/XUserRoleViewer.java25
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/xcover/XCoverageViewer.java31
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/navigate/CoverageNavigateView.java10
-rw-r--r--plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/navigate/DefineNavigateView.java3
-rw-r--r--plugins/org.eclipse.osee.framework.database.init/META-INF/MANIFEST.MF1
-rw-r--r--plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/text/UtfReadingRuleTest.java2
-rw-r--r--plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/Strings.java11
-rw-r--r--plugins/org.eclipse.osee.framework.ui.admin/src/org/eclipse/osee/framework/ui/admin/AdminView.java6
-rw-r--r--plugins/org.eclipse.osee.framework.ui.admin/src/org/eclipse/osee/framework/ui/admin/dbtabletab/DbTableTab.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/core/BranchGraphEditor.java10
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/XWidgetParser.java60
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/AbstractBlam.java36
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/XWidgetsExampleBlam.java16
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/group/GroupExplorer.java26
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/search/QuickSearchView.java24
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/skywalker/SkyWalkerView.java15
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/skywalker/arttype/ArtifactTypeWalker.java16
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/GenericViewPart.java44
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/GenericXWidget.java41
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XArtifactList.java14
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XBranchSelectComboWidget.java29
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XBranchSelectWidget.java24
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XButton.java68
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XButtonCommon.java65
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XButtonPush.java80
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XCheckBox.java68
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XCombo.java113
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XComboViewer.java48
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XDate.java60
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XFlatWidget.java8
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XFloat.java6
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XFloatDam.java4
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XHyperlinkLabelCmdValueSelection.java40
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XHyperlinkLabelValueSelection.java40
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XInteger.java6
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XLabel.java52
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XLabelDam.java36
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XLabelValueBase.java39
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XList.java81
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XListViewer.java49
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XMembersCombo.java84
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XMembersList.java14
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XOption.java76
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XOptionHandler.java94
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XPercent.java4
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XRadioButton.java51
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XRadioButtonTest.java69
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XRadioButtons.java63
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XSelectFromDialog.java8
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XStackedWidget.java8
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XText.java85
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XWidget.java110
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xBranch/BranchView.java20
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xBranch/XBranchWidget.java49
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xHistory/HistoryView.java25
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xHistory/XHistoryWidget.java25
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xbargraph/XBarGraphTable.java70
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeView.java17
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeXWidget.java30
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/ui/XWidgetsExampleBlamUi.xml33
-rw-r--r--plugins/org.eclipse.osee.ote.ui.define/src/org/eclipse/osee/ote/ui/define/views/TestRunView.java16
-rw-r--r--plugins/org.eclipse.osee.ote.ui/src/org/eclipse/osee/ote/ui/navigate/OteNavigateView.java3
71 files changed, 604 insertions, 1879 deletions
diff --git a/plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/test/AtsTest_Demo_Suite.java b/plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/test/AtsTest_Demo_Suite.java
index fdd12ae..3f22413 100644
--- a/plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/test/AtsTest_Demo_Suite.java
+++ b/plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/test/AtsTest_Demo_Suite.java
@@ -26,6 +26,7 @@ import org.eclipse.osee.ats.test.util.AtsDeleteManagerTest;
import org.eclipse.osee.ats.test.util.AtsImageTest;
import org.eclipse.osee.ats.test.util.AtsNotifyUsersTest;
import org.eclipse.osee.ats.test.util.AtsPurgeTest;
+import org.eclipse.osee.ats.test.util.AtsXWidgetsExampleBlamTest;
import org.eclipse.osee.ats.test.util.ImportActionsViaSpreadsheetTest;
import org.eclipse.osee.ats.test.workflow.SMAPromptChangeStatusTest;
import org.eclipse.osee.framework.core.client.ClientSessionManager;
@@ -52,7 +53,8 @@ import org.junit.runners.Suite;
AtsPurgeTest.class,
AtsNotifyUsersTest.class,
AtsBranchConfigurationTest.class,
- AtsValidateAtsDatabaseTest.class,})
+ AtsValidateAtsDatabaseTest.class,
+ AtsXWidgetsExampleBlamTest.class})
/**
* @author Donald G. Dunne
*/
diff --git a/plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/test/util/AtsXWidgetsExampleBlamTest.java b/plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/test/util/AtsXWidgetsExampleBlamTest.java
new file mode 100644
index 0000000..ab9fa74
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/test/util/AtsXWidgetsExampleBlamTest.java
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.ats.test.util;
+
+import java.util.Collection;
+import org.eclipse.osee.ats.navigate.AtsXNavigateItemLauncher;
+import org.eclipse.osee.framework.logging.SevereLoggingMonitor;
+import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateComposite.TableLoadOption;
+import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateItem;
+import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
+import org.eclipse.osee.framework.ui.skynet.blam.AbstractBlam;
+import org.eclipse.osee.framework.ui.skynet.blam.BlamContributionManager;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItemBlam;
+import org.eclipse.osee.support.test.util.TestUtil;
+import org.junit.Assert;
+
+/**
+ * @author Karol M. Wilk
+ */
+public class AtsXWidgetsExampleBlamTest {
+
+ private static final String NAME_OF_ATS_ITEM = "XWidgets Example";
+
+ /**
+ * Load NAME_OF_ATS_ITEM blam, log any exceptions and report them as test failures. Purpose of this test is to serve
+ * as a regression test to various widgets loaded in XWidgetExampleBlam.
+ */
+ @org.junit.Test
+ public void testXWidgetsExampleBlam() throws Exception {
+ SevereLoggingMonitor monitorLog = TestUtil.severeLoggingStart();
+
+ XNavigateItemBlam item = null;
+ Collection<AbstractBlam> blams = BlamContributionManager.getBlamOperations();
+ boolean foundBlam = false;
+ for (AbstractBlam blam : blams) {
+ if (blam.getName().equals(NAME_OF_ATS_ITEM)) {
+ item = new XNavigateItemBlam(new XNavigateItem(null, "Blam Operations", FrameworkImage.BLAM), blam);
+ foundBlam = true;
+ break;
+ }
+ }
+
+ Assert.assertTrue(String.format("%s not found from list of provided Blams.", NAME_OF_ATS_ITEM), foundBlam);
+ AtsXNavigateItemLauncher.handleDoubleClick(item, TableLoadOption.ForcePend, TableLoadOption.NoUI);
+
+ Assert.assertTrue(
+ "Exceptions were thrown during AtsXWidgetsExampleBlamTest (gui test of XWidgetExampleBlam) should be none.",
+ monitorLog.getSevereLogs().isEmpty());
+
+ TestUtil.severeLoggingEnd(monitorLog);
+ }
+}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/history/XHistoryViewer.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/history/XHistoryViewer.java
index cfc007c..0535c4e 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/history/XHistoryViewer.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/history/XHistoryViewer.java
@@ -15,12 +15,11 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
-import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.action.ActionContributionItem;
import org.eclipse.osee.ats.artifact.AbstractWorkflowArtifact;
import org.eclipse.osee.framework.skynet.core.change.Change;
import org.eclipse.osee.framework.ui.plugin.util.ArrayTreeContentProvider;
-import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
+import org.eclipse.osee.framework.ui.skynet.widgets.GenericXWidget;
import org.eclipse.osee.framework.ui.swt.ALayout;
import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.swt.SWT;
@@ -40,7 +39,7 @@ import org.eclipse.ui.forms.widgets.ScrolledForm;
/**
* @author Donald G. Dunne
*/
-public class XHistoryViewer extends XWidget {
+public class XHistoryViewer extends GenericXWidget {
private HistoryXViewer xViewer;
private ToolBar toolBar;
@@ -169,21 +168,6 @@ public class XHistoryViewer extends XWidget {
toolBar.setLayoutData(gd);
}
- @Override
- public void setXmlData(String str) {
- // do nothing
- }
-
- @Override
- public String getXmlData() {
- return null;
- }
-
- @Override
- public String getReportData() {
- return null;
- }
-
/**
* @return Returns the xViewer.
*/
@@ -202,28 +186,12 @@ public class XHistoryViewer extends XWidget {
}
@Override
- public IStatus isValid() {
- return null;
- }
-
- @Override
- public String toHTML(String labelFont) {
- return null;
+ public void refresh() {
+ getXViewer().refresh();
}
@Override
public Control getControl() {
- return null;
- }
-
- @Override
- public void setFocus() {
- getXViewer().getTree().setFocus();
+ return xViewer.getTree();
}
-
- @Override
- public void refresh() {
- getXViewer().refresh();
- }
-
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/HyperView.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/HyperView.java
index b27cd94..2f383cc 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/HyperView.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/HyperView.java
@@ -942,7 +942,9 @@ public class HyperView extends ViewPart implements IPartListener {
@Override
public void setFocus() {
- // viewer.getControl().setFocus();
+ if (canvas != null && !canvas.isDisposed()) {
+ canvas.setFocus();
+ }
}
public Color getCenterColor() {
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/NavigateView.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/NavigateView.java
index 46b7754..03fe0b4 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/NavigateView.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/NavigateView.java
@@ -286,7 +286,9 @@ public class NavigateView extends ViewPart implements IActionable {
@Override
public void setFocus() {
- // do nothing
+ if (loadingComposite != null && !loadingComposite.isDisposed()) {
+ loadingComposite.setFocus();
+ }
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranch.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranch.java
index 84b482d..d84c2f7 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranch.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranch.java
@@ -47,8 +47,8 @@ import org.eclipse.osee.framework.ui.plugin.util.Result;
import org.eclipse.osee.framework.ui.skynet.ArtifactExplorer;
import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
+import org.eclipse.osee.framework.ui.skynet.widgets.GenericXWidget;
import org.eclipse.osee.framework.ui.skynet.widgets.IArtifactWidget;
-import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.ImageManager;
import org.eclipse.osee.framework.ui.swt.Widgets;
@@ -67,7 +67,7 @@ import org.eclipse.swt.widgets.Listener;
* @author Megumi Telles
* @author Donald G. Dunne
*/
-public class XWorkingBranch extends XWidget implements IArtifactWidget, IAccessControlEventListener, IArtifactEventListener, IBranchEventListener {
+public class XWorkingBranch extends GenericXWidget implements IArtifactWidget, IAccessControlEventListener, IArtifactEventListener, IBranchEventListener {
private TeamWorkFlowArtifact teamArt;
private Button createBranchButton;
@@ -78,6 +78,8 @@ public class XWorkingBranch extends XWidget implements IArtifactWidget, IAccessC
private Button lockBranchButton;
private XWorkingBranchEnablement enablement;
+ private Composite bComp;
+
public static enum BranchStatus {
Not_Started,
Changes_InProgress,
@@ -86,7 +88,7 @@ public class XWorkingBranch extends XWidget implements IArtifactWidget, IAccessC
public final static String WIDGET_ID = ATSAttributes.WORKING_BRANCH_WIDGET.getWorkItemId();
public XWorkingBranch() {
- super("Working Branch", "");
+ super("Working Branch");
OseeEventManager.addListener(this);
}
@@ -104,7 +106,7 @@ public class XWorkingBranch extends XWidget implements IArtifactWidget, IAccessC
labelWidget = new Label(parent, SWT.NONE);
}
- Composite bComp = new Composite(parent, SWT.NONE);
+ bComp = new Composite(parent, SWT.NONE);
bComp.setLayout(new GridLayout(6, false));
bComp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
if (toolkit != null) {
@@ -309,11 +311,6 @@ public class XWorkingBranch extends XWidget implements IArtifactWidget, IAccessC
}
@Override
- public void setFocus() {
- // do nothing
- }
-
- @Override
public void dispose() {
OseeEventManager.removeListener(this);
}
@@ -324,31 +321,11 @@ public class XWorkingBranch extends XWidget implements IArtifactWidget, IAccessC
}
@Override
- public Object getData() {
- return null;
- }
-
- @Override
- public String getReportData() {
- return null;
- }
-
- @Override
- public String getXmlData() {
- return null;
- }
-
- @Override
public IStatus isValid() {
// Need this cause it removes all error items of this namespace
return new Status(IStatus.OK, getClass().getSimpleName(), "");
}
- @Override
- public void refresh() {
- // don't do anything here cause to expensive to check for branch conditions during every refresh
- }
-
public void refreshOnBranchEvent() {
if (teamArt == null || teamArt.getBranchMgr() == null || labelWidget == null || labelWidget.isDisposed()) {
return;
@@ -374,16 +351,6 @@ public class XWorkingBranch extends XWidget implements IArtifactWidget, IAccessC
}
@Override
- public void setXmlData(String str) {
- // do nothing
- }
-
- @Override
- public String toHTML(String labelFont) {
- return "";
- }
-
- @Override
public Result isDirty() {
return Result.FalseResult;
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/XCommitManager.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/XCommitManager.java
index 918e564..faeab5b 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/XCommitManager.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/XCommitManager.java
@@ -38,8 +38,8 @@ import org.eclipse.osee.framework.skynet.core.event.model.BranchEventType;
import org.eclipse.osee.framework.skynet.core.event.model.Sender;
import org.eclipse.osee.framework.ui.plugin.PluginUiImage;
import org.eclipse.osee.framework.ui.plugin.util.Result;
+import org.eclipse.osee.framework.ui.skynet.widgets.GenericXWidget;
import org.eclipse.osee.framework.ui.skynet.widgets.IArtifactWidget;
-import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
import org.eclipse.osee.framework.ui.swt.ALayout;
import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.IDirtiableEditor;
@@ -62,7 +62,7 @@ import org.eclipse.swt.widgets.Tree;
/**
* @author Donald G. Dunne
*/
-public class XCommitManager extends XWidget implements IArtifactWidget, IBranchEventListener {
+public class XCommitManager extends GenericXWidget implements IArtifactWidget, IBranchEventListener {
private CommitXManager xCommitManager;
private IDirtiableEditor editor;
@@ -253,13 +253,6 @@ public class XCommitManager extends XWidget implements IArtifactWidget, IBranchE
}
@Override
- public void setFocus() {
- if (xCommitManager != null) {
- xCommitManager.getTree().setFocus();
- }
- }
-
- @Override
public void refresh() {
if (xCommitManager == null || xCommitManager.getTree() == null || xCommitManager.getTree().isDisposed()) {
return;
@@ -312,26 +305,6 @@ public class XCommitManager extends XWidget implements IArtifactWidget, IBranchE
return returnStatus;
}
- @Override
- public void setXmlData(String str) {
- // do nothing
- }
-
- @Override
- public String getXmlData() {
- return null;
- }
-
- @Override
- public String toHTML(String labelFont) {
- return "";
- }
-
- @Override
- public String getReportData() {
- return null;
- }
-
/**
* @return Returns the xViewer.
*/
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/XDefectViewer.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/XDefectViewer.java
index d15a8bd..67d4bc2 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/XDefectViewer.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/XDefectViewer.java
@@ -46,8 +46,8 @@ import org.eclipse.osee.framework.ui.plugin.PluginUiImage;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
import org.eclipse.osee.framework.ui.plugin.util.Result;
import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
+import org.eclipse.osee.framework.ui.skynet.widgets.GenericXWidget;
import org.eclipse.osee.framework.ui.skynet.widgets.IArtifactWidget;
-import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
import org.eclipse.osee.framework.ui.skynet.widgets.dialog.EntryDialog;
import org.eclipse.osee.framework.ui.swt.ALayout;
import org.eclipse.osee.framework.ui.swt.Displays;
@@ -77,7 +77,7 @@ import org.eclipse.ui.forms.widgets.ScrolledForm;
/**
* @author Donald G. Dunne
*/
-public class XDefectViewer extends XWidget implements IArtifactWidget, IArtifactEventListener {
+public class XDefectViewer extends GenericXWidget implements IArtifactWidget, IArtifactEventListener {
private DefectXViewer xViewer;
private IDirtiableEditor editor;
@@ -430,11 +430,6 @@ public class XDefectViewer extends XWidget implements IArtifactWidget, IArtifact
}
@Override
- public void setFocus() {
- xViewer.getTree().setFocus();
- }
-
- @Override
public void refresh() {
if (xViewer == null || xViewer.getTree() == null || xViewer.getTree().isDisposed()) {
return;
@@ -474,16 +469,6 @@ public class XDefectViewer extends XWidget implements IArtifactWidget, IArtifact
}
@Override
- public void setXmlData(String str) {
- // do nothing
- }
-
- @Override
- public String getXmlData() {
- return null;
- }
-
- @Override
public String toHTML(String labelFont) {
if (getXViewer().getTree().getItemCount() == 0) {
return "";
@@ -523,11 +508,6 @@ public class XDefectViewer extends XWidget implements IArtifactWidget, IArtifact
return html.toString();
}
- @Override
- public String getReportData() {
- return null;
- }
-
/**
* @return Returns the xViewer.
*/
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/SMAStatusDialog.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/SMAStatusDialog.java
index 6475449..5ea5b75 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/SMAStatusDialog.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/SMAStatusDialog.java
@@ -38,8 +38,8 @@ import org.eclipse.swt.widgets.Shell;
public class SMAStatusDialog extends MessageDialog {
protected Label statusLabel;
- protected XPercent percent = new XPercent("Percent Complete", "");
- protected XFloat hours = new XFloat("Additional Hours Spent", "");
+ protected XPercent percent = new XPercent("Percent Complete");
+ protected XFloat hours = new XFloat("Additional Hours Spent");
protected XRadioButton splitRadio = new XRadioButton("Split Hours Spent between Tasks");
protected XRadioButton eachRadio = new XRadioButton("Apply Hours Spent to each Task");
private Button okButton;
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/XUserRoleViewer.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/XUserRoleViewer.java
index bc6d830..86af28d 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/XUserRoleViewer.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/XUserRoleViewer.java
@@ -43,8 +43,8 @@ import org.eclipse.osee.framework.ui.plugin.PluginUiImage;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
import org.eclipse.osee.framework.ui.plugin.util.Result;
import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
+import org.eclipse.osee.framework.ui.skynet.widgets.GenericXWidget;
import org.eclipse.osee.framework.ui.skynet.widgets.IArtifactWidget;
-import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
import org.eclipse.osee.framework.ui.swt.ALayout;
import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.IDirtiableEditor;
@@ -70,7 +70,7 @@ import org.eclipse.ui.forms.widgets.ScrolledForm;
/**
* @author Donald G. Dunne
*/
-public class XUserRoleViewer extends XWidget implements IArtifactWidget, IArtifactEventListener {
+public class XUserRoleViewer extends GenericXWidget implements IArtifactWidget, IArtifactEventListener {
private UserRoleXViewer xViewer;
private IDirtiableEditor editor;
@@ -83,7 +83,6 @@ public class XUserRoleViewer extends XWidget implements IArtifactWidget, IArtifa
public XUserRoleViewer() {
super("Roles");
-
OseeEventManager.addListener(this);
}
@@ -348,11 +347,6 @@ public class XUserRoleViewer extends XWidget implements IArtifactWidget, IArtifa
}
@Override
- public void setFocus() {
- xViewer.getTree().setFocus();
- }
-
- @Override
public void refresh() {
if (xViewer == null || xViewer.getTree() == null || xViewer.getTree().isDisposed()) {
return;
@@ -388,16 +382,6 @@ public class XUserRoleViewer extends XWidget implements IArtifactWidget, IArtifa
}
@Override
- public void setXmlData(String str) {
- // do nothing
- }
-
- @Override
- public String getXmlData() {
- return null;
- }
-
- @Override
public String toHTML(String labelFont) {
StringBuffer html = new StringBuffer();
try {
@@ -427,11 +411,6 @@ public class XUserRoleViewer extends XWidget implements IArtifactWidget, IArtifa
return html.toString();
}
- @Override
- public String getReportData() {
- return null;
- }
-
/**
* @return Returns the xViewer.
*/
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/xcover/XCoverageViewer.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/xcover/XCoverageViewer.java
index b4aa0a6..cac0c41 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/xcover/XCoverageViewer.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/xcover/XCoverageViewer.java
@@ -14,8 +14,6 @@ package org.eclipse.osee.coverage.editor.xcover;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.osee.coverage.model.CoverageOptionManager;
import org.eclipse.osee.coverage.model.ICoverage;
@@ -26,7 +24,7 @@ import org.eclipse.osee.framework.jdk.core.util.Collections;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
-import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
+import org.eclipse.osee.framework.ui.skynet.widgets.GenericXWidget;
import org.eclipse.osee.framework.ui.swt.ALayout;
import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.swt.SWT;
@@ -40,7 +38,7 @@ import org.eclipse.ui.forms.widgets.ScrolledForm;
/**
* @author Donald G. Dunne
*/
-public class XCoverageViewer extends XWidget {
+public class XCoverageViewer extends GenericXWidget {
protected CoverageXViewer xViewer;
public final static String normalColor = "#EEEEEE";
@@ -177,11 +175,6 @@ public class XCoverageViewer extends XWidget {
}
@Override
- public void setFocus() {
- xViewer.getTree().setFocus();
- }
-
- @Override
public void refresh() {
if (xViewer == null || xViewer.getTree() == null || xViewer.getTree().isDisposed()) {
return;
@@ -190,21 +183,6 @@ public class XCoverageViewer extends XWidget {
}
@Override
- public IStatus isValid() {
- return Status.OK_STATUS;
- }
-
- @Override
- public void setXmlData(String str) {
- // do nothing
- }
-
- @Override
- public String getXmlData() {
- return null;
- }
-
- @Override
public String toHTML(String labelFont) {
if (getXViewer().getTree().getItemCount() == 0) {
return "";
@@ -214,11 +192,6 @@ public class XCoverageViewer extends XWidget {
return html.toString();
}
- @Override
- public String getReportData() {
- return null;
- }
-
public CoverageXViewer getXViewer() {
return xViewer;
}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/navigate/CoverageNavigateView.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/navigate/CoverageNavigateView.java
index 439a05c..6955cb2 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/navigate/CoverageNavigateView.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/navigate/CoverageNavigateView.java
@@ -54,9 +54,13 @@ public class CoverageNavigateView extends ViewPart implements IActionable {
private XNavigateComposite xNavComp;
private XBranchSelectWidget xBranchSelectWidget;
+ private Composite comp;
+
@Override
public void setFocus() {
- // do nothing
+ if (comp != null) {
+ comp.setFocus();
+ }
}
@Override
@@ -67,7 +71,7 @@ public class CoverageNavigateView extends ViewPart implements IActionable {
OseeStatusContributionItemFactory.addTo(this, false);
- Composite comp = new Composite(parent, SWT.None);
+ comp = new Composite(parent, SWT.None);
comp.setLayout(ALayout.getZeroMarginLayout());
comp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
@@ -196,4 +200,4 @@ public class CoverageNavigateView extends ViewPart implements IActionable {
});
}
-} \ No newline at end of file
+}
diff --git a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/navigate/DefineNavigateView.java b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/navigate/DefineNavigateView.java
index 8d27104..49cfaf3 100644
--- a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/navigate/DefineNavigateView.java
+++ b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/navigate/DefineNavigateView.java
@@ -43,6 +43,9 @@ public class DefineNavigateView extends ViewPart implements IActionable {
@Override
public void setFocus() {
+ if (xNavComp != null) {
+ xNavComp.setFocus();
+ }
}
/*
diff --git a/plugins/org.eclipse.osee.framework.database.init/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.framework.database.init/META-INF/MANIFEST.MF
index 058bdb2..5675351 100644
--- a/plugins/org.eclipse.osee.framework.database.init/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.framework.database.init/META-INF/MANIFEST.MF
@@ -10,6 +10,7 @@ Import-Package: org.apache.commons.lang;version="2.4.0",
org.apache.commons.lang.builder,
org.apache.xml.serialize;version="2.9.0",
org.eclipse.core.runtime,
+ org.eclipse.core.runtime.jobs,
org.eclipse.equinox.app,
org.eclipse.osee.framework.core.client,
org.eclipse.osee.framework.core.client.server,
diff --git a/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/text/UtfReadingRuleTest.java b/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/text/UtfReadingRuleTest.java
index b68f496..c27b19a 100644
--- a/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/text/UtfReadingRuleTest.java
+++ b/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/text/UtfReadingRuleTest.java
@@ -102,7 +102,7 @@ public final class UtfReadingRuleTest extends TestCase {
private CharSequence lastOutput;
public Utf8TestRule() {
- this.lastOutput = null;
+ lastOutput = null;
}
@Override
diff --git a/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/Strings.java b/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/Strings.java
index 1486cae..abcea87 100644
--- a/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/Strings.java
+++ b/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/Strings.java
@@ -32,6 +32,17 @@ public class Strings {
return value != null && value.length() > 0;
}
+ public static boolean isValid(String... values) {
+ boolean answer = true;
+ for (String value : values) {
+ if (!isValid(value)) {
+ answer = false;
+ break;
+ }
+ }
+ return answer;
+ }
+
public static boolean isValid(CharSequence value) {
return value != null && value.length() > 0;
}
diff --git a/plugins/org.eclipse.osee.framework.ui.admin/src/org/eclipse/osee/framework/ui/admin/AdminView.java b/plugins/org.eclipse.osee.framework.ui.admin/src/org/eclipse/osee/framework/ui/admin/AdminView.java
index 35cf57c..32dfda8 100644
--- a/plugins/org.eclipse.osee.framework.ui.admin/src/org/eclipse/osee/framework/ui/admin/AdminView.java
+++ b/plugins/org.eclipse.osee.framework.ui.admin/src/org/eclipse/osee/framework/ui/admin/AdminView.java
@@ -56,6 +56,7 @@ public class AdminView extends ViewPart implements IActionable {
private TabFolder tabFolder;
private final ArrayList<DbItem> dbItems;
private final Cursor handCursor;
+ private Composite parentComp;
public AdminView() {
dbItems = new ArrayList<DbItem>();
@@ -71,7 +72,9 @@ public class AdminView extends ViewPart implements IActionable {
@Override
public void setFocus() {
- // do nothing
+ if (parentComp != null) {
+ parentComp.setFocus();
+ }
}
protected void createActions() throws OseeCoreException {
@@ -174,6 +177,7 @@ public class AdminView extends ViewPart implements IActionable {
try {
// IStatusLineManager slManager= getViewSite().getActionBars().getStatusLineManager();
// slManager.setErrorMessage("error");
+ parentComp = parent;
GridData gridData = new GridData();
gridData.verticalAlignment = GridData.FILL;
diff --git a/plugins/org.eclipse.osee.framework.ui.admin/src/org/eclipse/osee/framework/ui/admin/dbtabletab/DbTableTab.java b/plugins/org.eclipse.osee.framework.ui.admin/src/org/eclipse/osee/framework/ui/admin/dbtabletab/DbTableTab.java
index 9f4f884..0224e6e 100644
--- a/plugins/org.eclipse.osee.framework.ui.admin/src/org/eclipse/osee/framework/ui/admin/dbtabletab/DbTableTab.java
+++ b/plugins/org.eclipse.osee.framework.ui.admin/src/org/eclipse/osee/framework/ui/admin/dbtabletab/DbTableTab.java
@@ -66,7 +66,7 @@ public class DbTableTab {
c.setLayoutData(new GridData(GridData.FILL_BOTH));
this.parent = c;
- filterCombo = new XCombo("DB Table", "");
+ filterCombo = new XCombo("DB Table");
filterCombo.setDataStrings(getDbTableNames());
filterCombo.createWidgets(c, 2);
filterCombo.addModifyListener(new ModifyListener() {
diff --git a/plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/core/BranchGraphEditor.java b/plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/core/BranchGraphEditor.java
index a923a3b..f61c3df 100644
--- a/plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/core/BranchGraphEditor.java
+++ b/plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/core/BranchGraphEditor.java
@@ -44,6 +44,7 @@ import org.eclipse.osee.framework.ui.branch.graph.model.GraphCache;
import org.eclipse.osee.framework.ui.branch.graph.operation.LoadGraphOperation;
import org.eclipse.osee.framework.ui.branch.graph.parts.GraphEditPartFactory;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorSite;
import org.eclipse.ui.PartInitException;
@@ -78,6 +79,10 @@ public class BranchGraphEditor extends GraphicalEditorWithFlyoutPalette {
@Override
public void setFocus() {
+ Control control = overviewOutlinePage.getControl();
+ if (control != null) {
+ control.setFocus();
+ }
}
public void showGraphFor(BranchGraphEditorInput editorInput) {
@@ -107,14 +112,16 @@ public class BranchGraphEditor extends GraphicalEditorWithFlyoutPalette {
@Override
public void doSave(IProgressMonitor monitor) {
+ OseeLog.log(BranchGraphEditor.class, Level.WARNING, "method not implemented!");
}
@Override
public void doSaveAs() {
+ OseeLog.log(BranchGraphEditor.class, Level.WARNING, "method not implemented!");
}
@Override
- public void init(IEditorSite site, IEditorInput input) throws PartInitException {
+ public void init(IEditorSite site, IEditorInput input) {
setSite(site);
setInput(input);
}
@@ -204,6 +211,7 @@ public class BranchGraphEditor extends GraphicalEditorWithFlyoutPalette {
@Override
protected void initializeGraphicalViewer() {
+ OseeLog.log(BranchGraphEditor.class, Level.WARNING, "method not implemented!");
}
@Override
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/XWidgetParser.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/XWidgetParser.java
index cbcc25b..745f657 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/XWidgetParser.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/XWidgetParser.java
@@ -83,64 +83,10 @@ public class XWidgetParser {
element.setAttribute("id", data.getId());
element.setAttribute("xwidgetType", data.getXWidgetName());
element.setAttribute("defaultValue", data.getDefaultValue());
+
for (XOption xOption : data.getXOptionHandler().getXOptions()) {
- if (xOption == XOption.ALIGN_CENTER) {
- element.setAttribute("align", "Center");
- } else if (xOption == XOption.NO_LABEL) {
- element.setAttribute("displayLabel", "false");
- } else if (xOption == XOption.ALIGN_LEFT) {
- element.setAttribute("align", "Left");
- } else if (xOption == XOption.ALIGN_RIGHT) {
- element.setAttribute("align", "Right");
- } else if (xOption == XOption.EDITABLE) {
- element.setAttribute("editable", "true");
- } else if (xOption == XOption.BEGIN_COMPOSITE_4) {
- element.setAttribute("beginComposite", "4");
- } else if (xOption == XOption.BEGIN_COMPOSITE_6) {
- element.setAttribute("beginComposite", "6");
- } else if (xOption == XOption.BEGIN_COMPOSITE_8) {
- element.setAttribute("beginComposite", "8");
- } else if (xOption == XOption.BEGIN_COMPOSITE_10) {
- element.setAttribute("beginComposite", "10");
- } else if (xOption == XOption.BEGIN_GROUP_COMPOSITE_4) {
- element.setAttribute("beginGroupComposite", "4");
- } else if (xOption == XOption.BEGIN_GROUP_COMPOSITE_6) {
- element.setAttribute("beginGroupComposite", "6");
- } else if (xOption == XOption.BEGIN_GROUP_COMPOSITE_8) {
- element.setAttribute("beginGroupComposite", "8");
- } else if (xOption == XOption.BEGIN_GROUP_COMPOSITE_10) {
- element.setAttribute("beginGroupComposite", "10");
- } else if (xOption == XOption.END_COMPOSITE) {
- element.setAttribute("endComposite", "true");
- } else if (xOption == XOption.NOT_EDITABLE) {
- element.setAttribute("editable", "false");
- } else if (xOption == XOption.ENABLED) {
- element.setAttribute("enabled", "true");
- } else if (xOption == XOption.NOT_ENABLED) {
- element.setAttribute("enabled", "false");
- } else if (xOption == XOption.REQUIRED) {
- element.setAttribute("required", "true");
- } else if (xOption == XOption.NOT_REQUIRED) {
- element.setAttribute("required", "false");
- } else if (xOption == XOption.FILL_HORIZONTALLY) {
- element.setAttribute("fill", "Horizontally");
- } else if (xOption == XOption.FILL_VERTICALLY) {
- element.setAttribute("fill", "Vertically");
- } else if (xOption == XOption.HORIZONTAL_LABEL) {
- element.setAttribute("horizontalLabel", "true");
- } else if (xOption == XOption.VERTICAL_LABEL) {
- element.setAttribute("horizontalLabel", "false");
- } else if (xOption == XOption.LABEL_AFTER) {
- element.setAttribute("labelAfter", "true");
- } else if (xOption == XOption.LABEL_BEFORE) {
- element.setAttribute("labelAfter", "false");
- } else if (xOption == XOption.MULTI_SELECT) {
- element.setAttribute("multiSelect", "true");
- } else if (xOption == XOption.NONE) {
- // do nothing
- ;
- } else {
- throw new OseeArgumentException("Unhandled xOption [%s]", xOption);
+ if (Strings.isValid(xOption.keyword, xOption.value)) {
+ element.setAttribute(xOption.keyword, xOption.value);
}
}
doc.appendChild(element);
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/AbstractBlam.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/AbstractBlam.java
index 7c2cc5b..6b9b6ff 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/AbstractBlam.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/AbstractBlam.java
@@ -12,18 +12,22 @@
package org.eclipse.osee.framework.ui.skynet.blam;
import java.io.IOException;
+import java.io.InputStream;
import java.util.Collection;
import java.util.List;
import java.util.logging.Level;
import javax.xml.parsers.ParserConfigurationException;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.core.runtime.jobs.JobChangeAdapter;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.exception.OseeExceptions;
import org.eclipse.osee.framework.core.operation.IOperation;
import org.eclipse.osee.framework.core.operation.Operations;
import org.eclipse.osee.framework.database.IOseeDatabaseService;
+import org.eclipse.osee.framework.jdk.core.util.Lib;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
@@ -36,6 +40,7 @@ import org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayou
import org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayoutData;
import org.eclipse.osee.framework.ui.skynet.widgets.workflow.IDynamicWidgetLayoutListener;
import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.osgi.framework.Bundle;
import org.xml.sax.SAXException;
/**
@@ -56,10 +61,35 @@ public abstract class AbstractBlam implements IDynamicWidgetLayoutListener {
*/
public abstract Collection<String> getCategories();
- public String getXWidgetsXml() {
+ public String getXWidgetsXml() throws OseeCoreException {
return AbstractBlam.branchXWidgetXml;
}
+ /**
+ * Expects the {@code <className>} of blam. Gets {@code /bundleName/ui/<className>Ui.xml } and returns its contents.
+ *
+ * @param className class name of blam
+ * @param nameOfBundle name of bundle i.e. org.eclipse.rcp.xyz
+ * @return contents of the {@code /bundleName/ui/<className>Ui.xml }
+ * @throws OseeCoreException usually {@link IOException} or {@link NullPointerException} wrapped in
+ * {@link OseeCoreException}
+ */
+ public String getXWidgetsXmlFromUiFile(String className, String nameOfBundle) throws OseeCoreException {
+ String file = String.format("ui/%sUi.xml", className);
+ Bundle bundle = Platform.getBundle(nameOfBundle);
+
+ String contents = null;
+ try {
+ InputStream inStream = bundle.getEntry(file).openStream();
+ contents = Lib.inputStreamToString(inStream);
+ } catch (IOException ex) {
+ OseeExceptions.wrapAndThrow(ex);
+ contents = "";
+ }
+
+ return contents;
+ }
+
public String getDescriptionUsage() {
return "Select parameters below and click the play button at the top right.";
}
@@ -81,9 +111,9 @@ public abstract class AbstractBlam implements IDynamicWidgetLayoutListener {
}
public void print(String value) {
- if (this.output != null && value != null) {
+ if (output != null && value != null) {
try {
- this.output.append(value);
+ output.append(value);
} catch (IOException ex) {
OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/XWidgetsExampleBlam.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/XWidgetsExampleBlam.java
index 6fea9d3..9e01e42 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/XWidgetsExampleBlam.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/XWidgetsExampleBlam.java
@@ -13,6 +13,8 @@ package org.eclipse.osee.framework.ui.skynet.blam.operation;
import java.util.Arrays;
import java.util.Collection;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
import org.eclipse.osee.framework.ui.skynet.blam.AbstractBlam;
import org.eclipse.osee.framework.ui.skynet.blam.VariableMap;
@@ -21,7 +23,6 @@ import org.eclipse.osee.framework.ui.skynet.blam.VariableMap;
* @author Karol M Wilk
*/
public class XWidgetsExampleBlam extends AbstractBlam {
-
@Override
public String getName() {
return "XWidgets Example";
@@ -38,17 +39,8 @@ public class XWidgetsExampleBlam extends AbstractBlam {
}
@Override
- public String getXWidgetsXml() {
- return "<xWidgets>" + //
- "<XWidget xwidgetType=\"XLabel\" displayName=\"XLabel\" />" + //
- "<XWidget xwidgetType=\"XCheckBox\" horizontalLabel=\"true\" labelAfter=\"false\" displayName=\"XCheckBox\" />" + //
- "<XWidget xwidgetType=\"XText\" displayName=\"XText\" />" + //
- "<XWidget xwidgetType=\"XBranchSelectWidget\" horizontalLabel=\"true\" displayName=\"Branch\" />" + //
- "<XWidget xwidgetType=\"XArtifactTypeComboViewer\" horizontalLabel=\"true\" displayName=\"XArtifactTypeComboViewer\" />" + //
- "<XWidget xwidgetType=\"XArtifactTypeMultiChoiceSelect\" horizontalLabel=\"true\" displayName=\"XArtifactTypeMultiChoiceSelect\" />" + //
- "<XWidget xwidgetType=\"XAttributeTypeComboViewer\" horizontalLabel=\"true\" displayName=\"XAttributeTypeComboViewer\" />" + //
- "<XWidget xwidgetType=\"XAttributeTypeMultiChoiceSelect\" horizontalLabel=\"true\" displayName=\"XAttributeTypeMultiChoiceSelect\" />" + //
- "</xWidgets>";
+ public String getXWidgetsXml() throws OseeCoreException {
+ return getXWidgetsXmlFromUiFile(getClass().getSimpleName(), SkynetGuiPlugin.PLUGIN_ID);
}
@Override
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/group/GroupExplorer.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/group/GroupExplorer.java
index 93ec612..bdeb4ab 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/group/GroupExplorer.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/group/GroupExplorer.java
@@ -84,6 +84,7 @@ public class GroupExplorer extends ViewPart implements IArtifactEventListener, I
private GroupExplorerDragAndDrop groupExpDnd;
private NeedProjectMenuListener needProjectListener;
+ private Composite parentComp;
@Override
public void createPartControl(Composite parent) {
@@ -102,13 +103,15 @@ public class GroupExplorer extends ViewPart implements IArtifactEventListener, I
gridData.heightHint = 1000;
gridData.widthHint = 1000;
- parent.setLayout(gridLayout);
- parent.setLayoutData(gridData);
+ parentComp = parent;
+
+ parentComp.setLayout(gridLayout);
+ parentComp.setLayoutData(gridData);
branchSelect = new XBranchSelectWidget("");
branchSelect.setDisplayLabel(false);
branchSelect.setSelection(branch);
- branchSelect.createWidgets(parent, 1);
+ branchSelect.createWidgets(parentComp, 1);
branchSelect.addListener(new Listener() {
@Override
@@ -124,7 +127,7 @@ public class GroupExplorer extends ViewPart implements IArtifactEventListener, I
});
- treeViewer = new GroupTreeViewer(this, parent);
+ treeViewer = new GroupTreeViewer(this, parentComp);
treeViewer.setContentProvider(new GroupContentProvider());
treeViewer.setLabelProvider(new GroupLabelProvider());
treeViewer.setUseHashlookup(true);
@@ -138,20 +141,15 @@ public class GroupExplorer extends ViewPart implements IArtifactEventListener, I
groupExpDnd = new GroupExplorerDragAndDrop(treeViewer, VIEW_ID, branch);
getSite().setSelectionProvider(treeViewer);
- parent.layout();
+ parentComp.layout();
createActions();
getViewSite().getActionBars().updateActionBars();
- setupPopupMenu();
+ rebuildMenu();
refresh();
}
@Override
public void rebuildMenu() {
- setupPopupMenu();
- }
-
- public void setupPopupMenu() {
-
Menu popupMenu = new Menu(treeViewer.getTree().getParent());
needProjectListener = new NeedProjectMenuListener();
popupMenu.addMenuListener(needProjectListener);
@@ -362,7 +360,9 @@ public class GroupExplorer extends ViewPart implements IArtifactEventListener, I
@Override
public void setFocus() {
- // do nothing
+ if (parentComp != null) {
+ parentComp.setFocus();
+ }
}
public void refresh() {
@@ -498,4 +498,4 @@ public class GroupExplorer extends ViewPart implements IArtifactEventListener, I
}
-} \ No newline at end of file
+}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/search/QuickSearchView.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/search/QuickSearchView.java
index ed793c0..76eafa3 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/search/QuickSearchView.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/search/QuickSearchView.java
@@ -25,7 +25,6 @@ import org.eclipse.osee.framework.core.message.SearchRequest;
import org.eclipse.osee.framework.core.model.Branch;
import org.eclipse.osee.framework.help.ui.OseeHelpContext;
import org.eclipse.osee.framework.jdk.core.util.Strings;
-import org.eclipse.osee.framework.plugin.core.IActionable;
import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
import org.eclipse.osee.framework.ui.plugin.OseeUiActions;
import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
@@ -33,6 +32,7 @@ import org.eclipse.osee.framework.ui.skynet.OseeStatusContributionItemFactory;
import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
import org.eclipse.osee.framework.ui.skynet.panels.SearchComposite;
import org.eclipse.osee.framework.ui.skynet.util.DbConnectionExceptionComposite;
+import org.eclipse.osee.framework.ui.skynet.widgets.GenericViewPart;
import org.eclipse.osee.framework.ui.skynet.widgets.XBranchSelectWidget;
import org.eclipse.osee.framework.ui.swt.ALayout;
import org.eclipse.osee.framework.ui.swt.ImageManager;
@@ -50,13 +50,12 @@ import org.eclipse.swt.widgets.Listener;
import org.eclipse.ui.IMemento;
import org.eclipse.ui.IViewSite;
import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.part.ViewPart;
/**
* @author Robert A. Fisher
* @author Ryan D. Brooks
*/
-public class QuickSearchView extends ViewPart implements IActionable, Listener {
+public class QuickSearchView extends GenericViewPart implements Listener {
public static final String VIEW_ID = "org.eclipse.osee.framework.ui.skynet.QuickSearchView";
private static final String ENTRY_SEPARATOR = "##";
@@ -188,6 +187,8 @@ public class QuickSearchView extends ViewPart implements IActionable, Listener {
branchLabel.setText("");
createClearHistoryAction();
+
+ setFocusWidget(searchComposite);
}
private void createClearHistoryAction() {
@@ -216,18 +217,6 @@ public class QuickSearchView extends ViewPart implements IActionable, Listener {
}
}
- @Override
- public void setFocus() {
- if (searchComposite != null) {
- searchComposite.setFocus();
- }
- }
-
- @Override
- public String getActionDescription() {
- return "";
- }
-
public void setBranch(Branch branch) {
if (branchSelect != null) {
branchSelect.setSelection(branch);
@@ -268,9 +257,4 @@ public class QuickSearchView extends ViewPart implements IActionable, Listener {
}
}
}
-
- @Override
- public void dispose() {
- super.dispose();
- }
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/skywalker/SkyWalkerView.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/skywalker/SkyWalkerView.java
index 074500f..b2acaf8 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/skywalker/SkyWalkerView.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/skywalker/SkyWalkerView.java
@@ -41,6 +41,7 @@ import org.eclipse.osee.framework.ui.skynet.ArtifactDoubleClick;
import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
import org.eclipse.osee.framework.ui.skynet.util.ImageCapture;
+import org.eclipse.osee.framework.ui.skynet.widgets.GenericViewPart;
import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.ImageManager;
import org.eclipse.swt.SWT;
@@ -54,7 +55,6 @@ import org.eclipse.ui.IViewSite;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.ViewPart;
import org.eclipse.zest.core.viewers.GraphViewer;
import org.eclipse.zest.core.widgets.GraphItem;
import org.eclipse.zest.core.widgets.GraphNode;
@@ -64,7 +64,7 @@ import org.eclipse.zest.core.widgets.ZestStyles;
* @author Robert A. Fisher
* @author Donald G. Dunne
*/
-public class SkyWalkerView extends ViewPart {
+public class SkyWalkerView extends GenericViewPart {
public static final String VIEW_ID = "org.eclipse.osee.framework.ui.skynet.skywalker.SkyWalkerView";
protected GraphViewer viewer;
private static final String INPUT_KEY = "input";
@@ -162,6 +162,8 @@ public class SkyWalkerView extends ViewPart {
HelpUtil.setHelp(viewer.getControl(), OseeHelpContext.SKY_WALKER_VIEW);
HelpUtil.setHelp(tabOptions.getControl(), OseeHelpContext.SKY_WALKER_VIEW);
+
+ setFocusWidget(viewer.getControl());
}
protected void createActions() {
@@ -289,15 +291,6 @@ public class SkyWalkerView extends ViewPart {
}
}
- @Override
- public void setFocus() {
- viewer.getControl().setFocus();
- }
-
- public String getActionDescription() {
- return "";
- }
-
public void explore(Artifact artifact) {
explore(artifact, false);
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/skywalker/arttype/ArtifactTypeWalker.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/skywalker/arttype/ArtifactTypeWalker.java
index 16af4dc..ff95cf8 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/skywalker/arttype/ArtifactTypeWalker.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/skywalker/arttype/ArtifactTypeWalker.java
@@ -27,13 +27,13 @@ import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager;
import org.eclipse.osee.framework.ui.plugin.PluginUiImage;
import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
import org.eclipse.osee.framework.ui.skynet.util.ArtifactTypeLabelProvider;
+import org.eclipse.osee.framework.ui.skynet.widgets.GenericViewPart;
import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.ImageManager;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.part.ViewPart;
import org.eclipse.zest.core.viewers.GraphViewer;
import org.eclipse.zest.core.widgets.GraphItem;
import org.eclipse.zest.core.widgets.GraphNode;
@@ -44,7 +44,7 @@ import org.eclipse.zest.layouts.algorithms.RadialLayoutAlgorithm;
/**
* @author Donald G. Dunne
*/
-public class ArtifactTypeWalker extends ViewPart {
+public class ArtifactTypeWalker extends GenericViewPart {
public static final String VIEW_ID = "org.eclipse.osee.framework.ui.skynet.skywalker.ArtifactTypeWalkerView";
protected GraphViewer viewer;
private Composite viewerComp;
@@ -82,6 +82,8 @@ public class ArtifactTypeWalker extends ViewPart {
});
createActions();
refresh();
+
+ setFocusWidget(viewer.getControl());
}
private void explore(ArtifactType artifactType) {
@@ -132,14 +134,4 @@ public class ArtifactTypeWalker extends ViewPart {
OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
}
}
-
- @Override
- public void setFocus() {
- viewer.getControl().setFocus();
- }
-
- public String getActionDescription() {
- return "";
- }
-
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/GenericViewPart.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/GenericViewPart.java
new file mode 100644
index 0000000..c8b6a9b
--- /dev/null
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/GenericViewPart.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.ui.skynet.widgets;
+
+import org.eclipse.osee.framework.plugin.core.IActionable;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.part.ViewPart;
+
+/**
+ * This class provides &quot;general&quot; functionality to widgets having the need to override ViewPart methods and
+ * providing blank functionality. Subclasses must call setFocusWidget() in their implementation for createPartControl <br/>
+ *
+ * @author Karol M. Wilk
+ */
+public abstract class GenericViewPart extends ViewPart implements IActionable {
+ private Control focusWidget;
+
+ @Override
+ public void setFocus() {
+ if (focusWidget != null && !focusWidget.isDisposed()) {
+ focusWidget.setFocus();
+ }
+ }
+
+ @Override
+ public String getActionDescription() {
+ return "";
+ }
+
+ /**
+ * @param general way to handle a widget that will be called when a focus event is received
+ */
+ protected void setFocusWidget(Control widget) {
+ focusWidget = widget;
+ }
+}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/GenericXWidget.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/GenericXWidget.java
new file mode 100644
index 0000000..aea3a9c
--- /dev/null
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/GenericXWidget.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.ui.skynet.widgets;
+
+import org.eclipse.osee.framework.plugin.core.IActionable;
+import org.eclipse.swt.widgets.Control;
+
+public abstract class GenericXWidget extends XWidget implements IActionable {
+
+ public GenericXWidget() {
+ this("");
+ }
+
+ public GenericXWidget(String label) {
+ super(label);
+ }
+
+ /**
+ * Subclasses must provide implementation of getControl() that returns appropriate widget.
+ */
+ @Override
+ public void setFocus() {
+ Control control = getControl();
+ if (control != null && !control.isDisposed()) {
+ control.setFocus();
+ }
+ }
+
+ @Override
+ public String getActionDescription() {
+ return "";
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XArtifactList.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XArtifactList.java
index 81a4080..72f1258 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XArtifactList.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XArtifactList.java
@@ -23,18 +23,10 @@ import org.eclipse.osee.framework.ui.skynet.ArtifactLabelProvider;
*/
public class XArtifactList extends XListViewer {
- public XArtifactList() {
- this("ArtList", "", "");
- }
-
public XArtifactList(String displayLabel) {
- this(displayLabel, "", "");
- }
-
- public XArtifactList(String displayLabel, String xmlRoot, String xmlSubRoot) {
- super(displayLabel, xmlRoot, xmlSubRoot);
- super.setLabelProvider(new ArtifactLabelProvider());
- super.setContentProvider(new ArrayContentProvider());
+ super(displayLabel);
+ setLabelProvider(new ArtifactLabelProvider());
+ setContentProvider(new ArrayContentProvider());
}
public Collection<Artifact> getSelectedArtifacts() {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XBranchSelectComboWidget.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XBranchSelectComboWidget.java
index 90d63c6..8b13a2e 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XBranchSelectComboWidget.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XBranchSelectComboWidget.java
@@ -32,7 +32,7 @@ import org.eclipse.swt.widgets.Listener;
/**
* @author Roberto E. Escobar
*/
-public class XBranchSelectComboWidget extends XWidget implements Listener {
+public class XBranchSelectComboWidget extends GenericXWidget implements Listener {
public static final String WIDGET_ID = XBranchSelectWidget.class.getSimpleName();
private BranchSelectSimpleComposite selectComposite;
@@ -104,12 +104,6 @@ public class XBranchSelectComboWidget extends XWidget implements Listener {
}
@Override
- public String getXmlData() {
- System.out.println("Get XML Data Called: ");
- return "";
- }
-
- @Override
public IStatus isValid() {
if (selectComposite.getSelectedBranch() == null) {
return new Status(IStatus.ERROR, SkynetGuiPlugin.PLUGIN_ID, "Must select a Branch");
@@ -118,27 +112,6 @@ public class XBranchSelectComboWidget extends XWidget implements Listener {
}
@Override
- public void refresh() {
- // do nothing
- }
-
- @Override
- public void setFocus() {
- selectComposite.setFocus();
- }
-
- @Override
- public void setXmlData(String str) {
- System.out.println("Set XML Data Called: " + str);
- }
-
- @Override
- public String toHTML(String labelFont) {
- System.out.println("Set to Html Called: " + labelFont);
- return "";
- }
-
- @Override
public void setDisplayLabel(final String displayLabel) {
Displays.ensureInDisplayThread(new Runnable() {
@Override
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XBranchSelectWidget.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XBranchSelectWidget.java
index e36c174..207a573 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XBranchSelectWidget.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XBranchSelectWidget.java
@@ -33,7 +33,7 @@ import org.eclipse.swt.widgets.Listener;
* @author Roberto E. Escobar
* @author Donald G. Dunne
*/
-public class XBranchSelectWidget extends XWidget implements Listener {
+public class XBranchSelectWidget extends GenericXWidget implements Listener {
public static final String WIDGET_ID = XBranchSelectWidget.class.getSimpleName();
private BranchSelectComposite selectComposite;
@@ -108,12 +108,6 @@ public class XBranchSelectWidget extends XWidget implements Listener {
}
@Override
- public String getXmlData() {
- System.out.println("Get XML Data Called: ");
- return "";
- }
-
- @Override
public IStatus isValid() {
if (selectComposite.getSelectedBranch() == null) {
return new Status(IStatus.ERROR, SkynetGuiPlugin.PLUGIN_ID, "Must select a Branch");
@@ -122,27 +116,11 @@ public class XBranchSelectWidget extends XWidget implements Listener {
}
@Override
- public void refresh() {
- // do nothing
- }
-
- @Override
public void setFocus() {
selectComposite.setFocus();
}
@Override
- public void setXmlData(String str) {
- System.out.println("Set XML Data Called: " + str);
- }
-
- @Override
- public String toHTML(String labelFont) {
- System.out.println("Set to Html Called: " + labelFont);
- return "";
- }
-
- @Override
public void setDisplayLabel(final String displayLabel) {
Displays.ensureInDisplayThread(new Runnable() {
@Override
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XButton.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XButton.java
index 8258396..3290825 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XButton.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XButton.java
@@ -10,8 +10,6 @@
*******************************************************************************/
package org.eclipse.osee.framework.ui.skynet.widgets;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
import org.eclipse.osee.framework.jdk.core.util.AHTML;
import org.eclipse.osee.framework.ui.swt.ALayout;
import org.eclipse.osee.framework.ui.swt.CursorManager;
@@ -27,26 +25,19 @@ import org.eclipse.swt.widgets.Listener;
/**
* @author Donald G. Dunne
*/
-public class XButton extends XWidget {
+public class XButton extends XButtonCommon {
protected Label button;
private Composite parent;
private Composite bComp;
- protected boolean selected = false;
private boolean labelAfter = true;
- private Image image;
-
- public XButton(String displayLabel, String xmlRoot) {
- super(displayLabel, xmlRoot);
- }
public XButton(String displayLabel) {
- this(displayLabel, "");
+ super(displayLabel);
}
public XButton(String displayLabel, Image image) {
- this(displayLabel, "");
- this.image = image;
+ super(displayLabel, image);
}
@Override
@@ -116,7 +107,7 @@ public class XButton extends XWidget {
}
}
button.setLayoutData(gd);
- updateCheckWidget();
+ validate();
button.setEnabled(isEditable());
if (image != null) {
button.setImage(image);
@@ -136,49 +127,6 @@ public class XButton extends XWidget {
}
@Override
- public void setFocus() {
- return;
- }
-
- @Override
- public String getXmlData() {
- return "";
- }
-
- @Override
- public String getReportData() {
- return getXmlData();
- }
-
- @Override
- public void setXmlData(String set) {
- if (set.equals("true")) {
- set(true);
- } else {
- set(false);
- }
- }
-
- private void updateCheckWidget() {
- validate();
- }
-
- public void set(boolean selected) {
- this.selected = selected;
- updateCheckWidget();
- }
-
- @Override
- public void refresh() {
- updateCheckWidget();
- }
-
- @Override
- public IStatus isValid() {
- return Status.OK_STATUS;
- }
-
- @Override
public String toHTML(String labelFont) {
return AHTML.getLabelStr(labelFont, getLabel() + ": ") + selected;
}
@@ -194,17 +142,9 @@ public class XButton extends XWidget {
return button;
}
- public boolean isSelected() {
- return selected;
- }
-
@Override
public Object getData() {
return Boolean.valueOf(isSelected());
}
- public void setImage(Image image) {
- this.image = image;
- }
-
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XButtonCommon.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XButtonCommon.java
new file mode 100644
index 0000000..cb04b3f
--- /dev/null
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XButtonCommon.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.ui.skynet.widgets;
+
+import org.eclipse.osee.framework.jdk.core.util.AHTML;
+import org.eclipse.swt.graphics.Image;
+
+public abstract class XButtonCommon extends GenericXWidget {
+ protected boolean selected = false;
+ protected Image image;
+
+ public XButtonCommon() {
+ this("");
+ }
+
+ public XButtonCommon(String displayLabel) {
+ super(displayLabel);
+ }
+
+ public XButtonCommon(String displayLabel, Image image) {
+ this(displayLabel);
+ this.image = image;
+ }
+
+ @Override
+ public void refresh() {
+ updateCheckWidget();
+ }
+
+ public void set(boolean selected) {
+ this.selected = selected;
+ updateCheckWidget();
+ }
+
+ private void updateCheckWidget() {
+ validate();
+ }
+
+ public void setImage(Image image) {
+ this.image = image;
+ }
+
+ public boolean isSelected() {
+ return selected;
+ }
+
+ @Override
+ public Object getData() {
+ return Boolean.valueOf(isSelected());
+ }
+
+ @Override
+ public String toHTML(String labelFont) {
+ return AHTML.getLabelStr(labelFont, getLabel() + ": ") + selected;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XButtonPush.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XButtonPush.java
index 81d453e..55161f0 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XButtonPush.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XButtonPush.java
@@ -10,9 +10,6 @@
*******************************************************************************/
package org.eclipse.osee.framework.ui.skynet.widgets;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.osee.framework.jdk.core.util.AHTML;
import org.eclipse.osee.framework.ui.swt.ALayout;
import org.eclipse.osee.framework.ui.swt.CursorManager;
import org.eclipse.swt.SWT;
@@ -28,7 +25,7 @@ import org.eclipse.swt.widgets.Listener;
/**
* @author Donald G. Dunne
*/
-public class XButtonPush extends XWidget {
+public class XButtonPush extends GenericXWidget {
protected Button button;
private Composite parent;
@@ -37,17 +34,8 @@ public class XButtonPush extends XWidget {
private boolean labelAfter = true;
private Image image;
- public XButtonPush(String displayLabel, String xmlRoot) {
- super(displayLabel, xmlRoot);
- }
-
public XButtonPush(String displayLabel) {
- this(displayLabel, "");
- }
-
- public XButtonPush(String displayLabel, Image image) {
- this(displayLabel, "");
- this.image = image;
+ super(displayLabel);
}
@Override
@@ -117,7 +105,7 @@ public class XButtonPush extends XWidget {
}
}
button.setLayoutData(gd);
- updateCheckWidget();
+ validate();
button.setEnabled(isEditable());
button.setText(getLabel());
if (image != null) {
@@ -137,54 +125,6 @@ public class XButtonPush extends XWidget {
}
}
- @Override
- public void setFocus() {
- return;
- }
-
- @Override
- public String getXmlData() {
- return "";
- }
-
- @Override
- public String getReportData() {
- return getXmlData();
- }
-
- @Override
- public void setXmlData(String set) {
- if (set.equals("true")) {
- set(true);
- } else {
- set(false);
- }
- }
-
- private void updateCheckWidget() {
- validate();
- }
-
- public void set(boolean selected) {
- this.selected = selected;
- updateCheckWidget();
- }
-
- @Override
- public void refresh() {
- updateCheckWidget();
- }
-
- @Override
- public IStatus isValid() {
- return Status.OK_STATUS;
- }
-
- @Override
- public String toHTML(String labelFont) {
- return AHTML.getLabelStr(labelFont, getLabel() + ": ") + selected;
- }
-
/**
* If set, label will be displayed after the button NOTE: Has to be set before call to createWidgets
*/
@@ -195,18 +135,4 @@ public class XButtonPush extends XWidget {
public Button getbutton() {
return button;
}
-
- public boolean isSelected() {
- return selected;
- }
-
- @Override
- public Object getData() {
- return Boolean.valueOf(isSelected());
- }
-
- public void setImage(Image image) {
- this.image = image;
- }
-
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XCheckBox.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XCheckBox.java
index da3b12e..1075ca3 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XCheckBox.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XCheckBox.java
@@ -10,9 +10,6 @@
*******************************************************************************/
package org.eclipse.osee.framework.ui.skynet.widgets;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.osee.framework.jdk.core.util.AHTML;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
@@ -26,19 +23,15 @@ import org.eclipse.swt.widgets.Label;
/**
* @author Donald G. Dunne
*/
-public class XCheckBox extends XWidget {
+public class XCheckBox extends XButtonCommon {
protected Button checkButton;
private Composite parent;
protected boolean selected = false;
private boolean labelAfter = true;
- public XCheckBox(String displayLabel, String xmlRoot) {
- super(displayLabel, xmlRoot);
- }
-
public XCheckBox(String displayLabel) {
- this(displayLabel, "");
+ super(displayLabel);
}
@Override
@@ -107,34 +100,6 @@ public class XCheckBox extends XWidget {
}
}
- @Override
- public void setFocus() {
- return;
- }
-
- @Override
- public String getXmlData() {
- if (isChecked()) {
- return "true";
- } else {
- return "false";
- }
- }
-
- @Override
- public String getReportData() {
- return getXmlData();
- }
-
- @Override
- public void setXmlData(String set) {
- if (set.equals("true")) {
- set(true);
- } else {
- set(false);
- }
- }
-
public void addSelectionListener(SelectionListener selectionListener) {
checkButton.addSelectionListener(selectionListener);
}
@@ -154,26 +119,6 @@ public class XCheckBox extends XWidget {
validate();
}
- public void set(boolean selected) {
- this.selected = selected;
- updateCheckWidget();
- }
-
- @Override
- public void refresh() {
- updateCheckWidget();
- }
-
- @Override
- public IStatus isValid() {
- return Status.OK_STATUS;
- }
-
- @Override
- public String toHTML(String labelFont) {
- return AHTML.getLabelStr(labelFont, getLabel() + ": ") + selected;
- }
-
/**
* If set, label will be displayed after the check box NOTE: Has to be set before call to createWidgets
*
@@ -186,13 +131,4 @@ public class XCheckBox extends XWidget {
public Button getCheckButton() {
return checkButton;
}
-
- public boolean isSelected() {
- return selected;
- }
-
- @Override
- public Object getData() {
- return Boolean.valueOf(isSelected());
- }
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XCombo.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XCombo.java
index e088ef0..30fe1ae 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XCombo.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XCombo.java
@@ -11,14 +11,10 @@
package org.eclipse.osee.framework.ui.skynet.widgets;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.Map;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.osee.framework.jdk.core.util.AHTML;
-import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
@@ -32,7 +28,7 @@ import org.eclipse.swt.widgets.Label;
/**
* @author Donald G. Dunne
*/
-public class XCombo extends XWidget {
+public class XCombo extends XButtonCommon {
private Combo dataCombo;
private Composite parent;
@@ -40,21 +36,12 @@ public class XCombo extends XWidget {
protected String[] inDataStrings; // Strings sent in for display
//
private final Map<String, Integer> displayDataStrings = new HashMap<String, Integer>();
- protected Map<String, String> dataStringToXmlString;
private String displayArray[];
private boolean isDefaultSelectionAllowed;
- public XCombo(String displayLabel, String xmlRoot, String xmlSubRoot) {
- super(displayLabel, xmlRoot, xmlSubRoot);
- isDefaultSelectionAllowed = true;
- }
-
- public XCombo(String displayLabel, String xmlRoot) {
- this(displayLabel, xmlRoot, "");
- }
-
public XCombo(String displayLabel) {
- this(displayLabel, "", "");
+ super(displayLabel);
+ isDefaultSelectionAllowed = true;
}
public void setDefaultSelectionAllowed(boolean isAllowed) {
@@ -201,57 +188,6 @@ public class XCombo extends XWidget {
}
@Override
- public void setFocus() {
- if (dataCombo != null) {
- dataCombo.setFocus();
- }
- }
-
- public void setDataStringToXmlTranslations(Map<String, String> dataStringToXmlString) {
- this.dataStringToXmlString = dataStringToXmlString;
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public void setFromXml(String xml) throws IllegalStateException {
- Matcher m;
- if (getXmlSubRoot().equals("")) {
- m =
- Pattern.compile("<" + getXmlRoot() + ">(.*?)</" + getXmlRoot() + ">", Pattern.MULTILINE | Pattern.DOTALL).matcher(
- xml);
- } else {
- m =
- Pattern.compile(
- "<" + getXmlRoot() + "><" + getXmlSubRoot() + ">(.*?)</" + getXmlSubRoot() + "></" + getXmlRoot() + ">",
- Pattern.MULTILINE | Pattern.DOTALL).matcher(xml);
- }
- while (m.find()) {
- String str = m.group(1);
- String transStr = null;
- // If translation given, translate back to display string
- // ie. bems number => full name
- if (dataStringToXmlString != null) {
- if (dataStringToXmlString.containsValue(str)) {
- for (Iterator<?> iter = dataStringToXmlString.entrySet().iterator(); iter.hasNext();) {
- Map.Entry<String, String> entry = (Map.Entry<String, String>) iter.next();
- if (str.equals(entry.getValue())) {
- transStr = entry.getKey();
- break;
- }
- }
- }
- }
- if (transStr != null) {
- set(transStr);
- } else {
- set(str);
- }
- break;
- }
- refresh();
- }
-
- @Override
public void refresh() {
updateComboWidget();
}
@@ -273,37 +209,11 @@ public class XCombo extends XWidget {
return data;
}
- /**
- * @return returns translated xml value (eg. 727536)
- */
- public String getXml() {
- String s = "";
- if (dataStringToXmlString == null) {
- s = data;
- } else {
- s = dataStringToXmlString.get(data);
- if (s == null) {
- s = data;
- }
- }
- return s;
- }
-
@Override
public String getReportData() {
return data;
}
- @Override
- public String getXmlData() {
- return getReportData();
- }
-
- @Override
- public void setXmlData(String str) {
- // do nothing
- }
-
private void updateComboWidget() {
if (dataCombo != null && !dataCombo.isDisposed()) {
if (displayDataStrings.containsKey(data)) {
@@ -359,23 +269,6 @@ public class XCombo extends XWidget {
}
@Override
- protected String toXml() {
- return toXml(getXmlRoot());
- }
-
- @Override
- protected String toXml(String xmlRoot) {
- String s;
- String dataStr = getXml();
- if (!Strings.isValid(getXmlSubRoot())) {
- s = "<" + xmlRoot + ">" + dataStr + "</" + xmlRoot + ">\n";
- } else {
- s = "<" + xmlRoot + "><" + getXmlSubRoot() + ">" + dataStr + "</" + getXmlSubRoot() + "></" + xmlRoot + ">\n";
- }
- return s;
- }
-
- @Override
public String toHTML(String labelFont) {
return AHTML.getLabelStr(labelFont, getLabel() + ": ") + data;
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XComboViewer.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XComboViewer.java
index 31d516a..b3b4fbc 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XComboViewer.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XComboViewer.java
@@ -40,7 +40,7 @@ import org.eclipse.swt.widgets.Label;
/**
* @author Donald G. Dunne
*/
-public class XComboViewer extends XWidget {
+public class XComboViewer extends GenericXWidget {
private ComboViewer comboViewer;
private Composite parent;
@@ -67,15 +67,7 @@ public class XComboViewer extends XWidget {
private int heightHint;
public XComboViewer(String displayLabel) {
- this(displayLabel, "list", "");
- }
-
- public XComboViewer() {
- this("List", "list", "");
- }
-
- public XComboViewer(String displayLabel, String xmlRoot, String xmlSubRoot) {
- super(displayLabel, xmlRoot, xmlSubRoot);
+ super(displayLabel);
contentProvider = new ArrayContentProvider();
labelProvider = new ArtifactLabelProvider();
}
@@ -191,27 +183,6 @@ public class XComboViewer extends XWidget {
}
}
- @Override
- public void setFocus() {
- // do nothing
- }
-
- /**
- * Don't need this since overriding toReport and toXml
- */
- @Override
- public String getXmlData() {
- return "";
- }
-
- /**
- * Don't need this since overriding setFromXml
- */
- @Override
- public void setXmlData(String str) {
- return;
- }
-
private void handleSelection() {
validate();
notifyXModifiedListeners();
@@ -235,11 +206,6 @@ public class XComboViewer extends XWidget {
return null;
}
- @Override
- public void setFromXml(String xml) {
- // do nothing
- }
-
public Combo getCombo() {
return comboViewer.getCombo();
}
@@ -290,16 +256,6 @@ public class XComboViewer extends XWidget {
}
@Override
- public String toXml() {
- return toXml(getXmlRoot(), getXmlSubRoot());
- }
-
- @Override
- public String toXml(String xmlRoot, String xmlSubRoot) {
- return "";
- }
-
- @Override
public String toHTML(String labelFont) {
String s = "<dl><dt>" + AHTML.getLabelStr(labelFont, getLabel() + ": ") + "<dt><ul type=\"disc\">";
Object xItem = getSelected();
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XDate.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XDate.java
index 8c779c2..9376d3a 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XDate.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XDate.java
@@ -15,8 +15,6 @@ import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.nebula.widgets.calendarcombo.CalendarCombo;
@@ -45,21 +43,13 @@ public class XDate extends XWidget {
private Composite parent;
protected Date date;
- public XDate() {
- this("", "");
- }
-
public XDate(Date date) {
- this("", "");
+ super("");
this.date = date;
}
public XDate(String displayLabel) {
- this(displayLabel, "");
- }
-
- public XDate(String displayLabel, String xmlRoot) {
- super(displayLabel, xmlRoot);
+ super(displayLabel);
date = null;
}
@@ -133,22 +123,6 @@ public class XDate extends XWidget {
}
}
- @Override
- public void setFromXml(String xml) {
- Matcher m =
- Pattern.compile("<" + getXmlRoot() + ">(\\d+)</" + getXmlRoot() + ">", Pattern.MULTILINE | Pattern.DOTALL).matcher(
- xml);
- if (m.find()) {
- try {
- Long l = new Long(m.group(1));
- date = new Date(l.longValue());
- } catch (NumberFormatException e) {
- e.printStackTrace();
- }
- }
- refresh();
- }
-
public void addModifyListener(ModifyListener listener) {
listeners.add(listener);
updateListeners();
@@ -234,36 +208,6 @@ public class XDate extends XWidget {
}
}
- /**
- * Don't need this since overriding toReport and toXml
- */
- @Override
- public String getXmlData() {
- String dateStr = "";
- if (date != null) {
- dateStr = date.getTime() + "";
- }
- return dateStr;
- }
-
- /**
- * Don't need this since overriding setFromXml
- */
- @Override
- public void setXmlData(String str) {
- if (str.equals("")) {
- date = null;
- } else {
- try {
- Long l = new Long(str);
- date = new Date(l.longValue());
- } catch (NumberFormatException e) {
- e.printStackTrace();
- date = null;
- }
- }
- }
-
@Override
public String toHTML(String labelFont) {
return AHTML.getLabelStr(labelFont, getLabel() + ": ") + get(defaultFormat);
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XFlatWidget.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XFlatWidget.java
index 652c8ec..b4a790a 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XFlatWidget.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XFlatWidget.java
@@ -56,8 +56,8 @@ public abstract class XFlatWidget<T> extends XLabel {
private int minPage;
private int maxPage;
- public XFlatWidget(String displayLabel, String xmlRoot) {
- super(displayLabel, xmlRoot);
+ public XFlatWidget(String displayLabel) {
+ super(displayLabel);
setToolTip("Navigate pages by clicking forward and backward buttons.");
minPage = 0;
maxPage = 0;
@@ -73,10 +73,6 @@ public abstract class XFlatWidget<T> extends XLabel {
return flatControl.pageIds;
}
- public XFlatWidget(String displayLabel) {
- this(displayLabel, "");
- }
-
protected void setPageRange(int minPage, int maxPage) throws OseeArgumentException {
if (minPage < 0) {
throw new OseeArgumentException("Min Number of Pages must be greater than 0");
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XFloat.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XFloat.java
index 69db7c3..1da3a16 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XFloat.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XFloat.java
@@ -27,11 +27,7 @@ public class XFloat extends XText {
private boolean maxValueSet = false;
public XFloat(String displayLabel) {
- super(displayLabel, "float");
- }
-
- public XFloat(String displayLabel, String xmlRoot) {
- super(displayLabel, xmlRoot);
+ super(displayLabel);
}
public void setMinValue(double minValue) {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XFloatDam.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XFloatDam.java
index 2c6bb65..94fb8f4 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XFloatDam.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XFloatDam.java
@@ -32,10 +32,6 @@ public class XFloatDam extends XFloat implements IAttributeWidget {
super(displayLabel);
}
- public XFloatDam(String displayLabel, String xmlRoot) {
- super(displayLabel, xmlRoot);
- }
-
@Override
public Artifact getArtifact() {
return artifact;
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XHyperlinkLabelCmdValueSelection.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XHyperlinkLabelCmdValueSelection.java
index 33c3ec9..3ffbc3a 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XHyperlinkLabelCmdValueSelection.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XHyperlinkLabelCmdValueSelection.java
@@ -10,8 +10,6 @@
*******************************************************************************/
package org.eclipse.osee.framework.ui.skynet.widgets;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
import org.eclipse.osee.framework.jdk.core.util.AHTML;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.ui.swt.ALayout;
@@ -29,7 +27,7 @@ import org.eclipse.ui.forms.widgets.Hyperlink;
/**
* @author Donald G. Dunne
*/
-public abstract class XHyperlinkLabelCmdValueSelection extends XWidget {
+public abstract class XHyperlinkLabelCmdValueSelection extends GenericXWidget {
Label valueLabel;
Hyperlink selectHyperLinkLabel, clearHyperLinkLabel;
@@ -186,41 +184,6 @@ public abstract class XHyperlinkLabelCmdValueSelection extends XWidget {
return AHTML.getLabelValueStr(AHTML.LABEL_FONT, getHyperlinkLabelString(), getCurrentValue());
}
- @Override
- public void dispose() {
- // do nothing
- }
-
- @Override
- public Object getData() {
- return null;
- }
-
- @Override
- public String getReportData() {
- return null;
- }
-
- @Override
- public String getXmlData() {
- return null;
- }
-
- @Override
- public IStatus isValid() {
- return Status.OK_STATUS;
- }
-
- @Override
- public void setFocus() {
- // do nothing
- }
-
- @Override
- public void setXmlData(String str) {
- // do nothing
- }
-
public Integer getTruncateValueLength() {
return truncateValueLength;
}
@@ -228,5 +191,4 @@ public abstract class XHyperlinkLabelCmdValueSelection extends XWidget {
public void setTruncateValueLength(Integer truncateValueLength) {
this.truncateValueLength = truncateValueLength;
}
-
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XHyperlinkLabelValueSelection.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XHyperlinkLabelValueSelection.java
index 7336d5a..cc85ea7 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XHyperlinkLabelValueSelection.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XHyperlinkLabelValueSelection.java
@@ -10,8 +10,6 @@
*******************************************************************************/
package org.eclipse.osee.framework.ui.skynet.widgets;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
import org.eclipse.osee.framework.jdk.core.util.AHTML;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.ui.swt.ALayout;
@@ -29,7 +27,7 @@ import org.eclipse.ui.forms.widgets.Hyperlink;
/**
* @author Donald G. Dunne
*/
-public abstract class XHyperlinkLabelValueSelection extends XWidget {
+public abstract class XHyperlinkLabelValueSelection extends GenericXWidget {
Hyperlink valueHyperlinkLabel;
Label valueLabel;
@@ -154,40 +152,4 @@ public abstract class XHyperlinkLabelValueSelection extends XWidget {
public String toHTML(String labelFont) {
return AHTML.getLabelValueStr(AHTML.LABEL_FONT, getLabel(), getCurrentValue());
}
-
- @Override
- public void dispose() {
- // do nothing
- }
-
- @Override
- public Object getData() {
- return null;
- }
-
- @Override
- public String getReportData() {
- return null;
- }
-
- @Override
- public String getXmlData() {
- return null;
- }
-
- @Override
- public IStatus isValid() {
- return Status.OK_STATUS;
- }
-
- @Override
- public void setFocus() {
- // do nothing
- }
-
- @Override
- public void setXmlData(String str) {
- // do nothing
- }
-
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XInteger.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XInteger.java
index 3e52032..025ae58 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XInteger.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XInteger.java
@@ -24,11 +24,7 @@ public class XInteger extends XText {
private boolean maxValueSet = false;
public XInteger(String displayLabel) {
- this(displayLabel, "");
- }
-
- public XInteger(String displayLabel, String xmlRoot) {
- super(displayLabel, xmlRoot);
+ super(displayLabel);
}
public void setMinValue(int minValue) {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XLabel.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XLabel.java
index f87ec3d..b90b480 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XLabel.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XLabel.java
@@ -10,8 +10,6 @@
*******************************************************************************/
package org.eclipse.osee.framework.ui.skynet.widgets;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
@@ -23,7 +21,7 @@ import org.eclipse.swt.widgets.Label;
*
* @author Donald G. Dunne
*/
-public class XLabel extends XWidget {
+public class XLabel extends GenericXWidget {
private final String showString;
@@ -32,7 +30,7 @@ public class XLabel extends XWidget {
}
public XLabel(String displayLabel, String showString) {
- super(displayLabel, "");
+ super(displayLabel);
this.showString = showString;
}
@@ -57,53 +55,7 @@ public class XLabel extends XWidget {
}
@Override
- public void setFocus() {
- // do nothing
- }
-
- @Override
- public void dispose() {
- // do nothing
- }
-
- @Override
public Control getControl() {
return labelWidget;
}
-
- @Override
- public Object getData() {
- return null;
- }
-
- @Override
- public String getReportData() {
- return null;
- }
-
- @Override
- public String getXmlData() {
- return null;
- }
-
- @Override
- public IStatus isValid() {
- return Status.OK_STATUS;
- }
-
- @Override
- public void refresh() {
- // do nothing
- }
-
- @Override
- public void setXmlData(String str) {
- // do nothing
- }
-
- @Override
- public String toHTML(String labelFont) {
- return "";
- }
-
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XLabelDam.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XLabelDam.java
index 48265e1..8989047 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XLabelDam.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XLabelDam.java
@@ -11,8 +11,6 @@
package org.eclipse.osee.framework.ui.skynet.widgets;
import java.util.logging.Level;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.logging.OseeLog;
@@ -31,7 +29,7 @@ import org.eclipse.swt.widgets.Text;
*
* @author Donald G. Dunne
*/
-public class XLabelDam extends XWidget implements IAttributeWidget {
+public class XLabelDam extends GenericXWidget implements IAttributeWidget {
private Artifact artifact;
private IAttributeType attributeType;
@@ -80,7 +78,6 @@ public class XLabelDam extends XWidget implements IAttributeWidget {
public void setAttributeType(Artifact artifact, IAttributeType attributeType) {
this.artifact = artifact;
this.attributeType = attributeType;
-
refresh();
}
@@ -121,36 +118,6 @@ public class XLabelDam extends XWidget implements IAttributeWidget {
}
@Override
- public String getReportData() {
- return null;
- }
-
- @Override
- public String getXmlData() {
- return null;
- }
-
- @Override
- public IStatus isValid() {
- return Status.OK_STATUS;
- }
-
- @Override
- public void setFocus() {
- // do nothing
- }
-
- @Override
- public void setXmlData(String str) {
- // do nothing
- }
-
- @Override
- public String toHTML(String labelFont) {
- return "";
- }
-
- @Override
public Object getData() {
return valueTextWidget.getText();
}
@@ -159,5 +126,4 @@ public class XLabelDam extends XWidget implements IAttributeWidget {
public void revert() {
// Do nothing cause labelDam is read-only
}
-
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XLabelValueBase.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XLabelValueBase.java
index eec78c9..e6ea932 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XLabelValueBase.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XLabelValueBase.java
@@ -10,8 +10,6 @@
*******************************************************************************/
package org.eclipse.osee.framework.ui.skynet.widgets;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
import org.eclipse.osee.framework.jdk.core.util.AHTML;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.ui.swt.ALayout;
@@ -25,7 +23,7 @@ import org.eclipse.ui.forms.widgets.FormToolkit;
/**
* @author Donald G. Dunne
*/
-public abstract class XLabelValueBase extends XWidget {
+public abstract class XLabelValueBase extends GenericXWidget {
Label valueLabel;
String valueText = "";
@@ -97,41 +95,6 @@ public abstract class XLabelValueBase extends XWidget {
return AHTML.getLabelValueStr(AHTML.LABEL_FONT, getLabel(), getValueText());
}
- @Override
- public void dispose() {
- // do nothing
- }
-
- @Override
- public Object getData() {
- return null;
- }
-
- @Override
- public String getReportData() {
- return null;
- }
-
- @Override
- public String getXmlData() {
- return null;
- }
-
- @Override
- public IStatus isValid() {
- return Status.OK_STATUS;
- }
-
- @Override
- public void setFocus() {
- // do nothing
- }
-
- @Override
- public void setXmlData(String str) {
- // do nothing
- }
-
/**
* @return the valueText
*/
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XList.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XList.java
index 51c82be..9983a44 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XList.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XList.java
@@ -18,8 +18,6 @@ import java.util.HashSet;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.osee.framework.jdk.core.util.AHTML;
@@ -39,7 +37,7 @@ import org.eclipse.swt.widgets.Menu;
/**
* @author Donald G. Dunne
*/
-public class XList extends XWidget {
+public class XList extends GenericXWidget {
public class XListItem {
private String name = "";
@@ -112,15 +110,7 @@ public class XList extends XWidget {
};
public XList(String displayLabel) {
- this(displayLabel, "list", "");
- }
-
- public XList() {
- this("List", "list", "");
- }
-
- public XList(String displayLabel, String xmlRoot, String xmlSubRoot) {
- super(displayLabel, xmlRoot, xmlSubRoot);
+ super(displayLabel);
listMenu = null;
}
@@ -208,27 +198,6 @@ public class XList extends XWidget {
}
}
- @Override
- public void setFocus() {
- // do nothing
- }
-
- /**
- * Don't need this since overriding toReport and toXml
- */
- @Override
- public String getXmlData() {
- return "";
- }
-
- /**
- * Don't need this since overriding setFromXml
- */
- @Override
- public void setXmlData(String str) {
- return;
- }
-
private void handleSelection() {
String sels[] = listList.getSelection();
for (XListItem xItem : items.values()) {
@@ -264,31 +233,6 @@ public class XList extends XWidget {
return sel;
}
- @Override
- public void setFromXml(String xml) {
- Matcher inner, outter;
- String outterXml;
- items.clear();
- outter =
- Pattern.compile("<" + getXmlRoot() + ">(.*?)</" + getXmlRoot() + ">", Pattern.MULTILINE | Pattern.DOTALL).matcher(
- xml);
- while (outter.find()) {
- outterXml = outter.group(1);
- inner = Pattern.compile("<" + getXmlSubRoot() + ">(.*?)</" + getXmlSubRoot() + ">").matcher(outterXml);
- while (inner.find()) {
- String str = inner.group(1);
- XListItem xItem = getByXmlName(str);
- if (xItem != null) {
- xItem.setSelected(true);
- } else {
- xItem = add(str);
- xItem.setSelected(true);
- }
- }
- }
- refresh();
- }
-
public List getList() {
return listList;
}
@@ -452,26 +396,7 @@ public class XList extends XWidget {
for (XListItem xItem : getSelected()) {
builder.append(String.format(" - %s\n", xItem));
}
-
- @Override
- public String toXml() {
- return toXml(getXmlRoot(), getXmlSubRoot());
- }
-
- @Override
- public String toXml(String xmlRoot, String xmlSubRoot) {
- String s = "<" + xmlRoot + ">\n";
- for (XListItem xItem : getSelected()) {
- String dataStr;
- if (xItem.getXmlValue() != null) {
- dataStr = xItem.getXmlValue();
- } else {
- dataStr = xItem.getName();
- }
- s = s + " <" + xmlSubRoot + ">" + dataStr + "</" + xmlSubRoot + ">\n";
- }
- s = s + "</" + xmlRoot + ">\n";
- return s;
+ return builder.toString().trim();
}
@Override
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XListViewer.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XListViewer.java
index 7b1beac..0096683 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XListViewer.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XListViewer.java
@@ -40,7 +40,7 @@ import org.eclipse.swt.widgets.Table;
/**
* @author Donald G. Dunne
*/
-public class XListViewer extends XWidget {
+public class XListViewer extends GenericXWidget {
// XListViewer uses a table so images can be used. SWT doesn't support images in ListViewer
private TableViewer listViewer;
@@ -73,16 +73,7 @@ public class XListViewer extends XWidget {
private int heightHint;
public XListViewer(String displayLabel) {
- this(displayLabel, "list", "");
- }
-
- public XListViewer() {
- this("List", "list", "");
- }
-
- public XListViewer(String displayLabel, String xmlRoot, String xmlSubRoot) {
- super(displayLabel, xmlRoot, xmlSubRoot);
- listMenu = null;
+ super(displayLabel);
}
@Override
@@ -234,27 +225,6 @@ public class XListViewer extends XWidget {
}
}
- @Override
- public void setFocus() {
- // do nothing
- }
-
- /**
- * Don't need this since overriding toReport and toXml
- */
- @Override
- public String getXmlData() {
- return "";
- }
-
- /**
- * Don't need this since overriding setFromXml
- */
- @Override
- public void setXmlData(String str) {
- return;
- }
-
private void handleSelection() {
validate();
notifyXModifiedListeners();
@@ -279,11 +249,6 @@ public class XListViewer extends XWidget {
return selected;
}
- @Override
- public void setFromXml(String xml) {
- // do nothing
- }
-
public Table getTable() {
return listViewer.getTable();
}
@@ -386,16 +351,6 @@ public class XListViewer extends XWidget {
}
@Override
- public String toXml() {
- return toXml(getXmlRoot(), getXmlSubRoot());
- }
-
- @Override
- public String toXml(String xmlRoot, String xmlSubRoot) {
- return "";
- }
-
- @Override
public String toHTML(String labelFont) {
String s = "<dl><dt>" + AHTML.getLabelStr(labelFont, getLabel() + ": ") + "<dt><ul type=\"disc\">";
for (Object xItem : getSelected()) {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XMembersCombo.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XMembersCombo.java
index 85a265a..198891f 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XMembersCombo.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XMembersCombo.java
@@ -10,14 +10,10 @@
*******************************************************************************/
package org.eclipse.osee.framework.ui.skynet.widgets;
-import java.util.Collection;
import java.util.logging.Level;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.osee.framework.jdk.core.util.AHTML;
-import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.User;
import org.eclipse.osee.framework.skynet.core.UserManager;
@@ -39,7 +35,7 @@ import org.eclipse.swt.widgets.Label;
/**
* @author Donald G. Dunne
*/
-public class XMembersCombo extends XWidget {
+public class XMembersCombo extends GenericXWidget {
private static final String DEFAULT_SELECTION = "--select--";
private Combo dataCombo;
private Composite composite;
@@ -47,25 +43,13 @@ public class XMembersCombo extends XWidget {
private Search searchControl;
private boolean allUsers = false;
- public XMembersCombo(String displayLabel) {
- this(displayLabel, "", "");
- }
-
public XMembersCombo(String displayLabel, boolean allUsers) {
- this(displayLabel, "", "");
+ super(displayLabel);
this.allUsers = allUsers;
}
- public XMembersCombo(String displayLabel, String xmlRoot, String xmlSubRoot) {
- super(displayLabel, xmlRoot, xmlSubRoot);
- }
-
- public XMembersCombo(String displayLabel, Collection<User> members) {
- super(displayLabel, displayLabel, "user");
- }
-
- public XMembersCombo(String displayLabel, String xmlRoot) {
- this(displayLabel, xmlRoot, "");
+ public XMembersCombo(String displayLabel) {
+ super(displayLabel);
}
@Override
@@ -217,39 +201,6 @@ public class XMembersCombo extends XWidget {
}
@Override
- public void setFocus() {
- if (dataCombo != null) {
- dataCombo.setFocus();
- }
- }
-
- @Override
- public void setFromXml(String xml) {
- Matcher matcher;
- if (getXmlSubRoot().equals("")) {
- matcher =
- Pattern.compile("<" + getXmlRoot() + ">(.*?)</" + getXmlRoot() + ">", Pattern.MULTILINE | Pattern.DOTALL).matcher(
- xml);
- } else {
- matcher =
- Pattern.compile(
- "<" + getXmlRoot() + "><" + getXmlSubRoot() + ">(.*?)</" + getXmlSubRoot() + "></" + getXmlRoot() + ">",
- Pattern.MULTILINE | Pattern.DOTALL).matcher(xml);
- }
- while (matcher.find()) {
- String userId = matcher.group(1);
- User user = null;
- try {
- user = UserManager.getUserByUserId(userId);
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- }
- set(user);
- }
- refresh();
- }
-
- @Override
public void refresh() {
updateComboWidget();
}
@@ -274,16 +225,6 @@ public class XMembersCombo extends XWidget {
return get();
}
- @Override
- public String getXmlData() {
- return get();
- }
-
- @Override
- public void setXmlData(String str) {
- // do nothing
- }
-
private void updateComboWidget() {
if (dataCombo != null) {
int index = 0;
@@ -313,23 +254,6 @@ public class XMembersCombo extends XWidget {
}
@Override
- protected String toXml() throws Exception {
- return toXml(getXmlRoot());
- }
-
- @Override
- protected String toXml(String xmlRoot) throws Exception {
- String s;
- String dataStr = selectedUser.getUserId();
- if (!Strings.isValid(getXmlSubRoot())) {
- s = "<" + xmlRoot + ">" + dataStr + "</" + xmlRoot + ">\n";
- } else {
- s = "<" + xmlRoot + "><" + getXmlSubRoot() + ">" + dataStr + "</" + getXmlSubRoot() + "></" + xmlRoot + ">\n";
- }
- return s;
- }
-
- @Override
public String toHTML(String labelFont) {
return AHTML.getLabelStr(labelFont, getLabel() + ": ") + get();
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XMembersList.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XMembersList.java
index 7e0b6cf..1f2c9b4 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XMembersList.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XMembersList.java
@@ -25,18 +25,14 @@ import org.eclipse.osee.framework.ui.skynet.ArtifactLabelProvider;
public class XMembersList extends XListViewer {
public XMembersList() throws OseeCoreException {
- this("MList", "", "");
+ this("MList");
}
public XMembersList(String displayLabel) throws OseeCoreException {
- this(displayLabel, "", "");
- }
-
- public XMembersList(String displayLabel, String xmlRoot, String xmlSubRoot) throws OseeCoreException {
- super(displayLabel, xmlRoot, xmlSubRoot);
- super.setLabelProvider(new ArtifactLabelProvider());
- super.setContentProvider(new ArrayContentProvider());
- super.setInputArtifacts(UserManager.getUsersSortedByName());
+ super(displayLabel);
+ setLabelProvider(new ArtifactLabelProvider());
+ setContentProvider(new ArrayContentProvider());
+ setInputArtifacts(UserManager.getUsersSortedByName());
}
public String[] getEmails() throws OseeCoreException {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XOption.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XOption.java
index 3bf6eb8..64cd129 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XOption.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XOption.java
@@ -10,45 +10,57 @@
*******************************************************************************/
package org.eclipse.osee.framework.ui.skynet.widgets;
+import java.util.EnumSet;
+
/**
* @author Donald G. Dunne
+ * @author Karol M. Wilk
*/
public enum XOption {
- NONE,
-
- REQUIRED,
- NOT_REQUIRED,
- ENABLED,
- NOT_ENABLED,
- EDITABLE,
- NOT_EDITABLE,
- MULTI_SELECT,
- HORIZONTAL_LABEL,
- VERTICAL_LABEL,
- LABEL_AFTER,
- LABEL_BEFORE,
- NO_LABEL,
- SORTED,
- ADD_DEFAULT_VALUE,
- NO_DEFAULT_VALUE,
- BEGIN_COMPOSITE_4,
- BEGIN_COMPOSITE_6,
- BEGIN_COMPOSITE_8,
- BEGIN_COMPOSITE_10,
- BEGIN_GROUP_COMPOSITE_4,
- BEGIN_GROUP_COMPOSITE_6,
- BEGIN_GROUP_COMPOSITE_8,
- BEGIN_GROUP_COMPOSITE_10,
- END_COMPOSITE,
+ NONE("", ""),
+
+ REQUIRED("required", "true"),
+ NOT_REQUIRED("required", "false"),
+ ENABLED("enabled", "true"),
+ NOT_ENABLED("enabled", "false"),
+ EDITABLE("editable", "true"),
+ NOT_EDITABLE("editable", "false"),
+ MULTI_SELECT("multiSelect", "true"),
+ HORIZONTAL_LABEL("horizontalLabel", "true"),
+ VERTICAL_LABEL("horizontalLabel", "false"),
+ LABEL_AFTER("labelAfter", "true"),
+ LABEL_BEFORE("labelAfter", "false"),
+ NO_LABEL("displayLabel", "false"),
+ SORTED("", " "),
+ ADD_DEFAULT_VALUE("", ""),
+ NO_DEFAULT_VALUE("", ""),
+ BEGIN_COMPOSITE_4("beginComposite", "4"),
+ BEGIN_COMPOSITE_6("beginComposite", "6"),
+ BEGIN_COMPOSITE_8("beginComposite", "8"),
+ BEGIN_COMPOSITE_10("beginComposite", "10"),
+ BEGIN_GROUP_COMPOSITE_4("beginGroupComposite", "4"),
+ BEGIN_GROUP_COMPOSITE_6("beginGroupComposite", "6"),
+ BEGIN_GROUP_COMPOSITE_8("beginGroupComposite", "8"),
+ BEGIN_GROUP_COMPOSITE_10("beginGroupComposite", "10"),
+ END_COMPOSITE("endComposite", "true"),
// Fill Options
- FILL_NONE,
- FILL_HORIZONTALLY,
- FILL_VERTICALLY,
+ FILL_NONE("", ""),
+ FILL_HORIZONTALLY("fill", "Horizontally"),
+ FILL_VERTICALLY("fill", "Vertically"),
// Align Options
- ALIGN_LEFT,
- ALIGN_RIGHT,
- ALIGN_CENTER;
+ ALIGN_LEFT("align", "Left"),
+ ALIGN_RIGHT("align", "Right"),
+ ALIGN_CENTER("align", "Center");
+
+ public String keyword;
+ public String value;
+
+ public static EnumSet<XOption> enumSet = EnumSet.allOf(XOption.class);
+ XOption(String newKeyword, String newValue) {
+ keyword = newKeyword;
+ value = newValue;
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XOptionHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XOptionHandler.java
index b5ec292..d009d45 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XOptionHandler.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XOptionHandler.java
@@ -25,39 +25,47 @@ public class XOptionHandler {
set(xOption);
}
- public static Collection<XOption> getCollection(XOption... ats) {
- Set<XOption> items = new HashSet<XOption>();
- for (XOption item : ats) {
- items.add(item);
- }
- return items;
- }
-
public void add(XOption xOption) {
- if (xOption.name().startsWith("ALIGN_")) {
- xOptions.remove(XOption.ALIGN_CENTER);
- xOptions.remove(XOption.ALIGN_LEFT);
- xOptions.remove(XOption.ALIGN_RIGHT);
- } else if (xOption == XOption.HORIZONTAL_LABEL) {
- xOptions.remove(XOption.VERTICAL_LABEL);
- } else if (xOption == XOption.EDITABLE) {
- xOptions.remove(XOption.NOT_EDITABLE);
- } else if (xOption == XOption.NOT_EDITABLE) {
- xOptions.remove(XOption.EDITABLE);
- } else if (xOption == XOption.NOT_REQUIRED) {
- xOptions.remove(XOption.REQUIRED);
- } else if (xOption == XOption.REQUIRED) {
- xOptions.remove(XOption.NOT_REQUIRED);
- } else if (xOption == XOption.NOT_ENABLED) {
- xOptions.remove(XOption.ENABLED);
- } else if (xOption == XOption.ENABLED) {
- xOptions.remove(XOption.NOT_ENABLED);
- } else if (xOption == XOption.FILL_NONE) {
- xOptions.remove(XOption.FILL_HORIZONTALLY);
- xOptions.remove(XOption.FILL_VERTICALLY);
- } else if (xOption == XOption.VERTICAL_LABEL) {
- xOptions.remove(XOption.HORIZONTAL_LABEL);
+ switch (xOption) {
+ case ALIGN_CENTER:
+ case ALIGN_LEFT:
+ case ALIGN_RIGHT:
+ xOptions.remove(XOption.ALIGN_CENTER);
+ xOptions.remove(XOption.ALIGN_LEFT);
+ xOptions.remove(XOption.ALIGN_RIGHT);
+ break;
+ case HORIZONTAL_LABEL:
+ xOptions.remove(XOption.VERTICAL_LABEL);
+ break;
+ case EDITABLE:
+ xOptions.remove(XOption.NOT_EDITABLE);
+ break;
+ case NOT_EDITABLE:
+ xOptions.remove(XOption.EDITABLE);
+ break;
+ case NOT_REQUIRED:
+ xOptions.remove(XOption.REQUIRED);
+ break;
+ case REQUIRED:
+ xOptions.remove(XOption.NOT_REQUIRED);
+ break;
+ case NOT_ENABLED:
+ xOptions.remove(XOption.ENABLED);
+ break;
+ case ENABLED:
+ xOptions.remove(XOption.NOT_ENABLED);
+ break;
+ case FILL_NONE:
+ xOptions.remove(XOption.FILL_HORIZONTALLY);
+ xOptions.remove(XOption.FILL_VERTICALLY);
+ break;
+ case VERTICAL_LABEL:
+ xOptions.remove(XOption.HORIZONTAL_LABEL);
+ break;
+ default:
+ break;
}
+
xOptions.add(xOption);
}
@@ -68,9 +76,7 @@ public class XOptionHandler {
}
public void add(Collection<XOption> xOption) {
- for (XOption xOpt : xOption) {
- add(xOpt);
- }
+ add(xOption.toArray(new XOption[0]));
}
public boolean contains(XOption xOption) {
@@ -85,25 +91,23 @@ public class XOptionHandler {
}
/**
+ * Must go through the add method to ensure values set properly
+ *
* @param options the xOptions to set
*/
public void set(Set<XOption> options) {
- this.xOptions.clear();
- // Must go through the add method to ensure values set properly
- for (XOption xOption : options) {
- add(xOption);
- }
+ xOptions.clear();
+ add(options);
}
/**
+ * Must go through the add method to ensure values set properly
+ *
* @param options the xOptions to set
*/
- public void set(XOption options[]) {
- this.xOptions.clear();
- // Must go through the add method to ensure values set properly
- for (XOption xOption : options) {
- add(xOption);
- }
+ public void set(XOption[] options) {
+ xOptions.clear();
+ add(options);
}
@Override
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XPercent.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XPercent.java
index 6bea13e..966e60c 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XPercent.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XPercent.java
@@ -19,8 +19,8 @@ import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
*/
public class XPercent extends XText {
- public XPercent(String displayLabel, String xmlRoot) {
- super(displayLabel, xmlRoot);
+ public XPercent(String displayLabel) {
+ super(displayLabel);
}
public void set(int percent) {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XRadioButton.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XRadioButton.java
index 54b95f5..12d2530 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XRadioButton.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XRadioButton.java
@@ -11,8 +11,6 @@
package org.eclipse.osee.framework.ui.skynet.widgets;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.osee.framework.jdk.core.util.AHTML;
@@ -36,7 +34,6 @@ public class XRadioButton extends XWidget {
private Composite parent;
private boolean selected = false;
- private final String xmlRoot;
private Button button;
public static enum ButtonType {
Check,
@@ -46,12 +43,7 @@ public class XRadioButton extends XWidget {
private boolean labelAfter;
public XRadioButton(String displayLabel) {
- this(displayLabel, "");
- }
-
- public XRadioButton(String displayLabel, String xmlRoot) {
- super(displayLabel, xmlRoot);
- this.xmlRoot = xmlRoot;
+ super(displayLabel);
}
@Override
@@ -71,40 +63,6 @@ public class XRadioButton extends XWidget {
return getLabel() + ": " + selected;
}
- @Override
- public void setFromXml(String xml) {
- Matcher m;
- m = Pattern.compile("<" + xmlRoot + ">(.*?)</" + xmlRoot + ">", Pattern.MULTILINE | Pattern.DOTALL).matcher(xml);
- if (m.find()) {
- String str = m.group(1);
- if (str.equals("true")) {
- setSelected(true);
- } else if (str.equals("false")) {
- setSelected(false);
- } else {
- System.err.println("Unexpected radiobutton value " + str);
- }
- }
- refresh();
- }
-
- @Override
- public String getXmlData() {
- return "" + selected;
- }
-
- public String getDisplayStr() {
- return getXmlData();
- }
-
- /**
- * Don't need this since overriding setFromXml
- */
- @Override
- public void setXmlData(String str) {
- // do nothing
- }
-
/**
* Create radio Widgets. Widgets Created: Label: "text entry" horizonatalSpan takes up 2 columns; horizontalSpan must
* be >=2
@@ -192,13 +150,8 @@ public class XRadioButton extends XWidget {
}
@Override
- public String getReportData() {
- return getXmlData();
- }
-
- @Override
public String toHTML(String labelFont) {
- return AHTML.getLabelStr(labelFont, getLabel() + ": ") + getDisplayStr();
+ return AHTML.getLabelStr(labelFont, getLabel() + ": ");
}
public boolean isLabelAfter() {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XRadioButtonTest.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XRadioButtonTest.java
index ce9a61b..e6d62af 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XRadioButtonTest.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XRadioButtonTest.java
@@ -30,7 +30,7 @@ public class XRadioButtonTest extends Composite {
c.setLayout(new GridLayout(2, false));
c.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
- final XRadioButton rb = new XRadioButton("Single Button", "singleButton");
+ final XRadioButton rb = new XRadioButton("Single Button");
rb.createWidgets(c, 2);
rb.addSelectionListener(new SelectionAdapter() {
@@ -38,7 +38,6 @@ public class XRadioButtonTest extends Composite {
public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
try {
System.out.println("isSelected *" + rb.isSelected() + "*");
- System.out.println("toXml *" + rb.toXml() + "*");
} catch (Exception ex) {
OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
}
@@ -49,7 +48,7 @@ public class XRadioButtonTest extends Composite {
c.setLayout(new GridLayout(2, false));
c.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
- final XRadioButton rb2 = new XRadioButton("Label After", "labelAfter");
+ final XRadioButton rb2 = new XRadioButton("Label After");
rb2.setLabelAfter(true);
rb2.createWidgets(c, 2);
rb2.addSelectionListener(new SelectionAdapter() {
@@ -58,7 +57,6 @@ public class XRadioButtonTest extends Composite {
public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
try {
System.out.println("isSelected *" + rb2.isSelected() + "*");
- System.out.println("toXml *" + rb2.toXml() + "*");
} catch (Exception ex) {
OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
}
@@ -69,7 +67,7 @@ public class XRadioButtonTest extends Composite {
c.setLayout(new GridLayout(2, false));
c.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
- final XRadioButton rb3 = new XRadioButton("Check Box", "checkBox");
+ final XRadioButton rb3 = new XRadioButton("Check Box");
rb3.setButtonType(ButtonType.Check);
rb3.setLabelAfter(true);
rb3.createWidgets(c, 2);
@@ -80,7 +78,6 @@ public class XRadioButtonTest extends Composite {
public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
try {
System.out.println("isSelected *" + rb3.isSelected() + "*");
- System.out.println("toXml *" + rb3.toXml() + "*");
} catch (Exception ex) {
OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
}
@@ -96,18 +93,6 @@ public class XRadioButtonTest extends Composite {
rb4.addButton("ccccc", "2nd tool tip");
rb4.addButton("bbbbb", "3rd tool tip");
rb4.createWidgets(c, 1);
- rb4.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
- try {
- System.out.println("isSelected *" + rb4.getXmlData() + "*");
- System.out.println("toXml *" + rb4.toXml() + "*");
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- }
- };
- });
c = new Composite(parent, SWT.NONE);
c.setLayout(new GridLayout(2, false));
@@ -115,18 +100,6 @@ public class XRadioButtonTest extends Composite {
rb4.setLabel("Sorted Radios");
rb4.setSortNames(true);
rb4.createWidgets(c, 7);
- rb4.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
- try {
- System.out.println("isSelected *" + rb4.getXmlData() + "*");
- System.out.println("toXml *" + rb4.toXml() + "*");
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- }
- };
- });
c = new Composite(parent, SWT.NONE);
c.setLayout(new GridLayout(1, false));
@@ -138,18 +111,6 @@ public class XRadioButtonTest extends Composite {
rb5.addButton("ccccc", "3rd tool tip");
rb5.setMultiSelect(true);
rb5.createWidgets(c, 11);
- rb5.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
- try {
- System.out.println("isSelected *" + rb5.getXmlData() + "*");
- System.out.println("toXml *" + rb5.toXml() + "*");
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- }
- };
- });
c = new Composite(parent, SWT.NONE);
c.setLayout(new GridLayout(1, false));
@@ -157,18 +118,6 @@ public class XRadioButtonTest extends Composite {
rb5.setLabel("Sorted Multi Select");
rb5.setSortNames(true);
rb5.createWidgets(c, 11);
- rb5.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
- try {
- System.out.println("isSelected *" + rb5.getXmlData() + "*");
- System.out.println("toXml *" + rb5.toXml() + "*");
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- }
- };
- });
c = new Composite(parent, SWT.NONE);
c.setLayout(new GridLayout(1, false));
@@ -178,18 +127,6 @@ public class XRadioButtonTest extends Composite {
rb6.setSortNames(true);
rb6.setMultiSelect(true);
rb6.createWidgets(c, 11);
- rb6.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
- try {
- System.out.println("selected *" + rb6.getXmlData() + "*");
- System.out.println("toXml *" + rb6.toXml() + "*");
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- }
- };
- });
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XRadioButtons.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XRadioButtons.java
index 7c65626..e982122 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XRadioButtons.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XRadioButtons.java
@@ -18,8 +18,6 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.osee.framework.jdk.core.util.AHTML;
@@ -40,7 +38,7 @@ import org.eclipse.swt.widgets.Label;
*
* @author Donald G. Dunne
*/
-public class XRadioButtons extends XWidget {
+public class XRadioButtons extends GenericXWidget {
private Composite comp;
private final ArrayList<XRadioButton> xButtons = new ArrayList<XRadioButton>();
@@ -50,37 +48,30 @@ public class XRadioButtons extends XWidget {
private boolean sortNames;
public XRadioButtons(String displayLabel, String xmlRoot) {
- super(displayLabel, xmlRoot);
- }
-
- @Override
- public void setFocus() {
- // do nothing
+ super(displayLabel);
}
@Override
public Control getControl() {
- return null;
+ return comp;
}
public void addButtons(String items[]) {
xButtons.clear();
for (String item : items) {
- xButtons.add(new XRadioButton(item, item));
+ xButtons.add(new XRadioButton(item));
}
}
public void addButton(String item, String toolTip) {
- XRadioButton rb = new XRadioButton(item, item);
+ XRadioButton rb = new XRadioButton(item);
rb.setToolTip(toolTip);
xButtons.add(rb);
- // System.out.println("added " + item);
}
public void addButton(String item) {
- XRadioButton rb = new XRadioButton(item, item);
+ XRadioButton rb = new XRadioButton(item);
xButtons.add(rb);
- // System.out.println("added " + item);
}
public void selectAll(boolean selected) {
@@ -119,48 +110,10 @@ public class XRadioButtons extends XWidget {
}
@Override
- public void setFromXml(String xml) throws IllegalStateException {
- selectAll(false);
- if (!multiSelect) {
- super.setFromXml(xml);
- } else {
- Matcher m;
- m =
- Pattern.compile("<" + getXmlRoot() + ">(.*?)</" + getXmlRoot() + ">", Pattern.MULTILINE | Pattern.DOTALL).matcher(
- xml);
- if (m.find()) {
- String str = m.group(1);
- String strs[] = str.split(",");
- setSelected(strs);
- }
- }
- refresh();
- }
-
- @Override
- public String getXmlData() {
- String sel = "";
- for (String str : getSelectedNames()) {
- sel += str + ",";
- }
- sel = sel.replaceFirst(",$", "");
- return sel;
- }
-
- public String getDisplayStr() {
- return getXmlData();
- }
-
- @Override
public String toString() {
return getLabel() + ": " + Collections.toString(",", getSelectedNames());
}
- @Override
- public void setXmlData(String str) {
- setSelected(str);
- }
-
/**
* Create radio Widgets. Widgets Created: Label: "text entry" horizonatalSpan takes up 2 columns; horizontalSpan must
* be >=2
@@ -320,12 +273,12 @@ public class XRadioButtons extends XWidget {
@Override
public String getReportData() {
- return getXmlData();
+ return "";
}
@Override
public String toHTML(String labelFont) {
- return AHTML.getLabelStr(labelFont, getLabel() + ": ") + getDisplayStr();
+ return AHTML.getLabelStr(labelFont, getLabel() + ": ");
}
public boolean isMultiSelect() {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XSelectFromDialog.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XSelectFromDialog.java
index 0ecfe14..4b9f925 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XSelectFromDialog.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XSelectFromDialog.java
@@ -45,13 +45,9 @@ public abstract class XSelectFromDialog<T> extends XText {
private int minSelectionRequired, maxSelectionRequired = 1;
private Button selectionButton;
- public XSelectFromDialog(String displayLabel, String xmlRoot) {
- super(displayLabel, xmlRoot);
- setToolTip("Click the button on the left to change the current selection.");
- }
-
public XSelectFromDialog(String displayLabel) {
- this(displayLabel, "");
+ super(displayLabel);
+ setToolTip("Click the button on the left to change the current selection.");
}
public void setRequiredSelection(int minSelectionRequired, int maxSelectionRequired) throws OseeArgumentException {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XStackedWidget.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XStackedWidget.java
index b9dd18e..8569738 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XStackedWidget.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XStackedWidget.java
@@ -52,8 +52,8 @@ public abstract class XStackedWidget<T> extends XLabel {
private int minPage;
private int maxPage;
- public XStackedWidget(String displayLabel, String xmlRoot) {
- super(displayLabel, xmlRoot);
+ public XStackedWidget(String displayLabel) {
+ super(displayLabel);
setToolTip("Navigate pages by clicking forward and backward buttons.");
minPage = 0;
maxPage = 0;
@@ -65,10 +65,6 @@ public abstract class XStackedWidget<T> extends XLabel {
super.dispose();
}
- public XStackedWidget(String displayLabel) {
- this(displayLabel, "");
- }
-
protected void setPageRange(int minPage, int maxPage) throws OseeArgumentException {
if (minPage < 0) {
throw new OseeArgumentException("Min Number of Pages must be greater than 0");
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XText.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XText.java
index ded635a..bab5a74 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XText.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XText.java
@@ -12,19 +12,15 @@ package org.eclipse.osee.framework.ui.skynet.widgets;
import java.text.NumberFormat;
import java.text.ParseException;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.osee.framework.jdk.core.util.AHTML;
-import org.eclipse.osee.framework.jdk.core.util.AXml;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
import org.eclipse.osee.framework.ui.skynet.util.OseeDictionary;
import org.eclipse.osee.framework.ui.swt.ALayout;
import org.eclipse.osee.framework.ui.swt.Widgets;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.SWTException;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
@@ -63,19 +59,11 @@ public class XText extends XWidget {
Composite composite = null;
public XText() {
- super("AText", "text");
+ this("XText");
}
public XText(String displayLabel) {
- this(displayLabel, "text");
- }
-
- public XText(String displayLabel, String xmlRoot) {
- this(displayLabel, xmlRoot, "");
- }
-
- public XText(String displayLabel, String xmlRoot, String xmlSubRoot) {
- super(displayLabel, xmlRoot, xmlSubRoot);
+ super(displayLabel);
}
public void setEnabled(boolean enabled) {
@@ -417,75 +405,12 @@ public class XText extends XWidget {
return text;
}
- @Override
- public String getXmlData() {
- if (sText == null || sText.isDisposed()) {
- return AXml.textToXml(text);
- } else {
- try {
- return AXml.textToXml(sText.getText());
- } catch (SWTException e) {
- return AXml.textToXml(text);
- }
- }
- }
-
- @Override
- protected String toXml() {
- if (getXmlSubRoot().equals("")) {
- return toXml(getXmlRoot());
- } else {
- return toXml(getXmlRoot(), getXmlSubRoot());
- }
- }
-
- @Override
- public String toXml(String xmlRoot) {
- String s = "<" + xmlRoot + ">" + getXmlData() + "</" + xmlRoot + ">\n";
- return s;
- }
-
- @Override
- public String toXml(String xmlRoot, String xmlSubRoot) {
- String s =
- "<" + xmlRoot + ">" + "<" + xmlSubRoot + ">" + getXmlData() + "</" + xmlSubRoot + ">" + "</" + xmlRoot + ">\n";
- return s;
- }
-
- @Override
- public void setXmlData(String str) {
- set(str);
- if (debug) {
- System.err.println("setFromXml *" + str + "*");
- }
- }
-
- @Override
- public void setFromXml(String xml) {
- Matcher m;
- m =
- Pattern.compile("<" + getXmlRoot() + ">(.*?)</" + getXmlRoot() + ">", Pattern.MULTILINE | Pattern.DOTALL).matcher(
- xml);
-
- if (m.find()) {
- String xmlStr = m.group(1);
- if (debug) {
- System.err.println("xmlStr *" + xmlStr + "*");
- }
- String str = AXml.xmlToText(xmlStr);
- if (debug) {
- System.err.println("str *" + str + "*");
- }
- setXmlData(str);
- }
- }
-
public int getInt() {
- Integer percent = new Integer(0);
+ Integer percent;
try {
percent = new Integer(text);
} catch (NumberFormatException e) {
- // do nothing
+ percent = 0;
}
return percent.intValue();
}
@@ -518,7 +443,7 @@ public class XText extends XWidget {
}
public void append(String text) {
- this.text = this.text + text;
+ this.text += text;
updateTextWidget();
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XWidget.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XWidget.java
index af23181..80e37d5 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XWidget.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XWidget.java
@@ -15,14 +15,11 @@ import java.util.Collection;
import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.Set;
-import java.util.Vector;
import java.util.logging.Level;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.osee.framework.jdk.core.type.MutableBoolean;
-import org.eclipse.osee.framework.jdk.core.util.AXml;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
import org.eclipse.osee.framework.ui.swt.Displays;
@@ -49,8 +46,6 @@ public abstract class XWidget {
protected Label labelWidget = null;
private String label = "";
- private String xmlRoot = "";
- private String xmlSubRoot = "";
private String toolTip = null;
private boolean requiredEntry = false;
private boolean editable = true;
@@ -60,10 +55,6 @@ public abstract class XWidget {
protected boolean fillVertically = false;
protected boolean fillHorizontally = false;
- public boolean isFillHorizontally() {
- return fillHorizontally;
- }
-
private boolean displayLabel = true;
private final Set<XModifiedListener> modifiedListeners = new LinkedHashSet<XModifiedListener>();
private MouseListener mouseLabelListener;
@@ -73,21 +64,14 @@ public abstract class XWidget {
this.label = label;
}
- public XWidget(String label, String xmlRoot) {
- this.label = label;
- this.xmlRoot = xmlRoot;
- }
-
- public XWidget(String label, String xmlRoot, String xmlSubRoot) {
- this.label = label;
- this.xmlRoot = xmlRoot;
- this.xmlSubRoot = xmlSubRoot;
+ public boolean isFillHorizontally() {
+ return fillHorizontally;
}
public void setToolTip(String toolTip) {
this.toolTip = toolTip;
- if (this.labelWidget != null && !labelWidget.isDisposed()) {
- this.labelWidget.setToolTipText(toolTip);
+ if (labelWidget != null && !labelWidget.isDisposed()) {
+ labelWidget.setToolTipText(toolTip);
}
}
@@ -128,11 +112,7 @@ public abstract class XWidget {
public boolean isFormReady() {
// Set to true if outside of a form;
- boolean result = managedForm == null;
- if (managedForm != null) {
- result = !managedForm.getForm().isDisposed();
- }
- return result;
+ return (managedForm == null) ? true : !managedForm.getForm().isDisposed();
}
public void setControlCausedMessage(String messageId, String messageText, int type) {
@@ -275,59 +255,15 @@ public abstract class XWidget {
public abstract void setFocus();
- public abstract void refresh();
-
- public abstract IStatus isValid();
-
- /**
- * Called with string found between xml tags Used by setFromXml() String will be sent through AXml.xmlToText() before
- * being sent to setXmlData implementation. Used by: setFromXml
- *
- * @param str - value to set
- */
- public abstract void setXmlData(String str);
-
- /**
- * Return string to save off between xml tags Used by call to toXml() String returned will be sent through
- * AXml.textToXml() before being saved Used by: toXml
- *
- * @return Return Xml data string.
- */
- protected abstract String getXmlData();
-
- public abstract String toHTML(String labelFont);
-
- protected String toXml() throws Exception {
- if (xmlSubRoot.equals("")) {
- return toXml(xmlRoot);
- } else {
- return toXml(xmlRoot, xmlSubRoot);
- }
- }
-
- protected String toXml(String xmlRoot) throws Exception {
- String s = "<" + xmlRoot + ">" + AXml.textToXml(getXmlData()) + "</" + xmlRoot + ">\n";
- return s;
+ public void refresh() {
}
- public String toXml(String xmlRoot, String xmlSubRoot) throws Exception {
- String s =
- "<" + xmlRoot + ">" + "<" + xmlSubRoot + ">" + AXml.textToXml(getXmlData()) + "</" + xmlSubRoot + ">" + "</" + xmlRoot + ">\n";
- return s;
+ public IStatus isValid() {
+ return Status.OK_STATUS;
}
- public void setFromXml(String xml) throws IllegalStateException {
- Matcher m;
- m = Pattern.compile("<" + xmlRoot + ">(.*?)</" + xmlRoot + ">", Pattern.MULTILINE | Pattern.DOTALL).matcher(xml);
- if (m.find()) {
- setXmlData(AXml.xmlToText(m.group(1)));
- }
- }
-
- public Vector<String> getDisplayLabels() {
- Vector<String> l = new Vector<String>();
- l.add(label);
- return l;
+ public String toHTML(String labelFont) {
+ return "";
}
public void setDisplayLabel(String displayLabel) {
@@ -350,22 +286,6 @@ public abstract class XWidget {
this.verticalLabel = verticalLabel;
}
- public String getXmlRoot() {
- return xmlRoot;
- }
-
- public void setXmlRoot(String xmlRoot) {
- this.xmlRoot = xmlRoot;
- }
-
- public String getXmlSubRoot() {
- return xmlSubRoot;
- }
-
- public void setXmlSubRoot(String xmlSubRoot) {
- this.xmlSubRoot = xmlSubRoot;
- }
-
public String getToolTip() {
return toolTip;
}
@@ -405,7 +325,9 @@ public abstract class XWidget {
this.requiredEntry = requiredEntry;
}
- protected abstract String getReportData();
+ protected String getReportData() {
+ return "";
+ }
@Override
public String toString() {
@@ -420,7 +342,9 @@ public abstract class XWidget {
this.fillHorizontally = fillHorizontally;
}
- public abstract Object getData();
+ public Object getData() {
+ return null;
+ }
public boolean isDisplayLabel() {
return displayLabel;
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xBranch/BranchView.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xBranch/BranchView.java
index 7b5b465..30497f6 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xBranch/BranchView.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xBranch/BranchView.java
@@ -18,6 +18,7 @@ import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
+import org.eclipse.nebula.widgets.xviewer.XViewer;
import org.eclipse.nebula.widgets.xviewer.action.ColumnMultiEditAction;
import org.eclipse.nebula.widgets.xviewer.action.TableCustomizationAction;
import org.eclipse.nebula.widgets.xviewer.action.ViewSelectedCellDataAction;
@@ -31,7 +32,6 @@ import org.eclipse.osee.framework.core.model.TransactionRecord;
import org.eclipse.osee.framework.help.ui.OseeHelpContext;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.framework.plugin.core.IActionable;
import org.eclipse.osee.framework.skynet.core.event.OseeEventManager;
import org.eclipse.osee.framework.skynet.core.event.filter.IEventFilter;
import org.eclipse.osee.framework.skynet.core.event.listener.IBranchEventListener;
@@ -47,6 +47,7 @@ import org.eclipse.osee.framework.ui.skynet.OseeStatusContributionItemFactory;
import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
import org.eclipse.osee.framework.ui.skynet.action.EditTransactionComment;
import org.eclipse.osee.framework.ui.skynet.action.ITransactionRecordSelectionProvider;
+import org.eclipse.osee.framework.ui.skynet.widgets.GenericViewPart;
import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.swt.dnd.Clipboard;
import org.eclipse.swt.layout.GridData;
@@ -54,14 +55,14 @@ import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.part.ViewPart;
+import org.osgi.service.prefs.Preferences;
/**
* Displays persisted changes made to an artifact.
*
* @author Jeff C. Phillips
*/
-public class BranchView extends ViewPart implements IActionable, IBranchEventListener, ITransactionEventListener, ITransactionRecordSelectionProvider {
+public class BranchView extends GenericViewPart implements IBranchEventListener, ITransactionEventListener, ITransactionRecordSelectionProvider {
public static final String VIEW_ID = "org.eclipse.osee.framework.ui.skynet.widgets.xBranch.BranchView";
private BranchViewPresentationPreferences branchViewPresentationPreferences;
public static final String BRANCH_ID = "branchId";
@@ -81,11 +82,6 @@ public class BranchView extends ViewPart implements IActionable, IBranchEventLis
}
@Override
- public void setFocus() {
- // do nothing
- }
-
- @Override
public void createPartControl(Composite parent) {
setPartName("Branch Manager");
@@ -139,11 +135,7 @@ public class BranchView extends ViewPart implements IActionable, IBranchEventLis
OseeStatusContributionItemFactory.addTo(this, true);
getViewSite().getActionBars().updateActionBars();
- }
-
- @Override
- public String getActionDescription() {
- return "";
+ setFocusWidget(xBranchWidget.getControl());
}
public static void revealBranch(Branch branch) throws OseeCoreException {
@@ -219,4 +211,4 @@ public class BranchView extends ViewPart implements IActionable, IBranchEventLis
xBranchWidget.getXViewer().update(records.toArray(new TransactionRecord[records.size()]), null);
}
-} \ No newline at end of file
+}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xBranch/XBranchWidget.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xBranch/XBranchWidget.java
index 9e8ab48..7ec31aa 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xBranch/XBranchWidget.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xBranch/XBranchWidget.java
@@ -26,13 +26,12 @@ import org.eclipse.osee.framework.core.model.TransactionRecord;
import org.eclipse.osee.framework.jdk.core.util.AHTML;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.framework.plugin.core.IActionable;
import org.eclipse.osee.framework.plugin.core.util.Jobs;
import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
import org.eclipse.osee.framework.ui.plugin.OseeUiActions;
import org.eclipse.osee.framework.ui.plugin.PluginUiImage;
import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
-import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
+import org.eclipse.osee.framework.ui.skynet.widgets.GenericXWidget;
import org.eclipse.osee.framework.ui.swt.ALayout;
import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.ImageManager;
@@ -49,9 +48,10 @@ import org.eclipse.swt.widgets.ToolItem;
import org.eclipse.swt.widgets.Tree;
/**
+ * @author Karol M. Wilk
* @author Jeff C. Phillips
*/
-public class XBranchWidget extends XWidget implements IActionable {
+public class XBranchWidget extends GenericXWidget {
private BranchXViewer branchXViewer;
public final static String normalColor = "#EEEEEE";
private static final String LOADING = "Loading ...";
@@ -60,22 +60,18 @@ public class XBranchWidget extends XWidget implements IActionable {
private XBranchLabelProvider xBranchLabelProvider;
private FavoriteSorter sorter;
private static final String VIEW_ID = "BrachView";
- private boolean filterRealTime;
- private boolean searchRealTime;
+ private final boolean filterRealTime;
+ private final boolean searchRealTime;
private ToolBar toolBar;
- public XBranchWidget(boolean filterRealTime, boolean searchRealTime) {
- this();
-
- this.filterRealTime = filterRealTime;
- this.searchRealTime = searchRealTime;
+ public XBranchWidget() {
+ this(false, false);
}
- public XBranchWidget() {
+ public XBranchWidget(boolean filterRealTime, boolean searchRealTime) {
super(VIEW_ID);
-
- this.filterRealTime = false;
- this.searchRealTime = false;
+ this.filterRealTime = filterRealTime;
+ this.searchRealTime = searchRealTime;
}
public void setBranchOptions(boolean state, BranchOptionsEnum... options) {
@@ -242,11 +238,6 @@ public class XBranchWidget extends XWidget implements IActionable {
}
@Override
- public void setFocus() {
- branchXViewer.getTree().setFocus();
- }
-
- @Override
public void refresh() {
loadData();
branchXViewer.refresh();
@@ -309,24 +300,4 @@ public class XBranchWidget extends XWidget implements IActionable {
};
Jobs.startJob(job);
}
-
- @Override
- public String getReportData() {
- return null;
- }
-
- @Override
- public String getXmlData() {
- return null;
- }
-
- @Override
- public void setXmlData(String str) {
- // do nothing
- }
-
- @Override
- public String getActionDescription() {
- return null;
- }
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xHistory/HistoryView.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xHistory/HistoryView.java
index 8a594ce..63ebac3 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xHistory/HistoryView.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xHistory/HistoryView.java
@@ -33,7 +33,6 @@ import org.eclipse.osee.framework.core.model.TransactionRecord;
import org.eclipse.osee.framework.help.ui.OseeHelpContext;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.framework.plugin.core.IActionable;
import org.eclipse.osee.framework.plugin.core.util.Jobs;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
@@ -58,6 +57,7 @@ import org.eclipse.osee.framework.ui.skynet.change.ChangeUiUtil;
import org.eclipse.osee.framework.ui.skynet.listener.IRebuildMenuListener;
import org.eclipse.osee.framework.ui.skynet.menu.ArtifactDiffMenu;
import org.eclipse.osee.framework.ui.skynet.util.SkynetViews;
+import org.eclipse.osee.framework.ui.skynet.widgets.GenericViewPart;
import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.ImageManager;
import org.eclipse.swt.SWT;
@@ -74,15 +74,15 @@ import org.eclipse.ui.IMemento;
import org.eclipse.ui.IViewSite;
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.part.ViewPart;
/**
* Displays persisted changes made to an artifact.
*
* @author Jeff C. Phillips
*/
-public class HistoryView extends ViewPart implements IActionable, IBranchEventListener, ITransactionRecordSelectionProvider, IRebuildMenuListener {
+public class HistoryView extends GenericViewPart implements IBranchEventListener, ITransactionRecordSelectionProvider, IRebuildMenuListener {
public static final String VIEW_ID = "org.eclipse.osee.framework.ui.skynet.widgets.xHistory.HistoryView";
private XHistoryWidget xHistoryWidget;
@@ -123,17 +123,7 @@ public class HistoryView extends ViewPart implements IActionable, IBranchEventLi
Jobs.startJob(job);
}
- @Override
- public void dispose() {
- super.dispose();
- }
-
- @Override
- public void setFocus() {
- // do nothing
- }
-
- /*
+ /**
* @see IWorkbenchPart#createPartControl(Composite)
*/
@Override
@@ -176,6 +166,8 @@ public class HistoryView extends ViewPart implements IActionable, IBranchEventLi
OseeStatusContributionItemFactory.addTo(this, true);
setupMenus();
+
+ setFocusWidget(xHistoryWidget.getXViewer().getControl());
}
private void setupMenus() {
@@ -246,11 +238,6 @@ public class HistoryView extends ViewPart implements IActionable, IBranchEventLi
}
}
- @Override
- public String getActionDescription() {
- return "";
- }
-
private static final String INPUT = "input";
private static final String ART_GUID = "artifactGuid";
private static final String BRANCH_ID = "branchId";
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xHistory/XHistoryWidget.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xHistory/XHistoryWidget.java
index 3e95a62..2513f71 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xHistory/XHistoryWidget.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xHistory/XHistoryWidget.java
@@ -36,7 +36,7 @@ import org.eclipse.osee.framework.ui.plugin.OseeUiActions;
import org.eclipse.osee.framework.ui.plugin.PluginUiImage;
import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
import org.eclipse.osee.framework.ui.skynet.util.SkynetDragAndDrop;
-import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
+import org.eclipse.osee.framework.ui.skynet.widgets.GenericXWidget;
import org.eclipse.osee.framework.ui.swt.ALayout;
import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.ImageManager;
@@ -57,7 +57,7 @@ import org.eclipse.swt.widgets.Tree;
/**
* @author Jeff C. Phillips
*/
-public class XHistoryWidget extends XWidget implements IActionable {
+public class XHistoryWidget extends GenericXWidget implements IActionable {
private HistoryXViewer xHistoryViewer;
public final static String normalColor = "#EEEEEE";
@@ -137,7 +137,6 @@ public class XHistoryWidget extends XWidget implements IActionable {
}
public void createToolBar() {
-
toolBar = new ToolBar(rightComp, SWT.FLAT | SWT.RIGHT);
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
toolBar.setLayoutData(gd);
@@ -193,11 +192,6 @@ public class XHistoryWidget extends XWidget implements IActionable {
}
@Override
- public void setFocus() {
- xHistoryViewer.getTree().setFocus();
- }
-
- @Override
public void refresh() {
xHistoryViewer.refresh();
validate();
@@ -268,21 +262,6 @@ public class XHistoryWidget extends XWidget implements IActionable {
Jobs.startJob(job);
}
- @Override
- public String getReportData() {
- return null;
- }
-
- @Override
- public String getXmlData() {
- return null;
- }
-
- @Override
- public void setXmlData(String str) {
- // do nothing
- }
-
public class HistoryDragAndDrop extends SkynetDragAndDrop {
public HistoryDragAndDrop(Tree tree, String viewId) {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xbargraph/XBarGraphTable.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xbargraph/XBarGraphTable.java
index 5f05881..92819c0 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xbargraph/XBarGraphTable.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xbargraph/XBarGraphTable.java
@@ -12,10 +12,8 @@ package org.eclipse.osee.framework.ui.skynet.widgets.xbargraph;
import java.util.ArrayList;
import java.util.List;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
import org.eclipse.osee.framework.jdk.core.util.Strings;
-import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
+import org.eclipse.osee.framework.ui.skynet.widgets.XButtonCommon;
import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
@@ -38,7 +36,7 @@ import org.eclipse.swt.widgets.TableItem;
/**
* @author Donald G. Dunne
*/
-public class XBarGraphTable extends XWidget {
+public class XBarGraphTable extends XButtonCommon {
private final String itemHeader;
private final String percentHeader;
@@ -46,6 +44,7 @@ public class XBarGraphTable extends XWidget {
private final List<XBarGraphLine> lines;
private boolean isHeaderVisible = true;
private boolean isLinesVisible = true;
+ private Composite compParent;
public XBarGraphTable(String label, String itemHeader, String percentHeader, List<XBarGraphLine> lines) {
super(label);
@@ -56,10 +55,12 @@ public class XBarGraphTable extends XWidget {
@Override
protected void createControls(Composite parent, int horizontalSpan) {
- labelWidget = new Label(parent, SWT.NONE);
+ compParent = parent;
+
+ labelWidget = new Label(compParent, SWT.NONE);
labelWidget.setText(getLabel() + ": ");
- table = new Table(parent, SWT.BORDER);
+ table = new Table(compParent, SWT.BORDER);
table.setHeaderVisible(isHeaderVisible);
table.setLinesVisible(isLinesVisible);
if (isFillHorizontally()) {
@@ -116,53 +117,16 @@ public class XBarGraphTable extends XWidget {
}
@Override
- public void dispose() {
- // do nothing
- }
-
- @Override
public Control getControl() {
return table;
}
@Override
- public Object getData() {
- return null;
- }
-
- @Override
- public String getReportData() {
- return null;
- }
-
- @Override
- public String getXmlData() {
- return null;
- }
-
- @Override
- public IStatus isValid() {
- return Status.OK_STATUS;
- }
-
- @Override
public void refresh() {
- // do nothing
- }
-
- @Override
- public void setFocus() {
- // do nothing
- }
-
- @Override
- public void setXmlData(String str) {
- // do nothing
- }
-
- @Override
- public String toHTML(String labelFont) {
- return null;
+ Control control = getControl();
+ if (control != null) {
+ control.setFocus();
+ }
}
public static void main(String[] args) {
@@ -195,30 +159,18 @@ public class XBarGraphTable extends XWidget {
display.dispose();
}
- /**
- * @return the isHeaderVisible
- */
public boolean isHeaderVisible() {
return isHeaderVisible;
}
- /**
- * @param isHeaderVisible the isHeaderVisible to set
- */
public void setHeaderVisible(boolean isHeaderVisible) {
this.isHeaderVisible = isHeaderVisible;
}
- /**
- * @return the isLinesVisible
- */
public boolean isLinesVisible() {
return isLinesVisible;
}
- /**
- * @param isLinesVisible the isLinesVisible to set
- */
public void setLinesVisible(boolean isLinesVisible) {
this.isLinesVisible = isLinesVisible;
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeView.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeView.java
index 92eeecc..39e5b09 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeView.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeView.java
@@ -36,7 +36,6 @@ import org.eclipse.osee.framework.core.util.Conditions;
import org.eclipse.osee.framework.help.ui.OseeHelpContext;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.framework.plugin.core.IActionable;
import org.eclipse.osee.framework.plugin.core.util.Jobs;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
@@ -65,6 +64,7 @@ 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.revert.RevertWizard;
import org.eclipse.osee.framework.ui.skynet.util.SkynetViews;
+import org.eclipse.osee.framework.ui.skynet.widgets.GenericViewPart;
import org.eclipse.osee.framework.ui.skynet.widgets.xHistory.HistoryView;
import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.ImageManager;
@@ -81,12 +81,11 @@ import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.handlers.IHandlerService;
import org.eclipse.ui.menus.CommandContributionItem;
-import org.eclipse.ui.part.ViewPart;
/**
* @author Donald G. Dunne
*/
-public class MergeView extends ViewPart implements IActionable, IBranchEventListener, IArtifactEventListener {
+public class MergeView extends GenericViewPart implements IBranchEventListener, IArtifactEventListener {
public static final String VIEW_ID = "org.eclipse.osee.framework.ui.skynet.widgets.xmerge.MergeView";
private MergeXWidget mergeXWidget;
private IHandlerService handlerService;
@@ -151,11 +150,6 @@ public class MergeView extends ViewPart implements IActionable, IBranchEventList
super.dispose();
OseeEventManager.removeListener(this);
OseeEventManager.removeListener(this);
- @Override
- public void setFocus() {
- if (mergeXWidget != null) {
- mergeXWidget.setFocus();
- }
}
@Override
@@ -225,6 +219,8 @@ public class MergeView extends ViewPart implements IActionable, IBranchEventList
OseeEventManager.addListener(this);
OseeEventManager.addListener(this);
+
+ setFocusWidget(mergeXWidget.getControl());
}
private void addPreviewMenuItem(MenuManager menuManager) {
@@ -592,11 +588,6 @@ public class MergeView extends ViewPart implements IActionable, IBranchEventList
}
@Override
- public String getActionDescription() {
- return "";
- }
-
- @Override
public void init(IViewSite site, IMemento memento) throws PartInitException {
super.init(site, memento);
try {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeXWidget.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeXWidget.java
index 7e5d1db..25243f8 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeXWidget.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeXWidget.java
@@ -32,7 +32,6 @@ import org.eclipse.osee.framework.core.data.SystemUser;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.model.Branch;
import org.eclipse.osee.framework.core.model.TransactionRecord;
-import org.eclipse.osee.framework.jdk.core.util.AHTML;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.plugin.core.IActionable;
@@ -57,7 +56,7 @@ import org.eclipse.osee.framework.ui.skynet.cm.OseeCm;
import org.eclipse.osee.framework.ui.skynet.cm.OseeCmEditor;
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.XWidget;
+import org.eclipse.osee.framework.ui.skynet.widgets.GenericXWidget;
import org.eclipse.osee.framework.ui.swt.ALayout;
import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.IDirtiableEditor;
@@ -74,7 +73,7 @@ import org.eclipse.swt.widgets.Tree;
* @author Donald G. Dunne
* @author Theron Virgin
*/
-public class MergeXWidget extends XWidget implements IAdaptable {
+public class MergeXWidget extends GenericXWidget implements IAdaptable {
private static final String COMPLETE_COMMIT_ACTION_ID = "complete.commit.action.id";
private static final String REFRESH_ACTION_ID = "refresh.action.id";
private MergeXViewer mergeXViewer;
@@ -286,11 +285,6 @@ public class MergeXWidget extends XWidget implements IAdaptable {
mergeXViewer.dispose();
}
- @Override
- public void setFocus() {
- mergeXViewer.getTree().setFocus();
- }
-
public Conflict[] getConflicts() {
return mergeXViewer != null ? mergeXViewer.getConflicts() : MergeXViewer.EMPTY_CONFLICTS;
}
@@ -337,26 +331,6 @@ public class MergeXWidget extends XWidget implements IAdaptable {
return Status.OK_STATUS;
}
- @Override
- public void setXmlData(String str) {
- // do nothing
- }
-
- @Override
- public String getXmlData() {
- return null;
- }
-
- @Override
- public String toHTML(String labelFont) {
- return AHTML.simplePage("Unhandled");
- }
-
- @Override
- public String getReportData() {
- return null;
- }
-
/**
* @return Returns the xViewer.
*/
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/ui/XWidgetsExampleBlamUi.xml b/plugins/org.eclipse.osee.framework.ui.skynet/ui/XWidgetsExampleBlamUi.xml
new file mode 100644
index 0000000..cd86640
--- /dev/null
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/ui/XWidgetsExampleBlamUi.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xWidgets>
+ <XWidget xwidgetType="XLabel" displayName="XLabel" />
+ <XWidget xwidgetType="XButtonPush" displayName="XButtonPush"
+ displayLabel="false" />
+ <XWidget xwidgetType="XButton" displayName="XButton"
+ displayLabel="false" />
+ <XWidget xwidgetType="XCheckBox" horizontalLabel="true"
+ labelAfter="false" displayName="XCheckBox" />
+ <XWidget xwidgetType="XText" displayName="XText" />
+ <XWidget xwidgetType="XBranchSelectWidget" horizontalLabel="true"
+ displayName="Branch" />
+ <XWidget xwidgetType="XArtifactTypeComboViewer"
+ horizontalLabel="true" displayName="XArtifactTypeComboViewer" />
+ <XWidget xwidgetType="XArtifactTypeMultiChoiceSelect"
+ horizontalLabel="true" displayName="XArtifactTypeMultiChoiceSelect" />
+ <XWidget xwidgetType="XAttributeTypeComboViewer"
+ horizontalLabel="true" displayName="XAttributeTypeComboViewer" />
+ <XWidget xwidgetType="XAttributeTypeMultiChoiceSelect"
+ horizontalLabel="true" displayName="XAttributeTypeMultiChoiceSelect" />
+ <XWidget xwidgetType="XListDropViewer" displayName="artifacts" />
+ <XWidget xwidgetType="XFileSelectionDialog" displayName="Select Image GIF" />
+ <XWidget xwidgetType="XCombo(1,2,3)" displayName="Select an Option" />
+ <XWidget displayName="Problem" storageName="ats.Problem"
+ xwidgetType="XTextDam" fill="Vertically" />
+ <XWidget displayName="Submitted to Data Management"
+ storageName="lba.deliverable.Submitted to Data Management"
+ xwidgetType="XDateDam" horizontalLabel="true" />
+ <XWidget displayName="1" storageName="ats.Problem" xwidgetType="XInteger"
+ fill="Vertically" />
+ <XWidget displayName="XSelectFromMultiChoiceBranch"
+ xwidgetType="XSelectFromMultiChoiceBranch" />
+</xWidgets> \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ote.ui.define/src/org/eclipse/osee/ote/ui/define/views/TestRunView.java b/plugins/org.eclipse.osee.ote.ui.define/src/org/eclipse/osee/ote/ui/define/views/TestRunView.java
index 8059bbc..1a7ccf9 100644
--- a/plugins/org.eclipse.osee.ote.ui.define/src/org/eclipse/osee/ote/ui/define/views/TestRunView.java
+++ b/plugins/org.eclipse.osee.ote.ui.define/src/org/eclipse/osee/ote/ui/define/views/TestRunView.java
@@ -25,10 +25,10 @@ import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.osee.framework.help.ui.OseeHelpContext;
import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.framework.plugin.core.IActionable;
import org.eclipse.osee.framework.ui.plugin.OseeUiActions;
import org.eclipse.osee.framework.ui.plugin.PluginUiImage;
import org.eclipse.osee.framework.ui.plugin.util.HelpUtil;
+import org.eclipse.osee.framework.ui.skynet.widgets.GenericViewPart;
import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.ImageManager;
import org.eclipse.osee.ote.ui.define.OteDefineImage;
@@ -48,12 +48,11 @@ import org.eclipse.swt.widgets.Tree;
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.handlers.IHandlerService;
-import org.eclipse.ui.part.ViewPart;
/**
* @author Roberto E. Escobar
*/
-public class TestRunView extends ViewPart implements IActionable, IDataChangedListener {
+public class TestRunView extends GenericViewPart implements IDataChangedListener {
public static final String VIEW_ID = TestRunView.class.getName();
private static final String BEGIN_MESSAGE =
"To begin, drag and drop a test run artifact from artifact explorer or from an artifact search result window. Alternatively, you can drag and drop a test outfile onto this view.";
@@ -69,6 +68,7 @@ public class TestRunView extends ViewPart implements IActionable, IDataChangedLi
@Override
public void createPartControl(Composite parent) {
+
parent.setLayout(new GridLayout());
PlatformUI.getWorkbench().getService(IHandlerService.class);
@@ -108,16 +108,8 @@ public class TestRunView extends ViewPart implements IActionable, IDataChangedLi
HelpUtil.setHelp(parent, OseeHelpContext.TEST_RUN_VIEW);
HelpUtil.setHelp(viewer.getTree(), OseeHelpContext.TEST_RUN_VIEW);
- }
-
- @Override
- public void setFocus() {
- //
- }
- @Override
- public String getActionDescription() {
- return "";
+ setFocusWidget(viewer.getControl());
}
protected void createActions() {
diff --git a/plugins/org.eclipse.osee.ote.ui/src/org/eclipse/osee/ote/ui/navigate/OteNavigateView.java b/plugins/org.eclipse.osee.ote.ui/src/org/eclipse/osee/ote/ui/navigate/OteNavigateView.java
index a73f1db..fe492db 100644
--- a/plugins/org.eclipse.osee.ote.ui/src/org/eclipse/osee/ote/ui/navigate/OteNavigateView.java
+++ b/plugins/org.eclipse.osee.ote.ui/src/org/eclipse/osee/ote/ui/navigate/OteNavigateView.java
@@ -42,6 +42,9 @@ public class OteNavigateView extends ViewPart implements IActionable {
@Override
public void setFocus() {
+ if (xNavComp != null) {
+ xNavComp.setFocus();
+ }
}
/*