Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Rentz-Reichert2012-04-12 04:35:13 -0400
committerHenrik Rentz-Reichert2012-04-12 04:35:13 -0400
commitdf2199458ba8c3791cc0e9a9dc04a09c6591384a (patch)
tree0c4f3d042e0c0a2e01bebebda605597987e4a197 /plugins/org.eclipse.etrice.ui.structure
parentd5df7c9533d313c9c9d3b16c8f4e2657eb57860c (diff)
downloadorg.eclipse.etrice-df2199458ba8c3791cc0e9a9dc04a09c6591384a.tar.gz
org.eclipse.etrice-df2199458ba8c3791cc0e9a9dc04a09c6591384a.tar.xz
org.eclipse.etrice-df2199458ba8c3791cc0e9a9dc04a09c6591384a.zip
[core.room, ui.structure] improved message in port dialog info decorators
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.java21
1 files changed, 12 insertions, 9 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 295da7f96..086d813f2 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
@@ -198,7 +198,7 @@ public class PortPropertyDialog extends AbstractPropertyDialog {
@Override
protected void createContent(IManagedForm mform, Composite body, DataBindingContext bindingContext) {
- boolean connected = ValidationUtil.isReferencedInModel(port);
+ Result notReferenced = ValidationUtil.isFreeOfReferences(port);
boolean multiplicityAnyAllowed = true;
ActorContainerClass parent = (ActorContainerClass) port.eContainer();
if (parent instanceof ActorClass) {
@@ -207,7 +207,7 @@ public class PortPropertyDialog extends AbstractPropertyDialog {
}
NameValidator nv = new NameValidator();
ProtocolValidator pv = new ProtocolValidator();
- MultiplicityValidator mv = new MultiplicityValidator(newPort || !connected, port.getMultiplicity(), multiplicityAnyAllowed);
+ MultiplicityValidator mv = new MultiplicityValidator(newPort || notReferenced.isOk(), port.getMultiplicity(), multiplicityAnyAllowed);
ArrayList<IEObjectDescription> protocols = new ArrayList<IEObjectDescription>();
Iterator<IEObjectDescription> it = scope.getAllElements().iterator();
@@ -222,21 +222,21 @@ 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, !connected, mform.getToolkit());
+ createRelayCheck(body, notReferenced, mform.getToolkit());
Multiplicity2StringConverter m2s = new Multiplicity2StringConverter();
String2MultiplicityConverter s2m = new String2MultiplicityConverter();
Text multi = createText(body, "&Multiplicity:", port, RoomPackage.eINSTANCE.getPort_Multiplicity(), mv, s2m, m2s, false);
if (!newPort) {
- if (connected) {
+ if (!notReferenced.isOk()) {
protocol.setEnabled(false);
- createInfoDecorator(protocol, "only changeable for unconnected ports");
+ createInfoDecorator(protocol, notReferenced.getMsg());
conj.setEnabled(false);
- createInfoDecorator(conj, "only changeable for unconnected ports");
+ createInfoDecorator(conj, notReferenced.getMsg());
if (port.getMultiplicity()==1) {
multi.setEnabled(false);
- createInfoDecorator(multi, "only changeable for unconnected ports");
+ createInfoDecorator(multi, notReferenced.getMsg());
}
}
@@ -260,14 +260,17 @@ public class PortPropertyDialog extends AbstractPropertyDialog {
name.setFocus();
}
- private void createRelayCheck(Composite parent, boolean enabled, FormToolkit toolkit) {
+ private void createRelayCheck(Composite parent, Result notReferenced, 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);
- relayCheck.setEnabled(enabled);
+ relayCheck.setEnabled(notReferenced.isOk());
+
+ if (!notReferenced.isOk())
+ createInfoDecorator(relayCheck, notReferenced.getMsg());
}
@Override

Back to the top