diff options
3 files changed, 80 insertions, 2 deletions
diff --git a/plugins/org.eclipse.osee.framework.access.provider/.project b/plugins/org.eclipse.osee.framework.access.provider/.project index 013f2b81c43..17078c5e8f1 100644 --- a/plugins/org.eclipse.osee.framework.access.provider/.project +++ b/plugins/org.eclipse.osee.framework.access.provider/.project @@ -6,6 +6,11 @@ </projects> <buildSpec> <buildCommand> + <name>org.eclipse.xtext.ui.shared.xtextBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> <name>org.eclipse.jdt.core.javabuilder</name> <arguments> </arguments> @@ -29,5 +34,6 @@ <natures> <nature>org.eclipse.pde.PluginNature</nature> <nature>org.eclipse.jdt.core.javanature</nature> + <nature>org.eclipse.xtext.ui.shared.xtextNature</nature> </natures> </projectDescription> 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 3290825f330..d1acf79a18b 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 @@ -29,8 +29,9 @@ public class XButton extends XButtonCommon { protected Label button; private Composite parent; - private Composite bComp; + protected Composite bComp; private boolean labelAfter = true; + protected int numColumns = 2; public XButton(String displayLabel) { super(displayLabel); @@ -57,7 +58,7 @@ public class XButton extends XButtonCommon { this.parent = parent; bComp = new Composite(parent, SWT.NONE); - bComp.setLayout(ALayout.getZeroMarginLayout(2, false)); + bComp.setLayout(ALayout.getZeroMarginLayout(numColumns, false)); bComp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); if (toolkit != null) { toolkit.adapt(bComp); @@ -106,6 +107,7 @@ public class XButton extends XButtonCommon { labelWidget.setToolTipText(getToolTip()); } } + button.setLayoutData(gd); validate(); button.setEnabled(isEditable()); diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XButtonWithLabelDam.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XButtonWithLabelDam.java new file mode 100644 index 00000000000..df0278819d4 --- /dev/null +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XButtonWithLabelDam.java @@ -0,0 +1,70 @@ +/******************************************************************************* + * Copyright (c) 2017 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.util.Result; +import org.eclipse.osee.framework.jdk.core.type.OseeCoreException; +import org.eclipse.osee.framework.skynet.core.artifact.Artifact; +import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Label; + +/** + * @author Donald G. Dunne + */ +public abstract class XButtonWithLabelDam extends XButton implements IArtifactWidget { + + private Artifact artifact; + protected Label resultsLabelWidget; + + public XButtonWithLabelDam(String displayLabel, String toolTip, Image image) { + super(displayLabel); + setImage(image); + setToolTip(toolTip); + } + + @Override + protected void createControls(Composite parent, int horizontalSpan) { + numColumns = 3; + super.createControls(parent, horizontalSpan); + resultsLabelWidget = new Label(bComp, SWT.NONE); + resultsLabelWidget.setText(getResultsText()); + } + + protected abstract String getResultsText(); + + @Override + public void setArtifact(Artifact artifact) throws OseeCoreException { + this.artifact = artifact; + } + + @Override + public Artifact getArtifact() throws OseeCoreException { + return artifact; + } + + @Override + public Result isDirty() { + return Result.FalseResult; + } + + @Override + public void revert() { + // do nothing + } + + @Override + public void saveToArtifact() { + // do nothing + } + +} |