Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Rentz-Reichert2012-02-28 10:14:50 -0500
committerHenrik Rentz-Reichert2012-02-28 10:14:50 -0500
commit09c31c23c7d1db69cd52b13be9650b0f25739888 (patch)
treef78d02c3f71a7387d301fbcd995bcc05db32f946 /plugins/org.eclipse.etrice.ui.structure
parent5e0f00753039cb447cd9c96f65b80c631a6014df (diff)
downloadorg.eclipse.etrice-09c31c23c7d1db69cd52b13be9650b0f25739888.tar.gz
org.eclipse.etrice-09c31c23c7d1db69cd52b13be9650b0f25739888.tar.xz
org.eclipse.etrice-09c31c23c7d1db69cd52b13be9650b0f25739888.zip
[ui.structure] property dialogs check whether interface items are referenced
and disable properties accordingly
Diffstat (limited to 'plugins/org.eclipse.etrice.ui.structure')
-rw-r--r--plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/dialogs/PortPropertyDialog.java10
-rw-r--r--plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/dialogs/SPPPropertyDialog.java7
2 files changed, 6 insertions, 11 deletions
diff --git a/plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/dialogs/PortPropertyDialog.java b/plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/dialogs/PortPropertyDialog.java
index 51be6e292..a8c3b4551 100644
--- a/plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/dialogs/PortPropertyDialog.java
+++ b/plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/dialogs/PortPropertyDialog.java
@@ -188,7 +188,7 @@ public class PortPropertyDialog extends AbstractPropertyDialog {
@Override
protected void createContent(IManagedForm mform, Composite body, DataBindingContext bindingContext) {
- boolean connected = ValidationUtil.isConnected(port, null, acc);
+ boolean connected = ValidationUtil.isReferencedInModel(port);
NameValidator nv = new NameValidator();
ProtocolValidator pv = new ProtocolValidator();
MultiplicityValidator mv = new MultiplicityValidator(newPort || !connected, port.getMultiplicity());
@@ -206,7 +206,7 @@ public class PortPropertyDialog extends AbstractPropertyDialog {
Combo protocol = createComboUsingDesc(body, "Protocol:", port, ProtocolClass.class, RoomPackage.eINSTANCE.getInterfaceItem_Protocol(), protocols, RoomPackage.eINSTANCE.getRoomClass_Name(), pv);
Button conj = createCheck(body, "Conjugated:", port, RoomPackage.eINSTANCE.getPort_Conjugated());
if (!internal && !refitem && (acc instanceof ActorClass))
- createRelayCheck(body, mform.getToolkit());
+ createRelayCheck(body, !connected, mform.getToolkit());
Multiplicity2StringConverter m2s = new Multiplicity2StringConverter();
String2MultiplicityConverter s2m = new String2MultiplicityConverter();
@@ -237,16 +237,14 @@ public class PortPropertyDialog extends AbstractPropertyDialog {
name.setFocus();
}
- private void createRelayCheck(Composite parent, FormToolkit toolkit) {
+ private void createRelayCheck(Composite parent, boolean enabled, FormToolkit toolkit) {
Label l = toolkit.createLabel(parent, "Is Relay Port:", SWT.NONE);
l.setLayoutData(new GridData(SWT.NONE));
relayCheck = toolkit.createButton(parent, "", SWT.CHECK);
relayCheck.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
relayCheck.setSelection(relay);
-
- if (ValidationUtil.isConnected(port, null, acc))
- relayCheck.setEnabled(false);
+ relayCheck.setEnabled(enabled);
}
@Override
diff --git a/plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/dialogs/SPPPropertyDialog.java b/plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/dialogs/SPPPropertyDialog.java
index 549f27c6b..e1e1bcaf1 100644
--- a/plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/dialogs/SPPPropertyDialog.java
+++ b/plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/dialogs/SPPPropertyDialog.java
@@ -21,7 +21,6 @@ import org.eclipse.core.databinding.validation.ValidationStatus;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.emf.ecore.EObject;
-import org.eclipse.etrice.core.room.ActorContainerClass;
import org.eclipse.etrice.core.room.ProtocolClass;
import org.eclipse.etrice.core.room.RoomPackage;
import org.eclipse.etrice.core.room.SPPRef;
@@ -71,15 +70,13 @@ public class SPPPropertyDialog extends AbstractPropertyDialog {
private SPPRef spp;
private IScope scope;
- private ActorContainerClass acc;
private boolean newSPP;
private boolean refitem;
- public SPPPropertyDialog(Shell shell, SPPRef spp, IScope scope, ActorContainerClass acc, boolean newSPP, boolean refitem) {
+ public SPPPropertyDialog(Shell shell, SPPRef spp, IScope scope, boolean newSPP, boolean refitem) {
super(shell, "Edit SPP");
this.spp = spp;
this.scope = scope;
- this.acc = acc;
this.newSPP = newSPP;
this.refitem = refitem;
}
@@ -93,7 +90,7 @@ public class SPPPropertyDialog extends AbstractPropertyDialog {
@Override
protected void createContent(IManagedForm mform, Composite body, DataBindingContext bindingContext) {
- boolean connected = ValidationUtil.isConnectedSrc(spp, acc);
+ boolean connected = ValidationUtil.isReferencedInModel(spp);
NameValidator nv = new NameValidator();
ProtocolValidator pv = new ProtocolValidator();

Back to the top