Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrescobar2010-07-23 22:53:46 +0000
committerrescobar2010-07-23 22:53:46 +0000
commitc97b410e1accc61b4829375247c6b6efc6382a9e (patch)
treed145ee5eb60a193da93835591d159751dedac593 /plugins/org.eclipse.osee.framework.ui.skynet
parent1c93a625f413a5b1b119c73ff7d3acc5badfe52b (diff)
downloadorg.eclipse.osee-c97b410e1accc61b4829375247c6b6efc6382a9e.tar.gz
org.eclipse.osee-c97b410e1accc61b4829375247c6b6efc6382a9e.tar.xz
org.eclipse.osee-c97b410e1accc61b4829375247c6b6efc6382a9e.zip
"Team Workflow" - YGHW1 - "Block changes to requirements unless done under an appropriate action."
Diffstat (limited to 'plugins/org.eclipse.osee.framework.ui.skynet')
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/META-INF/MANIFEST.MF1
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/IArtifactStoredWidget.java44
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/IArtifactWidget.java35
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/IAttributeWidget.java35
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XCheckBoxDam.java82
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XComboBooleanDam.java115
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XComboDam.java116
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XDateDam.java120
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XFlatDam.java13
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XFloatDam.java92
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XHyperlabelMemberSelDam.java136
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XIntegerDam.java108
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XLabelDam.java221
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XListDam.java82
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XSelectFromMultiChoiceDam.java132
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XStackedDam.java13
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XTextDam.java93
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XTextDescriptiveName.java19
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XWidgetDecorator.java175
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/workflow/DynamicXWidgetLayout.java19
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/workflow/DynamicXWidgetLayoutData.java401
21 files changed, 1203 insertions, 849 deletions
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.framework.ui.skynet/META-INF/MANIFEST.MF
index 7def5d21df8..7218c683d55 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/META-INF/MANIFEST.MF
@@ -48,6 +48,7 @@ Import-Package: com.lowagie.text;version="2.1.7",
org.eclipse.osee.framework.core.enums,
org.eclipse.osee.framework.core.exception,
org.eclipse.osee.framework.core.model,
+ org.eclipse.osee.framework.core.model.access,
org.eclipse.osee.framework.core.model.cache,
org.eclipse.osee.framework.core.model.event,
org.eclipse.osee.framework.core.model.type,
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/IArtifactStoredWidget.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/IArtifactStoredWidget.java
new file mode 100644
index 00000000000..bc61ee0cfcc
--- /dev/null
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/IArtifactStoredWidget.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.framework.ui.skynet.widgets;
+
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+
+/**
+ * Used by XWidgets that perform external data storage
+ *
+ * @author Roberto E. Escobar
+ */
+public interface IArtifactStoredWidget {
+
+ /**
+ * Save data changes to artifact
+ *
+ * @throws Exception
+ */
+ public void saveToArtifact() throws OseeCoreException;
+
+ /**
+ * Revert changes to widget data back to what was in artifact
+ *
+ * @throws Exception
+ */
+ public void revert() throws OseeCoreException;
+
+ /**
+ * Return true if storage data different than widget data
+ *
+ * @throws Exception
+ */
+ public Result isDirty() throws OseeCoreException;
+
+}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/IArtifactWidget.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/IArtifactWidget.java
index ed172749987..50a203cf891 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/IArtifactWidget.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/IArtifactWidget.java
@@ -19,34 +19,13 @@ import org.eclipse.osee.framework.ui.plugin.util.Result;
*
* @author Donald G. Dunne
*/
-public interface IArtifactWidget {
+public interface IArtifactWidget extends IArtifactStoredWidget {
- /**
- * Set artifact used as storage for this widget
- *
- * @throws Exception
- */
- public void setArtifact(Artifact artifact, String attrName) throws OseeCoreException;
-
- /**
- * Save data changes to artifact
- *
- * @throws Exception
- */
- public void saveToArtifact() throws OseeCoreException;
-
- /**
- * Revert changes to widget data back to what was in artifact
- *
- * @throws Exception
- */
- public void revert() throws OseeCoreException;
-
- /**
- * Return true if storage data different than widget data
- *
- * @throws Exception
- */
- public Result isDirty() throws OseeCoreException;
+ /**
+ * Set artifact used as storage for this widget
+ *
+ * @throws Exception
+ */
+ public void setArtifact(Artifact artifact) throws OseeCoreException;
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/IAttributeWidget.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/IAttributeWidget.java
new file mode 100644
index 00000000000..2c303d2fdaf
--- /dev/null
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/IAttributeWidget.java
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.framework.ui.skynet.widgets;
+
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+
+/**
+ * Used by XWidgets that perform external data storage
+ *
+ * @author Roberto E. Escobar
+ */
+public interface IAttributeWidget extends IArtifactStoredWidget {
+
+ /**
+ * Set attributeType used as storage for this widget
+ *
+ * @throws OseeCoreException
+ */
+ public void setAttributeType(Artifact artifact, String attributeTypeName) throws OseeCoreException;
+
+ /**
+ * Get attributeType used as storage for this widget
+ */
+ public String getAttributeType();
+
+}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XCheckBoxDam.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XCheckBoxDam.java
index 52dcf9c6f8c..eb262e4a70d 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XCheckBoxDam.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XCheckBoxDam.java
@@ -20,49 +20,55 @@ import org.eclipse.osee.framework.ui.plugin.util.Result;
/**
* @author Donald G. Dunne
*/
-public class XCheckBoxDam extends XCheckBox implements IArtifactWidget {
+public class XCheckBoxDam extends XCheckBox implements IAttributeWidget {
- private Artifact artifact;
- private String attributeTypeName;
+ private Artifact artifact;
+ private String attributeTypeName;
- public XCheckBoxDam(String displayLabel) {
- super(displayLabel);
- }
+ public XCheckBoxDam(String displayLabel) {
+ super(displayLabel);
+ }
- public void setArtifact(Artifact artifact, String attrName) throws OseeCoreException {
- this.artifact = artifact;
- this.attributeTypeName = attrName;
- super.set(artifact.getSoleAttributeValue(attributeTypeName, Boolean.FALSE));
- }
+ @Override
+ public String getAttributeType() {
+ return attributeTypeName;
+ }
- @Override
- public void saveToArtifact() throws OseeCoreException {
- artifact.setSoleAttributeValue(attributeTypeName, checkButton.getSelection());
- }
+ @Override
+ public void setAttributeType(Artifact artifact, String attrName) throws OseeCoreException {
+ this.artifact = artifact;
+ this.attributeTypeName = attrName;
+ super.set(artifact.getSoleAttributeValue(attributeTypeName, Boolean.FALSE));
+ }
- @Override
- public Result isDirty() throws OseeCoreException {
- if (checkButton != null && !checkButton.isDisposed()) {
- Boolean enteredValue = checkButton.getSelection();
- Boolean storedValue = artifact.getSoleAttributeValue(attributeTypeName, false);
- if (enteredValue.booleanValue() != storedValue.booleanValue()) {
- return new Result(true, attributeTypeName + " is dirty");
- }
- }
- return Result.FalseResult;
- }
+ @Override
+ public void saveToArtifact() throws OseeCoreException {
+ artifact.setSoleAttributeValue(attributeTypeName, checkButton.getSelection());
+ }
- @Override
- public void revert() throws OseeCoreException {
- setArtifact(artifact, attributeTypeName);
- }
+ @Override
+ public Result isDirty() throws OseeCoreException {
+ if (checkButton != null && !checkButton.isDisposed()) {
+ Boolean enteredValue = checkButton.getSelection();
+ Boolean storedValue = artifact.getSoleAttributeValue(attributeTypeName, false);
+ if (enteredValue.booleanValue() != storedValue.booleanValue()) {
+ return new Result(true, attributeTypeName + " is dirty");
+ }
+ }
+ return Result.FalseResult;
+ }
- @Override
- public IStatus isValid() {
- IStatus status = super.isValid();
- if (status.isOK()) {
- status = OseeValidator.getInstance().validate(IOseeValidator.SHORT, artifact, attributeTypeName, get());
- }
- return status;
- }
+ @Override
+ public void revert() throws OseeCoreException {
+ setAttributeType(artifact, attributeTypeName);
+ }
+
+ @Override
+ public IStatus isValid() {
+ IStatus status = super.isValid();
+ if (status.isOK()) {
+ status = OseeValidator.getInstance().validate(IOseeValidator.SHORT, artifact, attributeTypeName, get());
+ }
+ return status;
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XComboBooleanDam.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XComboBooleanDam.java
index 80a180ead0c..6e2af8bbf50 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XComboBooleanDam.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XComboBooleanDam.java
@@ -21,64 +21,73 @@ import org.eclipse.osee.framework.skynet.core.validation.OseeValidator;
import org.eclipse.osee.framework.ui.plugin.util.Result;
import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
-public class XComboBooleanDam extends XCombo implements IArtifactWidget {
+public class XComboBooleanDam extends XCombo implements IAttributeWidget {
- private Artifact artifact;
- private String attributeTypeName;
+ private Artifact artifact;
+ private String attributeTypeName;
- public XComboBooleanDam(String displayLabel) {
- super(displayLabel);
- }
+ public XComboBooleanDam(String displayLabel) {
+ super(displayLabel);
+ }
- public void setArtifact(Artifact artifact, String attrName) throws OseeCoreException {
- this.artifact = artifact;
- this.attributeTypeName = attrName;
- Boolean result = artifact.getSoleAttributeValue(attrName, null);
- if (result == null)
- super.set("");
- else
- super.set(result ? "yes" : "no");
- }
+ @Override
+ public String getAttributeType() {
+ return attributeTypeName;
+ }
- @Override
- public void saveToArtifact() throws OseeCoreException {
- try {
- if (data == null || data.equals("")) {
- artifact.deleteSoleAttribute(attributeTypeName);
- } else {
- String enteredValue = get();
- artifact.setSoleAttributeValue(attributeTypeName, (enteredValue != null && enteredValue.equals("yes")));
- }
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- }
- }
+ @Override
+ public void setAttributeType(Artifact artifact, String attrName) throws OseeCoreException {
+ this.artifact = artifact;
+ this.attributeTypeName = attrName;
+ Boolean result = artifact.getSoleAttributeValue(attrName, null);
+ if (result == null) {
+ super.set("");
+ } else {
+ super.set(result ? "yes" : "no");
+ }
+ }
- @Override
- public Result isDirty() throws OseeCoreException {
- try {
- String enteredValue = get();
- boolean storedValue = artifact.getSoleAttributeValue(attributeTypeName);
- if (enteredValue.equals("yes") != storedValue) {
- return new Result(true, attributeTypeName + " is dirty");
- }
- } catch (AttributeDoesNotExist ex) {
- if (!get().equals("")) return new Result(true, attributeTypeName + " is dirty");
- }
- return Result.FalseResult;
- }
+ @Override
+ public void saveToArtifact() {
+ try {
+ if (data == null || data.equals("")) {
+ artifact.deleteSoleAttribute(attributeTypeName);
+ } else {
+ String enteredValue = get();
+ artifact.setSoleAttributeValue(attributeTypeName, (enteredValue != null && enteredValue.equals("yes")));
+ }
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ }
- @Override
- public void revert() throws OseeCoreException {
- setArtifact(artifact, attributeTypeName);
- }
+ @Override
+ public Result isDirty() throws OseeCoreException {
+ try {
+ String enteredValue = get();
+ boolean storedValue = artifact.getSoleAttributeValue(attributeTypeName);
+ if (enteredValue.equals("yes") != storedValue) {
+ return new Result(true, attributeTypeName + " is dirty");
+ }
+ } catch (AttributeDoesNotExist ex) {
+ if (!get().equals("")) {
+ return new Result(true, attributeTypeName + " is dirty");
+ }
+ }
+ return Result.FalseResult;
+ }
- @Override
- public IStatus isValid() {
- IStatus status = super.isValid();
- if (status.isOK()) {
- status = OseeValidator.getInstance().validate(IOseeValidator.SHORT, artifact, attributeTypeName, get());
- }
- return status;
- }
+ @Override
+ public void revert() throws OseeCoreException {
+ setAttributeType(artifact, attributeTypeName);
+ }
+
+ @Override
+ public IStatus isValid() {
+ IStatus status = super.isValid();
+ if (status.isOK()) {
+ status = OseeValidator.getInstance().validate(IOseeValidator.SHORT, artifact, attributeTypeName, get());
+ }
+ return status;
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XComboDam.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XComboDam.java
index bf3f42f6b58..42e20bb707b 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XComboDam.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XComboDam.java
@@ -22,66 +22,74 @@ import org.eclipse.osee.framework.skynet.core.validation.OseeValidator;
import org.eclipse.osee.framework.ui.plugin.util.Result;
import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
-public class XComboDam extends XCombo implements IArtifactWidget {
+public class XComboDam extends XCombo implements IAttributeWidget {
- private Artifact artifact;
- private String attributeTypeName;
+ private Artifact artifact;
+ private String attributeTypeName;
- public XComboDam(String displayLabel) {
- super(displayLabel);
- }
+ public XComboDam(String displayLabel) {
+ super(displayLabel);
+ }
- public void setArtifact(Artifact artifact, String attrName) throws OseeCoreException {
- this.artifact = artifact;
- this.attributeTypeName = attrName;
- try {
- String value = artifact.getSoleAttributeValue(attributeTypeName);
- super.set(value.toString());
- } catch (AttributeDoesNotExist ex) {
- super.set("");
- }
- }
+ @Override
+ public String getAttributeType() {
+ return attributeTypeName;
+ }
- @Override
- public void saveToArtifact() throws OseeCoreException {
- try {
- if (!Strings.isValid(data)) {
- artifact.deleteSoleAttribute(attributeTypeName);
- } else {
- String enteredValue = get();
- artifact.setSoleAttributeValue(attributeTypeName, enteredValue);
- }
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- }
- }
+ @Override
+ public void setAttributeType(Artifact artifact, String attrName) throws OseeCoreException {
+ this.artifact = artifact;
+ this.attributeTypeName = attrName;
+ try {
+ String value = artifact.getSoleAttributeValue(attributeTypeName);
+ super.set(value.toString());
+ } catch (AttributeDoesNotExist ex) {
+ super.set("");
+ }
+ }
- @Override
- public Result isDirty() throws OseeCoreException {
- try {
- String enteredValue = get();
- String storedValue = artifact.getSoleAttributeValue(attributeTypeName);
- if (!enteredValue.equals(storedValue)) {
- return new Result(true, attributeTypeName + " is dirty");
- }
- } catch (AttributeDoesNotExist ex) {
- if (!get().equals("")) return new Result(true, attributeTypeName + " is dirty");
- }
- return Result.FalseResult;
- }
+ @Override
+ public void saveToArtifact() {
+ try {
+ if (!Strings.isValid(data)) {
+ artifact.deleteSoleAttribute(attributeTypeName);
+ } else {
+ String enteredValue = get();
+ artifact.setSoleAttributeValue(attributeTypeName, enteredValue);
+ }
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ }
- @Override
- public IStatus isValid() {
- IStatus status = super.isValid();
- if (status.isOK() && !data.equals("")) {
- status = OseeValidator.getInstance().validate(IOseeValidator.SHORT, artifact, attributeTypeName, get());
- }
- return status;
- }
+ @Override
+ public Result isDirty() throws OseeCoreException {
+ try {
+ String enteredValue = get();
+ String storedValue = artifact.getSoleAttributeValue(attributeTypeName);
+ if (!enteredValue.equals(storedValue)) {
+ return new Result(true, attributeTypeName + " is dirty");
+ }
+ } catch (AttributeDoesNotExist ex) {
+ if (!get().equals("")) {
+ return new Result(true, attributeTypeName + " is dirty");
+ }
+ }
+ return Result.FalseResult;
+ }
- @Override
- public void revert() throws OseeCoreException {
- setArtifact(artifact, attributeTypeName);
- }
+ @Override
+ public IStatus isValid() {
+ IStatus status = super.isValid();
+ if (status.isOK() && !data.equals("")) {
+ status = OseeValidator.getInstance().validate(IOseeValidator.SHORT, artifact, attributeTypeName, get());
+ }
+ return status;
+ }
+
+ @Override
+ public void revert() throws OseeCoreException {
+ setAttributeType(artifact, attributeTypeName);
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XDateDam.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XDateDam.java
index 67d0a6bc3e5..250219db231 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XDateDam.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XDateDam.java
@@ -21,68 +21,74 @@ import org.eclipse.osee.framework.skynet.core.validation.OseeValidator;
import org.eclipse.osee.framework.ui.plugin.util.Result;
import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
-public class XDateDam extends XDate implements IArtifactWidget {
+public class XDateDam extends XDate implements IAttributeWidget {
- private Artifact artifact;
- private String attributeTypeName;
+ private Artifact artifact;
+ private String attributeTypeName;
- public XDateDam(String displayLabel) {
- super(displayLabel);
- }
+ public XDateDam(String displayLabel) {
+ super(displayLabel);
+ }
- public void setArtifact(Artifact artifact, String attrName) throws OseeCoreException {
- this.artifact = artifact;
- this.attributeTypeName = attrName;
- Date value = artifact.getSoleAttributeValue(attributeTypeName, null);
- if (value != null) {
- super.setDate(value);
- }
- }
+ @Override
+ public String getAttributeType() {
+ return attributeTypeName;
+ }
- @Override
- public void saveToArtifact() throws OseeCoreException {
- try {
- if (date == null) {
- artifact.deleteSoleAttribute(attributeTypeName);
- } else {
- Date enteredValue = getDate();
- artifact.setSoleAttributeValue(attributeTypeName, enteredValue);
- }
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- }
- }
+ @Override
+ public void setAttributeType(Artifact artifact, String attrName) throws OseeCoreException {
+ this.artifact = artifact;
+ this.attributeTypeName = attrName;
+ Date value = artifact.getSoleAttributeValue(attributeTypeName, null);
+ if (value != null) {
+ super.setDate(value);
+ }
+ }
- @Override
- public Result isDirty() throws OseeCoreException {
- Date enteredValue = getDate();
- Date storedValue = artifact.getSoleAttributeValue(attributeTypeName, null);
- if (enteredValue == null && storedValue == null) {
- return Result.FalseResult;
- }
- if (enteredValue == null && storedValue != null) {
- return new Result(true, attributeTypeName + " is dirty");
- }
- if (enteredValue != null && storedValue == null) {
- return new Result(true, attributeTypeName + " is dirty");
- }
- if (enteredValue.getTime() != storedValue.getTime()) {
- return new Result(true, attributeTypeName + " is dirty");
- }
- return Result.FalseResult;
- }
+ @Override
+ public void saveToArtifact() {
+ try {
+ if (date == null) {
+ artifact.deleteSoleAttribute(attributeTypeName);
+ } else {
+ Date enteredValue = getDate();
+ artifact.setSoleAttributeValue(attributeTypeName, enteredValue);
+ }
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ }
- @Override
- public void revert() throws OseeCoreException {
- setArtifact(artifact, attributeTypeName);
- }
+ @Override
+ public Result isDirty() throws OseeCoreException {
+ Date enteredValue = getDate();
+ Date storedValue = artifact.getSoleAttributeValue(attributeTypeName, null);
+ if (enteredValue == null && storedValue == null) {
+ return Result.FalseResult;
+ }
+ if (enteredValue == null && storedValue != null) {
+ return new Result(true, attributeTypeName + " is dirty");
+ }
+ if (enteredValue != null && storedValue == null) {
+ return new Result(true, attributeTypeName + " is dirty");
+ }
+ if (enteredValue.getTime() != storedValue.getTime()) {
+ return new Result(true, attributeTypeName + " is dirty");
+ }
+ return Result.FalseResult;
+ }
- @Override
- public IStatus isValid() {
- IStatus status = super.isValid();
- if (status.isOK()) {
- status = OseeValidator.getInstance().validate(IOseeValidator.SHORT, artifact, attributeTypeName, get());
- }
- return status;
- }
+ @Override
+ public void revert() throws OseeCoreException {
+ setAttributeType(artifact, attributeTypeName);
+ }
+
+ @Override
+ public IStatus isValid() {
+ IStatus status = super.isValid();
+ if (status.isOK()) {
+ status = OseeValidator.getInstance().validate(IOseeValidator.SHORT, artifact, attributeTypeName, get());
+ }
+ return status;
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XFlatDam.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XFlatDam.java
index d93e71db3bf..94be314424d 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XFlatDam.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XFlatDam.java
@@ -42,7 +42,7 @@ import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.progress.UIJob;
-public class XFlatDam extends XFlatWidget<String> implements IArtifactWidget {
+public class XFlatDam extends XFlatWidget<String> implements IAttributeWidget {
private Artifact artifact;
private String attributeTypeName;
private final Map<String, XWidget> xWidgets;
@@ -53,13 +53,20 @@ public class XFlatDam extends XFlatWidget<String> implements IArtifactWidget {
this.xWidgets = new LinkedHashMap<String, XWidget>();
this.artifact = null;
this.xModifiedListener = new XModifiedListener() {
+ @Override
public void widgetModified(XWidget widget) {
notifyXModifiedListeners();
};
};
}
- public void setArtifact(Artifact artifact, String attributeTypeName) throws OseeCoreException {
+ @Override
+ public String getAttributeType() {
+ return attributeTypeName;
+ }
+
+ @Override
+ public void setAttributeType(Artifact artifact, String attributeTypeName) throws OseeCoreException {
this.artifact = artifact;
this.attributeTypeName = attributeTypeName;
AttributeType attributeType = AttributeTypeManager.getType(attributeTypeName);
@@ -143,7 +150,7 @@ public class XFlatDam extends XFlatWidget<String> implements IArtifactWidget {
@Override
public void revert() throws OseeCoreException {
- setArtifact(artifact, attributeTypeName);
+ setAttributeType(artifact, attributeTypeName);
}
@Override
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 f707c7d9892..01d3a55b707 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
@@ -21,54 +21,60 @@ import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
/**
* @author Donald G. Dunne
*/
-public class XFloatDam extends XFloat implements IArtifactWidget {
+public class XFloatDam extends XFloat implements IAttributeWidget {
- private Artifact artifact;
- private String attributeTypeName;
+ private Artifact artifact;
+ private String attributeTypeName;
- public XFloatDam(String displayLabel) {
- super(displayLabel);
- }
+ public XFloatDam(String displayLabel) {
+ super(displayLabel);
+ }
- public XFloatDam(String displayLabel, String xmlRoot) {
- super(displayLabel, xmlRoot);
- }
+ public XFloatDam(String displayLabel, String xmlRoot) {
+ super(displayLabel, xmlRoot);
+ }
- public void setArtifact(Artifact artifact, String attrName) throws OseeCoreException {
- this.artifact = artifact;
- this.attributeTypeName = attrName;
- Double value = artifact.getSoleAttributeValue(attributeTypeName, null);
- super.set(value == null ? "" : NumberFormat.getInstance().format(value));
- }
+ @Override
+ public String getAttributeType() {
+ return attributeTypeName;
+ }
- @Override
- public void saveToArtifact() throws OseeCoreException {
- try {
- if (text == null || text.equals("")) {
- artifact.deleteSoleAttribute(attributeTypeName);
- } else {
- Double enteredValue = getFloat();
- artifact.setSoleAttributeValue(attributeTypeName, enteredValue);
- }
- } catch (NumberFormatException ex) {
- // do nothing
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- }
- }
+ @Override
+ public void setAttributeType(Artifact artifact, String attrName) throws OseeCoreException {
+ this.artifact = artifact;
+ this.attributeTypeName = attrName;
+ Double value = artifact.getSoleAttributeValue(attributeTypeName, null);
+ super.set(value == null ? "" : NumberFormat.getInstance().format(value));
+ }
- @Override
- public Result isDirty() throws OseeCoreException {
- Double enteredValue = getFloat();
- Double storedValue = artifact.getSoleAttributeValue(attributeTypeName, 0.0);
- if (enteredValue.doubleValue() != storedValue.doubleValue()) {
- return new Result(true, attributeTypeName + " is dirty");
- }
- return Result.FalseResult;
- }
+ @Override
+ public void saveToArtifact() {
+ try {
+ if (text == null || text.equals("")) {
+ artifact.deleteSoleAttribute(attributeTypeName);
+ } else {
+ Double enteredValue = getFloat();
+ artifact.setSoleAttributeValue(attributeTypeName, enteredValue);
+ }
+ } catch (NumberFormatException ex) {
+ // do nothing
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ }
- @Override
- public void revert() throws OseeCoreException {
- setArtifact(artifact, attributeTypeName);
- }
+ @Override
+ public Result isDirty() throws OseeCoreException {
+ Double enteredValue = getFloat();
+ Double storedValue = artifact.getSoleAttributeValue(attributeTypeName, 0.0);
+ if (enteredValue.doubleValue() != storedValue.doubleValue()) {
+ return new Result(true, attributeTypeName + " is dirty");
+ }
+ return Result.FalseResult;
+ }
+
+ @Override
+ public void revert() throws OseeCoreException {
+ setAttributeType(artifact, attributeTypeName);
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XHyperlabelMemberSelDam.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XHyperlabelMemberSelDam.java
index 15b4aa7562f..f0d78e77c08 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XHyperlabelMemberSelDam.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XHyperlabelMemberSelDam.java
@@ -26,78 +26,86 @@ import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.ui.plugin.util.Result;
import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
-public class XHyperlabelMemberSelDam extends XHyperlabelMemberSelection implements IArtifactWidget {
+public class XHyperlabelMemberSelDam extends XHyperlabelMemberSelection implements IAttributeWidget {
- private Artifact artifact;
- private String attributeTypeName;
+ private Artifact artifact;
+ private String attributeTypeName;
- public XHyperlabelMemberSelDam(String displayLabel) {
- super(displayLabel);
- }
+ public XHyperlabelMemberSelDam(String displayLabel) {
+ super(displayLabel);
+ }
- public void setArtifact(Artifact artifact, String attrName) {
- this.artifact = artifact;
- this.attributeTypeName = attrName;
+ @Override
+ public String getAttributeType() {
+ return attributeTypeName;
+ }
- super.setSelectedUsers(getUsers());
- }
+ @Override
+ public void setAttributeType(Artifact artifact, String attrName) {
+ this.artifact = artifact;
+ this.attributeTypeName = attrName;
- public Set<User> getUsers() {
- Set<User> users = new HashSet<User>();
- try {
- Matcher m =
- Pattern.compile("<userId>(.*?)</userId>").matcher(artifact.getSoleAttributeValue(attributeTypeName, ""));
- while (m.find()) {
- users.add(UserManager.getUserByUserId(m.group(1)));
- }
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- }
+ super.setSelectedUsers(getUsers());
+ }
- return users;
- }
+ public Set<User> getUsers() {
+ Set<User> users = new HashSet<User>();
+ try {
+ Matcher m =
+ Pattern.compile("<userId>(.*?)</userId>").matcher(
+ artifact.getSoleAttributeValue(attributeTypeName, ""));
+ while (m.find()) {
+ users.add(UserManager.getUserByUserId(m.group(1)));
+ }
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ }
- @Override
- public void saveToArtifact() throws OseeCoreException {
- try {
- String selectedStrValue = getSelectedStringValue();
- if (selectedStrValue == null || selectedStrValue.equals("")) {
- artifact.deleteSoleAttribute(attributeTypeName);
- } else {
- artifact.setSoleAttributeValue(attributeTypeName, selectedStrValue);
- }
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- }
- }
+ return users;
+ }
- public String getSelectedStringValue() throws OseeCoreException {
- StringBuffer sb = new StringBuffer();
- for (User user : getSelectedUsers()) {
- sb.append(AXml.addTagData("userId", user.getUserId()));
- }
- return sb.toString();
- }
+ @Override
+ public void saveToArtifact() {
+ try {
+ String selectedStrValue = getSelectedStringValue();
+ if (selectedStrValue == null || selectedStrValue.equals("")) {
+ artifact.deleteSoleAttribute(attributeTypeName);
+ } else {
+ artifact.setSoleAttributeValue(attributeTypeName, selectedStrValue);
+ }
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ }
- @Override
- public Result isDirty() throws OseeCoreException {
- try {
- String enteredValue = getSelectedStringValue();
- String storedValue = artifact.getSoleAttributeValue(attributeTypeName);
- if (!enteredValue.equals(storedValue)) {
- return new Result(true, attributeTypeName + " is dirty");
- }
- } catch (AttributeDoesNotExist ex) {
- if (!artifact.getSoleAttributeValue(attributeTypeName, "").equals("")) return new Result(true,
- attributeTypeName + " is dirty");
- } catch (NumberFormatException ex) {
- // do nothing
- }
- return Result.FalseResult;
- }
+ public String getSelectedStringValue() throws OseeCoreException {
+ StringBuffer sb = new StringBuffer();
+ for (User user : getSelectedUsers()) {
+ sb.append(AXml.addTagData("userId", user.getUserId()));
+ }
+ return sb.toString();
+ }
- @Override
- public void revert() throws OseeCoreException {
- setArtifact(artifact, attributeTypeName);
- }
+ @Override
+ public Result isDirty() throws OseeCoreException {
+ try {
+ String enteredValue = getSelectedStringValue();
+ String storedValue = artifact.getSoleAttributeValue(attributeTypeName);
+ if (!enteredValue.equals(storedValue)) {
+ return new Result(true, attributeTypeName + " is dirty");
+ }
+ } catch (AttributeDoesNotExist ex) {
+ if (!artifact.getSoleAttributeValue(attributeTypeName, "").equals("")) {
+ return new Result(true, attributeTypeName + " is dirty");
+ }
+ } catch (NumberFormatException ex) {
+ // do nothing
+ }
+ return Result.FalseResult;
+ }
+
+ @Override
+ public void revert() throws OseeCoreException {
+ setAttributeType(artifact, attributeTypeName);
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XIntegerDam.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XIntegerDam.java
index cb0c48e67ca..303971d0b00 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XIntegerDam.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XIntegerDam.java
@@ -18,61 +18,69 @@ import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.ui.plugin.util.Result;
import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
-public class XIntegerDam extends XInteger implements IArtifactWidget {
+public class XIntegerDam extends XInteger implements IAttributeWidget {
- private Artifact artifact;
- private String attributeTypeName;
+ private Artifact artifact;
+ private String attributeTypeName;
- public XIntegerDam(String displayLabel) {
- super(displayLabel);
- }
+ public XIntegerDam(String displayLabel) {
+ super(displayLabel);
+ }
- public void setArtifact(Artifact artifact, String attrName) throws OseeCoreException {
- this.artifact = artifact;
- this.attributeTypeName = attrName;
- try {
- Integer value = artifact.getSoleAttributeValue(attributeTypeName);
- super.set(value.toString());
- } catch (AttributeDoesNotExist ex) {
- super.set("");
- }
- }
+ @Override
+ public String getAttributeType() {
+ return attributeTypeName;
+ }
- @Override
- public void saveToArtifact() throws OseeCoreException {
- try {
- if (text == null || text.equals("")) {
- artifact.deleteSoleAttribute(attributeTypeName);
- } else {
- Integer enteredValue = getInteger();
- artifact.setSoleAttributeValue(attributeTypeName, enteredValue);
- }
- } catch (NumberFormatException ex) {
- // do nothing
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- }
- }
+ @Override
+ public void setAttributeType(Artifact artifact, String attrName) throws OseeCoreException {
+ this.artifact = artifact;
+ this.attributeTypeName = attrName;
+ try {
+ Integer value = artifact.getSoleAttributeValue(attributeTypeName);
+ super.set(value.toString());
+ } catch (AttributeDoesNotExist ex) {
+ super.set("");
+ }
+ }
- @Override
- public Result isDirty() throws OseeCoreException {
- try {
- Integer enteredValue = getInteger();
- Integer storedValue = artifact.getSoleAttributeValue(attributeTypeName);
- if (enteredValue.doubleValue() != storedValue.doubleValue()) {
- return new Result(true, attributeTypeName + " is dirty");
- }
- } catch (AttributeDoesNotExist ex) {
- if (!get().equals("")) return new Result(true, attributeTypeName + " is dirty");
- } catch (NumberFormatException ex) {
- // do nothing
- }
- return Result.FalseResult;
- }
+ @Override
+ public void saveToArtifact() {
+ try {
+ if (text == null || text.equals("")) {
+ artifact.deleteSoleAttribute(attributeTypeName);
+ } else {
+ Integer enteredValue = getInteger();
+ artifact.setSoleAttributeValue(attributeTypeName, enteredValue);
+ }
+ } catch (NumberFormatException ex) {
+ // do nothing
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ }
- @Override
- public void revert() throws OseeCoreException {
- setArtifact(artifact, attributeTypeName);
- }
+ @Override
+ public Result isDirty() throws OseeCoreException {
+ try {
+ Integer enteredValue = getInteger();
+ Integer storedValue = artifact.getSoleAttributeValue(attributeTypeName);
+ if (enteredValue.doubleValue() != storedValue.doubleValue()) {
+ return new Result(true, attributeTypeName + " is dirty");
+ }
+ } catch (AttributeDoesNotExist ex) {
+ if (!get().equals("")) {
+ return new Result(true, attributeTypeName + " is dirty");
+ }
+ } catch (NumberFormatException ex) {
+ // do nothing
+ }
+ return Result.FalseResult;
+ }
+
+ @Override
+ public void revert() throws OseeCoreException {
+ setAttributeType(artifact, attributeTypeName);
+ }
}
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 28f3fcf06c8..d18d019b5fb 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
@@ -29,107 +29,124 @@ import org.eclipse.swt.widgets.Text;
*
* @author Donald G. Dunne
*/
-public class XLabelDam extends XWidget implements IArtifactWidget {
-
- private Artifact artifact;
- private String attributeTypeName;
- private Text valueTextWidget;
- private Composite parent;
-
- public XLabelDam(String displayLabel) {
- super(displayLabel);
- }
-
- @Override
- public Control getControl() {
- return valueTextWidget;
- }
-
- protected void createControls(Composite parent, int horizontalSpan) {
- this.parent = parent;
- if (horizontalSpan < 2) horizontalSpan = 2;
- // Create Data Widgets
- if (isDisplayLabel() && !getLabel().equals("")) {
- labelWidget = new Label(parent, SWT.NONE);
- labelWidget.setText(getLabel() + ":");
- if (getToolTip() != null) {
- labelWidget.setToolTipText(getToolTip());
- }
- }
- valueTextWidget = new Text(parent, SWT.NONE);
- valueTextWidget.setEditable(false);
- refresh();
- }
-
- public void setArtifact(Artifact artifact, String attrName) {
- this.artifact = artifact;
- this.attributeTypeName = attrName;
-
- refresh();
- }
-
- @Override
- public void saveToArtifact() {
- // Do nothing cause labelDam is read-only
- }
-
- @Override
- public Result isDirty() {
- return Result.FalseResult;
- }
-
- public void refresh() {
- if (artifact != null && valueTextWidget != null && !valueTextWidget.isDisposed()) {
- try {
- valueTextWidget.setText(artifact.getAttributesToString(attributeTypeName));
- } catch (OseeCoreException ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- }
- }
- }
-
- public void dispose() {
- if (labelWidget != null) labelWidget.dispose();
- if (valueTextWidget != null) valueTextWidget.dispose();
- if (parent != null && !parent.isDisposed()) parent.layout();
- }
-
- @Override
- public String getReportData() {
- return null;
- }
-
- @Override
- public String getXmlData() {
- return null;
- }
-
- @Override
- public IStatus isValid() {
- return Status.OK_STATUS;
- }
-
- @Override
- public void setFocus() {
- }
-
- @Override
- public void setXmlData(String str) {
- }
-
- @Override
- public String toHTML(String labelFont) {
- return "";
- }
-
- @Override
- public Object getData() {
- return valueTextWidget.getText();
- }
-
- @Override
- public void revert() {
- // Do nothing cause labelDam is read-only
- }
+public class XLabelDam extends XWidget implements IAttributeWidget {
+
+ private Artifact artifact;
+ private String attributeTypeName;
+ private Text valueTextWidget;
+ private Composite parent;
+
+ public XLabelDam(String displayLabel) {
+ super(displayLabel);
+ }
+
+ @Override
+ public Control getControl() {
+ return valueTextWidget;
+ }
+
+ @Override
+ protected void createControls(Composite parent, int horizontalSpan) {
+ this.parent = parent;
+ if (horizontalSpan < 2) {
+ horizontalSpan = 2;
+ }
+ // Create Data Widgets
+ if (isDisplayLabel() && !getLabel().equals("")) {
+ labelWidget = new Label(parent, SWT.NONE);
+ labelWidget.setText(getLabel() + ":");
+ if (getToolTip() != null) {
+ labelWidget.setToolTipText(getToolTip());
+ }
+ }
+ valueTextWidget = new Text(parent, SWT.NONE);
+ valueTextWidget.setEditable(false);
+ refresh();
+ }
+
+ @Override
+ public String getAttributeType() {
+ return attributeTypeName;
+ }
+
+ @Override
+ public void setAttributeType(Artifact artifact, String attrName) {
+ this.artifact = artifact;
+ this.attributeTypeName = attrName;
+
+ refresh();
+ }
+
+ @Override
+ public void saveToArtifact() {
+ // Do nothing cause labelDam is read-only
+ }
+
+ @Override
+ public Result isDirty() {
+ return Result.FalseResult;
+ }
+
+ @Override
+ public void refresh() {
+ if (artifact != null && valueTextWidget != null && !valueTextWidget.isDisposed()) {
+ try {
+ valueTextWidget.setText(artifact.getAttributesToString(attributeTypeName));
+ } catch (OseeCoreException ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ }
+
+ @Override
+ public void dispose() {
+ if (labelWidget != null) {
+ labelWidget.dispose();
+ }
+ if (valueTextWidget != null) {
+ valueTextWidget.dispose();
+ }
+ if (parent != null && !parent.isDisposed()) {
+ parent.layout();
+ }
+ }
+
+ @Override
+ public String getReportData() {
+ return null;
+ }
+
+ @Override
+ public String getXmlData() {
+ return null;
+ }
+
+ @Override
+ public IStatus isValid() {
+ return Status.OK_STATUS;
+ }
+
+ @Override
+ public void setFocus() {
+ }
+
+ @Override
+ public void setXmlData(String str) {
+ }
+
+ @Override
+ public String toHTML(String labelFont) {
+ return "";
+ }
+
+ @Override
+ public Object getData() {
+ return valueTextWidget.getText();
+ }
+
+ @Override
+ 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/XListDam.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XListDam.java
index bfc9bfc3f36..4da6cfa77db 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XListDam.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XListDam.java
@@ -19,50 +19,56 @@ import org.eclipse.osee.framework.ui.plugin.util.Result;
/**
* @author Donald G. Dunne
*/
-public class XListDam extends XList implements IArtifactWidget {
+public class XListDam extends XList implements IAttributeWidget {
- private Artifact artifact;
- private String attributeTypeName;
+ private Artifact artifact;
+ private String attributeTypeName;
- /**
- * @param displayLabel
- */
- public XListDam(String displayLabel) {
- super(displayLabel);
- }
+ /**
+ * @param displayLabel
+ */
+ public XListDam(String displayLabel) {
+ super(displayLabel);
+ }
- public void setArtifact(Artifact artifact, String attrName) throws OseeCoreException {
- this.artifact = artifact;
- this.attributeTypeName = attrName;
- super.setSelected(getStoredStrs());
- }
+ @Override
+ public String getAttributeType() {
+ return attributeTypeName;
+ }
- @Override
- public void saveToArtifact() throws OseeCoreException {
- artifact.setAttributeValues(attributeTypeName, getSelectedStrs());
- }
+ @Override
+ public void setAttributeType(Artifact artifact, String attrName) throws OseeCoreException {
+ this.artifact = artifact;
+ this.attributeTypeName = attrName;
+ super.setSelected(getStoredStrs());
+ }
- public Collection<String> getStoredStrs() throws OseeCoreException {
- return artifact.getAttributesToStringList(attributeTypeName);
- }
+ @Override
+ public void saveToArtifact() throws OseeCoreException {
+ artifact.setAttributeValues(attributeTypeName, getSelectedStrs());
+ }
- @Override
- public Result isDirty() throws OseeCoreException {
- try {
- Collection<String> enteredValues = getSelectedStrs();
- Collection<String> storedValues = getStoredStrs();
- if (!Collections.isEqual(enteredValues, storedValues)) {
- return new Result(true, attributeTypeName + " is dirty");
- }
- } catch (NumberFormatException ex) {
- // do nothing
- }
- return Result.FalseResult;
- }
+ public Collection<String> getStoredStrs() throws OseeCoreException {
+ return artifact.getAttributesToStringList(attributeTypeName);
+ }
- @Override
- public void revert() throws OseeCoreException {
- setArtifact(artifact, attributeTypeName);
- }
+ @Override
+ public Result isDirty() throws OseeCoreException {
+ try {
+ Collection<String> enteredValues = getSelectedStrs();
+ Collection<String> storedValues = getStoredStrs();
+ if (!Collections.isEqual(enteredValues, storedValues)) {
+ return new Result(true, attributeTypeName + " is dirty");
+ }
+ } catch (NumberFormatException ex) {
+ // do nothing
+ }
+ return Result.FalseResult;
+ }
+
+ @Override
+ public void revert() throws OseeCoreException {
+ setAttributeType(artifact, attributeTypeName);
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XSelectFromMultiChoiceDam.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XSelectFromMultiChoiceDam.java
index 1048785715b..352d7aa9491 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XSelectFromMultiChoiceDam.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XSelectFromMultiChoiceDam.java
@@ -30,77 +30,83 @@ import org.eclipse.osee.framework.ui.skynet.util.filteredTree.SimpleCheckFiltere
/**
* @author Roberto E. Escobar
*/
-public class XSelectFromMultiChoiceDam extends XSelectFromDialog<String> implements IArtifactWidget {
+public class XSelectFromMultiChoiceDam extends XSelectFromDialog<String> implements IAttributeWidget {
- private Artifact artifact;
- private String attributeTypeName;
+ private Artifact artifact;
+ private String attributeTypeName;
- public XSelectFromMultiChoiceDam(String displayLabel) {
- super(displayLabel);
- this.artifact = null;
- }
+ public XSelectFromMultiChoiceDam(String displayLabel) {
+ super(displayLabel);
+ this.artifact = null;
+ }
- public void setArtifact(Artifact artifact, String attributeTypeName) throws OseeCoreException {
- this.artifact = artifact;
- this.attributeTypeName = attributeTypeName;
- AttributeType attributeType = AttributeTypeManager.getType(attributeTypeName);
- int minOccurrence = attributeType.getMinOccurrences();
- int maxOccurrence = attributeType.getMaxOccurrences();
+ @Override
+ public String getAttributeType() {
+ return attributeTypeName;
+ }
- setRequiredSelection(minOccurrence, maxOccurrence);
- setSelected(getStored());
- setRequiredEntry(true);
- }
+ @Override
+ public void setAttributeType(Artifact artifact, String attributeTypeName) throws OseeCoreException {
+ this.artifact = artifact;
+ this.attributeTypeName = attributeTypeName;
+ AttributeType attributeType = AttributeTypeManager.getType(attributeTypeName);
+ int minOccurrence = attributeType.getMinOccurrences();
+ int maxOccurrence = attributeType.getMaxOccurrences();
- @Override
- public MinMaxOSEECheckedFilteredTreeDialog createDialog() {
- SimpleCheckFilteredTreeDialog dialog =
- new SimpleCheckFilteredTreeDialog(getLabel(), "Select from the items below",
- new ArrayTreeContentProvider(), new LabelProvider(), new ArtifactNameSorter(),
- getMinSelectionRequired(), getMaxSelectionRequired());
- return dialog;
- }
+ setRequiredSelection(minOccurrence, maxOccurrence);
+ setSelected(getStored());
+ setRequiredEntry(true);
+ }
- public Collection<String> getStored() throws OseeCoreException {
- return artifact.getAttributesToStringList(attributeTypeName);
- }
+ @Override
+ public MinMaxOSEECheckedFilteredTreeDialog createDialog() {
+ SimpleCheckFilteredTreeDialog dialog =
+ new SimpleCheckFilteredTreeDialog(getLabel(), "Select from the items below",
+ new ArrayTreeContentProvider(), new LabelProvider(), new ArtifactNameSorter(),
+ getMinSelectionRequired(), getMaxSelectionRequired());
+ return dialog;
+ }
- @Override
- public Result isDirty() throws OseeCoreException {
- try {
- Collection<String> enteredValues = getSelected();
- Collection<String> storedValues = getStored();
- if (!Collections.isEqual(enteredValues, storedValues)) {
- return new Result(true, attributeTypeName + " is dirty");
- }
- } catch (NumberFormatException ex) {
- // do nothing
- }
- return Result.FalseResult;
- }
+ public Collection<String> getStored() throws OseeCoreException {
+ return artifact.getAttributesToStringList(attributeTypeName);
+ }
- @Override
- public void revert() throws OseeCoreException {
- setArtifact(artifact, attributeTypeName);
- }
+ @Override
+ public Result isDirty() throws OseeCoreException {
+ try {
+ Collection<String> enteredValues = getSelected();
+ Collection<String> storedValues = getStored();
+ if (!Collections.isEqual(enteredValues, storedValues)) {
+ return new Result(true, attributeTypeName + " is dirty");
+ }
+ } catch (NumberFormatException ex) {
+ // do nothing
+ }
+ return Result.FalseResult;
+ }
- @Override
- public void saveToArtifact() throws OseeCoreException {
- artifact.setAttributeValues(attributeTypeName, getSelected());
- }
+ @Override
+ public void revert() throws OseeCoreException {
+ setAttributeType(artifact, attributeTypeName);
+ }
- @Override
- public IStatus isValid() {
- IStatus status = super.isValid();
- if (status.isOK()) {
- List<String> items = getSelected();
- for (String item : items) {
- status = OseeValidator.getInstance().validate(IOseeValidator.SHORT, artifact, attributeTypeName, item);
- if (!status.isOK()) {
- break;
- }
- }
- }
- return status;
- }
+ @Override
+ public void saveToArtifact() throws OseeCoreException {
+ artifact.setAttributeValues(attributeTypeName, getSelected());
+ }
+
+ @Override
+ public IStatus isValid() {
+ IStatus status = super.isValid();
+ if (status.isOK()) {
+ List<String> items = getSelected();
+ for (String item : items) {
+ status = OseeValidator.getInstance().validate(IOseeValidator.SHORT, artifact, attributeTypeName, item);
+ if (!status.isOK()) {
+ break;
+ }
+ }
+ }
+ return status;
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XStackedDam.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XStackedDam.java
index de6a7cdb5f2..9dceb47aae7 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XStackedDam.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XStackedDam.java
@@ -42,7 +42,7 @@ import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.progress.UIJob;
-public class XStackedDam extends XStackedWidget<String> implements IArtifactWidget {
+public class XStackedDam extends XStackedWidget<String> implements IAttributeWidget {
private Artifact artifact;
private String attributeTypeName;
private final Map<String, XWidget> xWidgets;
@@ -53,13 +53,20 @@ public class XStackedDam extends XStackedWidget<String> implements IArtifactWidg
this.xWidgets = new LinkedHashMap<String, XWidget>();
this.artifact = null;
this.xModifiedListener = new XModifiedListener() {
+ @Override
public void widgetModified(XWidget widget) {
notifyXModifiedListeners();
};
};
}
- public void setArtifact(Artifact artifact, String attributeTypeName) throws OseeCoreException {
+ @Override
+ public String getAttributeType() {
+ return attributeTypeName;
+ }
+
+ @Override
+ public void setAttributeType(Artifact artifact, String attributeTypeName) throws OseeCoreException {
this.artifact = artifact;
this.attributeTypeName = attributeTypeName;
AttributeType attributeType = AttributeTypeManager.getType(attributeTypeName);
@@ -143,7 +150,7 @@ public class XStackedDam extends XStackedWidget<String> implements IArtifactWidg
@Override
public void revert() throws OseeCoreException {
- setArtifact(artifact, attributeTypeName);
+ setAttributeType(artifact, attributeTypeName);
}
@Override
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XTextDam.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XTextDam.java
index a6811264850..50898e392bd 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XTextDam.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XTextDam.java
@@ -17,52 +17,63 @@ import org.eclipse.osee.framework.skynet.core.validation.IOseeValidator;
import org.eclipse.osee.framework.skynet.core.validation.OseeValidator;
import org.eclipse.osee.framework.ui.plugin.util.Result;
-public class XTextDam extends XText implements IArtifactWidget {
+public class XTextDam extends XText implements IArtifactWidget, IAttributeWidget {
- private Artifact artifact;
- private String attributeTypeName;
+ private Artifact artifact;
+ private String attributeTypeName;
- public XTextDam(String displayLabel) {
- super(displayLabel);
- }
+ public XTextDam(String displayLabel) {
+ super(displayLabel);
+ }
- public void setArtifact(Artifact artifact, String attributeTypeName) throws OseeCoreException {
- this.artifact = artifact;
- this.attributeTypeName = attributeTypeName;
- super.set(artifact.getSoleAttributeValue(attributeTypeName, ""));
- }
+ @Override
+ public void setArtifact(Artifact artifact) throws OseeCoreException {
+ this.artifact = artifact;
+ }
- @Override
- public void saveToArtifact() throws OseeCoreException {
- String value = get();
- if (value == null || value.equals("")) {
- artifact.deleteSoleAttribute(attributeTypeName);
- } else if (!value.equals(artifact.getSoleAttributeValue(attributeTypeName, ""))) {
- artifact.setSoleAttributeValue(attributeTypeName, value);
- }
- }
+ @Override
+ public String getAttributeType() {
+ return attributeTypeName;
+ }
- @Override
- public Result isDirty() throws OseeCoreException {
- String enteredValue = get();
- String storedValue = artifact.getSoleAttributeValue(attributeTypeName, "");
- if (!enteredValue.equals(storedValue)) {
- return new Result(true, attributeTypeName + " is dirty");
- }
- return Result.FalseResult;
- }
+ @Override
+ public void setAttributeType(Artifact artifact, String attributeTypeName) throws OseeCoreException {
+ this.artifact = artifact;
+ this.attributeTypeName = attributeTypeName;
+ super.set(artifact.getSoleAttributeValue(attributeTypeName, ""));
+ }
- @Override
- public IStatus isValid() {
- IStatus status = super.isValid();
- if (status.isOK()) {
- status = OseeValidator.getInstance().validate(IOseeValidator.SHORT, artifact, attributeTypeName, get());
- }
- return status;
- }
+ @Override
+ public void saveToArtifact() throws OseeCoreException {
+ String value = get();
+ if (value == null || value.equals("")) {
+ artifact.deleteSoleAttribute(attributeTypeName);
+ } else if (!value.equals(artifact.getSoleAttributeValue(attributeTypeName, ""))) {
+ artifact.setSoleAttributeValue(attributeTypeName, value);
+ }
+ }
- @Override
- public void revert() throws OseeCoreException {
- setArtifact(artifact, attributeTypeName);
- }
+ @Override
+ public Result isDirty() throws OseeCoreException {
+ String enteredValue = get();
+ String storedValue = artifact.getSoleAttributeValue(attributeTypeName, "");
+ if (!enteredValue.equals(storedValue)) {
+ return new Result(true, attributeTypeName + " is dirty");
+ }
+ return Result.FalseResult;
+ }
+
+ @Override
+ public IStatus isValid() {
+ IStatus status = super.isValid();
+ if (status.isOK()) {
+ status = OseeValidator.getInstance().validate(IOseeValidator.SHORT, artifact, attributeTypeName, get());
+ }
+ return status;
+ }
+
+ @Override
+ public void revert() throws OseeCoreException {
+ setAttributeType(artifact, attributeTypeName);
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XTextDescriptiveName.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XTextDescriptiveName.java
index 356b7f00b02..43025682efb 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XTextDescriptiveName.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XTextDescriptiveName.java
@@ -10,19 +10,20 @@
*******************************************************************************/
package org.eclipse.osee.framework.ui.skynet.widgets;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-public class XTextDescriptiveName extends XTextDam implements IArtifactWidget {
+public class XTextDescriptiveName extends XTextDam {
- public Artifact artifact;
+ public Artifact artifact;
- public XTextDescriptiveName(String displayLabel) {
- super(displayLabel);
- }
+ public XTextDescriptiveName(String displayLabel) {
+ super(displayLabel);
+ }
- public void setArtifact(Artifact artifact) throws Exception {
- this.artifact = artifact;
- super.setArtifact(artifact, "Name");
- }
+ @Override
+ public void setArtifact(Artifact artifact) throws OseeCoreException {
+ super.setAttributeType(artifact, "Name");
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XWidgetDecorator.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XWidgetDecorator.java
new file mode 100644
index 00000000000..b4b457ae574
--- /dev/null
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XWidgetDecorator.java
@@ -0,0 +1,175 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.framework.ui.skynet.widgets;
+
+import java.util.HashMap;
+import java.util.Map;
+import org.eclipse.jface.fieldassist.ControlDecoration;
+import org.eclipse.osee.framework.core.model.access.PermissionStatus;
+import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
+import org.eclipse.osee.framework.ui.swt.Displays;
+import org.eclipse.osee.framework.ui.swt.ImageManager;
+import org.eclipse.osee.framework.ui.swt.Widgets;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class XWidgetDecorator {
+ private final int decorationPosition = SWT.LEFT | SWT.BOTTOM;
+ private final Map<XWidget, Decorator> decoratorMap = new HashMap<XWidget, Decorator>();
+
+ public XWidgetDecorator() {
+ }
+
+ public void addWidget(XWidget xWidget) {
+ Control controlToDecorate = xWidget.getErrorMessageControl();
+ Decorator decorator = new Decorator(controlToDecorate, decorationPosition);
+ decoratorMap.put(xWidget, decorator);
+ }
+
+ public void update() {
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ for (Decorator decorator : decoratorMap.values()) {
+ decorator.update();
+ }
+ }
+ });
+ }
+
+ public void dispose() {
+ for (Decorator decorator : decoratorMap.values()) {
+ decorator.dispose();
+ }
+ decoratorMap.clear();
+ }
+
+ private final static class Decorator {
+ private ControlDecoration decoration;
+ private String description;
+ private int position;
+ private Image image;
+ private boolean isVisible;
+ private boolean requiresCreation;
+ private final Control control;
+
+ public Decorator(Control control, int position) {
+ this.control = control;
+ setPosition(position);
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public void setImage(Image image) {
+ this.image = image;
+ }
+
+ public void setPosition(int position) {
+ if (getPosition() != position) {
+ this.position = position;
+ this.requiresCreation = true;
+ }
+ }
+
+ public void setVisible(boolean isVisible) {
+ this.isVisible = isVisible;
+ }
+
+ public boolean isVisible() {
+ return isVisible;
+ }
+
+ public int getPosition() {
+ return position;
+ }
+
+ public void dispose() {
+ if (decoration != null) {
+ decoration.dispose();
+ }
+ }
+
+ public void update() {
+ if (requiresCreation) {
+ if (decoration != null) {
+ decoration.dispose();
+ }
+ decoration = new ControlDecoration(control, position, control.getParent());
+ requiresCreation = false;
+ }
+
+ if (isVisible()) {
+ if (image != null) {
+ decoration.setImage(image);
+ }
+ decoration.setDescriptionText(description);
+ decoration.show();
+ } else {
+ decoration.setDescriptionText(null);
+ decoration.hide();
+ }
+ }
+ }
+
+ // public static interface DecorationProvider {
+ // int getPriority();
+ //
+ // void onUpdate(XWidget widget, Decorator decorator);
+ // }
+
+ // public void addProvider(DecorationProvider provider) {
+ //
+ // }
+
+ public void onUpdate(XWidget xWidget, Decorator decorator) {
+ // TODO separate onUpdate - make extensible
+ // TODO Add AccessControlService
+
+ if (xWidget instanceof IAttributeWidget) {
+ IAttributeWidget attributeWidget = (IAttributeWidget) xWidget;
+ String attributeType = attributeWidget.getAttributeType();
+ // Artifact artifact = null;
+ PermissionStatus permissionStatus = new PermissionStatus(true, "You are not cool enough");
+ // try {
+ // AccessDataQuery query = AccessControlManager.getAccessData(null);
+ // query.attributeTypeMatches(PermissionEnum.WRITE, artifact, attributeType, permissionStatus);
+ // } catch (OseeCoreException ex) {
+ // OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ // }
+
+ // Get Info from AccessControlService;
+ boolean isLocked = permissionStatus.matches();
+ String reason = permissionStatus.getReason();
+
+ Control control = xWidget.getControl();
+ if (Widgets.isAccessible(control)) {
+ xWidget.setEditable(!isLocked);
+ }
+ Label label = xWidget.getLabelWidget();
+ if (Widgets.isAccessible(label)) {
+ label.setEnabled(!isLocked);
+ }
+
+ Image image = ImageManager.getImage(FrameworkImage.LOCK_OVERLAY);
+
+ decorator.setImage(isLocked ? image : null);
+ decorator.setDescription(isLocked ? reason : null);
+ decorator.setVisible(isLocked);
+ }
+ }
+}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/workflow/DynamicXWidgetLayout.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/workflow/DynamicXWidgetLayout.java
index f441b911438..f86e522ba20 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/workflow/DynamicXWidgetLayout.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/workflow/DynamicXWidgetLayout.java
@@ -30,6 +30,7 @@ import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
import org.eclipse.osee.framework.ui.skynet.XWidgetParser;
import org.eclipse.osee.framework.ui.skynet.widgets.IArtifactWidget;
+import org.eclipse.osee.framework.ui.skynet.widgets.IAttributeWidget;
import org.eclipse.osee.framework.ui.skynet.widgets.XModifiedListener;
import org.eclipse.osee.framework.ui.skynet.widgets.XOption;
import org.eclipse.osee.framework.ui.skynet.widgets.XText;
@@ -166,11 +167,19 @@ public class DynamicXWidgetLayout {
dynamicWidgetLayoutListener.widgetCreating(xWidget, toolkit, artifact, this, xModListener, isEditable);
}
- if (artifact != null && xWidget instanceof IArtifactWidget) {
- try {
- ((IArtifactWidget) xWidget).setArtifact(artifact, xWidgetLayoutData.getStorageName());
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ if (artifact != null) {
+ if (xWidget instanceof IAttributeWidget) {
+ try {
+ ((IAttributeWidget) xWidget).setAttributeType(artifact, xWidgetLayoutData.getStorageName());
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ } else if (xWidget instanceof IArtifactWidget) {
+ try {
+ ((IArtifactWidget) xWidget).setArtifact(artifact);
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ }
}
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/workflow/DynamicXWidgetLayoutData.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/workflow/DynamicXWidgetLayoutData.java
index 4a4b0ee9321..9593394ac2d 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/workflow/DynamicXWidgetLayoutData.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/workflow/DynamicXWidgetLayoutData.java
@@ -16,6 +16,7 @@ import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
import org.eclipse.osee.framework.ui.skynet.widgets.IArtifactWidget;
+import org.eclipse.osee.framework.ui.skynet.widgets.IAttributeWidget;
import org.eclipse.osee.framework.ui.skynet.widgets.XOption;
import org.eclipse.osee.framework.ui.skynet.widgets.XOptionHandler;
import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
@@ -24,203 +25,207 @@ import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
* @author Donald G. Dunne
*/
public class DynamicXWidgetLayoutData implements Cloneable {
- private static final XWidgetFactory xWidgetFactory = XWidgetFactory.getInstance();
- private static final int DEFAULT_HEIGHT = 9999;
- private String name = "Unknown";
- private String id = "";
- private String storageName = "";
- private String xWidgetName = UNKNOWN;
- private static String UNKNOWN = "Unknown";
- private XWidget xWidget;
- private int beginComposite = 0; // If >0, indicates new child composite with columns == value
- private int beginGroupComposite = 0; // If >0, indicates new child composite with columns == value
- private boolean endComposite, endGroupComposite; // indicated end of child composite
- private int height = DEFAULT_HEIGHT;
- private String toolTip;
- private DynamicXWidgetLayout dynamicXWidgetLayout;
- private String defaultValue;
- private String keyedBranchName;
- private final XOptionHandler xOptionHandler = new XOptionHandler();
- private Artifact artifact;
-
- public DynamicXWidgetLayoutData(DynamicXWidgetLayout dynamicXWidgetLayout, XOption... xOption) {
- this.dynamicXWidgetLayout = dynamicXWidgetLayout;
- xOptionHandler.add(XOption.EDITABLE);
- xOptionHandler.add(XOption.ALIGN_LEFT);
- xOptionHandler.add(xOption);
- }
-
- @Override
- public Object clone() throws CloneNotSupportedException {
- return super.clone();
- }
-
- public boolean isHeightSet() {
- return height != DEFAULT_HEIGHT;
- }
-
- @Override
- public String toString() {
- return getName();
- }
-
- public String getName() {
- return name.replaceFirst("^.*?\\.", "");
- }
-
- public String getStorageName() {
- return storageName;
- }
-
- public void setStorageName(String storageName) {
- this.storageName = storageName;
- }
-
- public boolean isRequired() {
- return xOptionHandler.contains(XOption.REQUIRED) || dynamicXWidgetLayout.isOrRequired(storageName) || dynamicXWidgetLayout.isXOrRequired(storageName);
- }
-
- public String getXWidgetName() {
- return xWidgetName;
- }
-
- public void setXWidgetName(String widget) {
- xWidgetName = widget;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- // TODO This method will need to be removed
- public XWidget getXWidget() throws OseeArgumentException {
- if (xWidget == null) {
- xWidget = xWidgetFactory.createXWidget(this);
- if (artifact != null && xWidget instanceof IArtifactWidget) {
- try {
- ((IArtifactWidget) xWidget).setArtifact(artifact, getStorageName());
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- }
- }
- }
- return xWidget;
- }
-
- public void setDefaultValue(String defaultValue) {
- this.defaultValue = defaultValue;
- }
-
- public int getHeight() {
- return height;
- }
-
- public void setHeight(int height) {
- this.height = height;
- }
-
- public int getBeginComposite() {
- if (xOptionHandler.contains(XOption.BEGIN_COMPOSITE_10)) {
- return 10;
- }
- if (xOptionHandler.contains(XOption.BEGIN_COMPOSITE_8)) {
- return 8;
- }
- if (xOptionHandler.contains(XOption.BEGIN_COMPOSITE_6)) {
- return 6;
- }
- if (xOptionHandler.contains(XOption.BEGIN_COMPOSITE_4)) {
- return 4;
- }
- return beginComposite;
- }
-
- public int getBeginGroupComposite() {
- if (xOptionHandler.contains(XOption.BEGIN_GROUP_COMPOSITE_10)) {
- return 10;
- }
- if (xOptionHandler.contains(XOption.BEGIN_GROUP_COMPOSITE_8)) {
- return 8;
- }
- if (xOptionHandler.contains(XOption.BEGIN_GROUP_COMPOSITE_6)) {
- return 6;
- }
- if (xOptionHandler.contains(XOption.BEGIN_GROUP_COMPOSITE_4)) {
- return 4;
- }
- return beginGroupComposite;
- }
-
- public void setBeginComposite(int beginComposite) {
- this.beginComposite = beginComposite;
- }
-
- public void setBeginGroupComposite(int beginGroupComposite) {
- this.beginGroupComposite = beginGroupComposite;
- }
-
- public boolean isEndComposite() {
- return endComposite;
- }
-
- public boolean isEndGroupComposite() {
- return endGroupComposite;
- }
-
- public void setEndComposite(boolean endComposite) {
- this.endComposite = endComposite;
- }
-
- public void setEndGroupComposite(boolean endGroupComposite) {
- this.endGroupComposite = endGroupComposite;
- }
-
- public String getToolTip() {
- return toolTip;
- }
-
- public void setToolTip(String toolTip) {
- this.toolTip = toolTip;
- }
-
- public DynamicXWidgetLayout getDynamicXWidgetLayout() {
- return dynamicXWidgetLayout;
- }
-
- public String getDefaultValue() {
- return defaultValue;
- }
-
- public void setKeyedBranchName(String keyedBranchName) {
- this.keyedBranchName = keyedBranchName;
- }
-
- public String getKeyedBranchName() {
- return keyedBranchName;
- }
-
- public void setDynamicXWidgetLayout(DynamicXWidgetLayout dynamicXWidgetLayout) {
- this.dynamicXWidgetLayout = dynamicXWidgetLayout;
- }
-
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public XOptionHandler getXOptionHandler() {
- return xOptionHandler;
- }
-
- public Artifact getArtifact() {
- return artifact;
- }
-
- public void setArtifact(Artifact artifact) {
- this.artifact = artifact;
- }
+ private static final XWidgetFactory xWidgetFactory = XWidgetFactory.getInstance();
+ private static final int DEFAULT_HEIGHT = 9999;
+ private String name = "Unknown";
+ private String id = "";
+ private String storageName = "";
+ private String xWidgetName = UNKNOWN;
+ private static String UNKNOWN = "Unknown";
+ private XWidget xWidget;
+ private int beginComposite = 0; // If >0, indicates new child composite with columns == value
+ private int beginGroupComposite = 0; // If >0, indicates new child composite with columns == value
+ private boolean endComposite, endGroupComposite; // indicated end of child composite
+ private int height = DEFAULT_HEIGHT;
+ private String toolTip;
+ private DynamicXWidgetLayout dynamicXWidgetLayout;
+ private String defaultValue;
+ private String keyedBranchName;
+ private final XOptionHandler xOptionHandler = new XOptionHandler();
+ private Artifact artifact;
+
+ public DynamicXWidgetLayoutData(DynamicXWidgetLayout dynamicXWidgetLayout, XOption... xOption) {
+ this.dynamicXWidgetLayout = dynamicXWidgetLayout;
+ xOptionHandler.add(XOption.EDITABLE);
+ xOptionHandler.add(XOption.ALIGN_LEFT);
+ xOptionHandler.add(xOption);
+ }
+
+ @Override
+ public Object clone() throws CloneNotSupportedException {
+ return super.clone();
+ }
+
+ public boolean isHeightSet() {
+ return height != DEFAULT_HEIGHT;
+ }
+
+ @Override
+ public String toString() {
+ return getName();
+ }
+
+ public String getName() {
+ return name.replaceFirst("^.*?\\.", "");
+ }
+
+ public String getStorageName() {
+ return storageName;
+ }
+
+ public void setStorageName(String storageName) {
+ this.storageName = storageName;
+ }
+
+ public boolean isRequired() {
+ return xOptionHandler.contains(XOption.REQUIRED) || dynamicXWidgetLayout.isOrRequired(storageName) || dynamicXWidgetLayout.isXOrRequired(storageName);
+ }
+
+ public String getXWidgetName() {
+ return xWidgetName;
+ }
+
+ public void setXWidgetName(String widget) {
+ xWidgetName = widget;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ // TODO This method will need to be removed
+ public XWidget getXWidget() throws OseeArgumentException {
+ if (xWidget == null) {
+ xWidget = xWidgetFactory.createXWidget(this);
+ if (artifact != null) {
+ try {
+ if (xWidget instanceof IAttributeWidget) {
+ ((IAttributeWidget) xWidget).setAttributeType(artifact, getStorageName());
+ } else if (xWidget instanceof IArtifactWidget) {
+ ((IArtifactWidget) xWidget).setArtifact(artifact);
+ }
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ }
+ }
+ return xWidget;
+ }
+
+ public void setDefaultValue(String defaultValue) {
+ this.defaultValue = defaultValue;
+ }
+
+ public int getHeight() {
+ return height;
+ }
+
+ public void setHeight(int height) {
+ this.height = height;
+ }
+
+ public int getBeginComposite() {
+ if (xOptionHandler.contains(XOption.BEGIN_COMPOSITE_10)) {
+ return 10;
+ }
+ if (xOptionHandler.contains(XOption.BEGIN_COMPOSITE_8)) {
+ return 8;
+ }
+ if (xOptionHandler.contains(XOption.BEGIN_COMPOSITE_6)) {
+ return 6;
+ }
+ if (xOptionHandler.contains(XOption.BEGIN_COMPOSITE_4)) {
+ return 4;
+ }
+ return beginComposite;
+ }
+
+ public int getBeginGroupComposite() {
+ if (xOptionHandler.contains(XOption.BEGIN_GROUP_COMPOSITE_10)) {
+ return 10;
+ }
+ if (xOptionHandler.contains(XOption.BEGIN_GROUP_COMPOSITE_8)) {
+ return 8;
+ }
+ if (xOptionHandler.contains(XOption.BEGIN_GROUP_COMPOSITE_6)) {
+ return 6;
+ }
+ if (xOptionHandler.contains(XOption.BEGIN_GROUP_COMPOSITE_4)) {
+ return 4;
+ }
+ return beginGroupComposite;
+ }
+
+ public void setBeginComposite(int beginComposite) {
+ this.beginComposite = beginComposite;
+ }
+
+ public void setBeginGroupComposite(int beginGroupComposite) {
+ this.beginGroupComposite = beginGroupComposite;
+ }
+
+ public boolean isEndComposite() {
+ return endComposite;
+ }
+
+ public boolean isEndGroupComposite() {
+ return endGroupComposite;
+ }
+
+ public void setEndComposite(boolean endComposite) {
+ this.endComposite = endComposite;
+ }
+
+ public void setEndGroupComposite(boolean endGroupComposite) {
+ this.endGroupComposite = endGroupComposite;
+ }
+
+ public String getToolTip() {
+ return toolTip;
+ }
+
+ public void setToolTip(String toolTip) {
+ this.toolTip = toolTip;
+ }
+
+ public DynamicXWidgetLayout getDynamicXWidgetLayout() {
+ return dynamicXWidgetLayout;
+ }
+
+ public String getDefaultValue() {
+ return defaultValue;
+ }
+
+ public void setKeyedBranchName(String keyedBranchName) {
+ this.keyedBranchName = keyedBranchName;
+ }
+
+ public String getKeyedBranchName() {
+ return keyedBranchName;
+ }
+
+ public void setDynamicXWidgetLayout(DynamicXWidgetLayout dynamicXWidgetLayout) {
+ this.dynamicXWidgetLayout = dynamicXWidgetLayout;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public XOptionHandler getXOptionHandler() {
+ return xOptionHandler;
+ }
+
+ public Artifact getArtifact() {
+ return artifact;
+ }
+
+ public void setArtifact(Artifact artifact) {
+ this.artifact = artifact;
+ }
} \ No newline at end of file

Back to the top