summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Pielmann2012-02-15 09:18:56 (EST)
committerStephan Born2012-04-24 10:12:52 (EDT)
commitc6f28b8c5a33336f0011c8565ab7439545e8ec90 (patch)
tree541bf16ec27148d0e6fda81cfc94df417ca075a2
parentb2fef5e5d8a023b18fd9363f1695b15c46f2d64d (diff)
downloadorg.eclipse.stardust.ide-c6f28b8c5a33336f0011c8565ab7439545e8ec90.zip
org.eclipse.stardust.ide-c6f28b8c5a33336f0011c8565ab7439545e8ec90.tar.gz
org.eclipse.stardust.ide-c6f28b8c5a33336f0011c8565ab7439545e8ec90.tar.bz2
Jira-ID: CRNT-23338 MTA: Add Configured external classes throws NPE
git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ide@53799 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--modeling/org.eclipse.stardust.modeling.transformation.nl/src/org/eclipse/stardust/modeling/transformation/messaging/modeling/modeling-messages_ja.properties2
-rw-r--r--modeling/org.eclipse.stardust.modeling.transformation/src/org/eclipse/stardust/modeling/transformation/messaging/modeling/Modeling_Messages.java1
-rw-r--r--modeling/org.eclipse.stardust.modeling.transformation/src/org/eclipse/stardust/modeling/transformation/messaging/modeling/application/transformation/widgets/ExternalClassAdditionDialog.java95
-rw-r--r--modeling/org.eclipse.stardust.modeling.transformation/src/org/eclipse/stardust/modeling/transformation/messaging/modeling/modeling-messages.properties1
4 files changed, 65 insertions, 34 deletions
diff --git a/modeling/org.eclipse.stardust.modeling.transformation.nl/src/org/eclipse/stardust/modeling/transformation/messaging/modeling/modeling-messages_ja.properties b/modeling/org.eclipse.stardust.modeling.transformation.nl/src/org/eclipse/stardust/modeling/transformation/messaging/modeling/modeling-messages_ja.properties
index 4f2aa3c..95e90b5 100644
--- a/modeling/org.eclipse.stardust.modeling.transformation.nl/src/org/eclipse/stardust/modeling/transformation/messaging/modeling/modeling-messages_ja.properties
+++ b/modeling/org.eclipse.stardust.modeling.transformation.nl/src/org/eclipse/stardust/modeling/transformation/messaging/modeling/modeling-messages_ja.properties
@@ -232,6 +232,8 @@ TXT_NAME= {0} \u540D\u524D\uFF1A
# TXT_NAME_en={0} Name:
TXT_NOT_VALID_NAME= {0}'' \u306F\u6709\u52B9\u306A\u540D\u524D\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
# TXT_NOT_VALID_NAME_en=''{0}'' is not a valid name.
+TXT_NO_CLASS_PROVIDED=<No class provided.>
+# TXT_NO_CLASS_PROVIDED_en=No class provided.
TXT_OK= OK
# TXT_OK_en=Ok
TXT_PLEASE_ENTER_VALID_NUMBER= \u6709\u52B9\u306A\u6570\u5B57\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\uFF1A
diff --git a/modeling/org.eclipse.stardust.modeling.transformation/src/org/eclipse/stardust/modeling/transformation/messaging/modeling/Modeling_Messages.java b/modeling/org.eclipse.stardust.modeling.transformation/src/org/eclipse/stardust/modeling/transformation/messaging/modeling/Modeling_Messages.java
index 06917d5..bcc5e5d 100644
--- a/modeling/org.eclipse.stardust.modeling.transformation/src/org/eclipse/stardust/modeling/transformation/messaging/modeling/Modeling_Messages.java
+++ b/modeling/org.eclipse.stardust.modeling.transformation/src/org/eclipse/stardust/modeling/transformation/messaging/modeling/Modeling_Messages.java
@@ -135,6 +135,7 @@ public class Modeling_Messages extends NLS {
public static String TXT_MSG_TRANSF_APP;
public static String TXT_NAME;
public static String TXT_NOT_VALID_NAME;
+ public static String TXT_NO_CLASS_PROVIDED;
public static String TXT_OK;
public static String TXT_PLEASE_ENTER_VALID_NUMBER;
public static String TXT_PR;
diff --git a/modeling/org.eclipse.stardust.modeling.transformation/src/org/eclipse/stardust/modeling/transformation/messaging/modeling/application/transformation/widgets/ExternalClassAdditionDialog.java b/modeling/org.eclipse.stardust.modeling.transformation/src/org/eclipse/stardust/modeling/transformation/messaging/modeling/application/transformation/widgets/ExternalClassAdditionDialog.java
index a20d17e..12a80f2 100644
--- a/modeling/org.eclipse.stardust.modeling.transformation/src/org/eclipse/stardust/modeling/transformation/messaging/modeling/application/transformation/widgets/ExternalClassAdditionDialog.java
+++ b/modeling/org.eclipse.stardust.modeling.transformation/src/org/eclipse/stardust/modeling/transformation/messaging/modeling/application/transformation/widgets/ExternalClassAdditionDialog.java
@@ -73,8 +73,8 @@ public class ExternalClassAdditionDialog extends Dialog implements ModifyListene
private Composite mainComposite;
private boolean isError = false;
-
- // private Combo dataTypeCombo;
+
+ private boolean isError2 = false;
private TypeSelectionComposite classBrowser;
@@ -88,6 +88,8 @@ public class ExternalClassAdditionDialog extends Dialog implements ModifyListene
private DirectionType directionType;
+ private Label errorLabel2;
+
public ExternalClassAdditionDialog(Shell parentShell,
MessageTransformationController controller, List messageTypes, String preset,
DirectionType directionType)
@@ -163,45 +165,26 @@ public class ExternalClassAdditionDialog extends Dialog implements ModifyListene
public void modifyText(ModifyEvent e)
{
serializableTypeModified(e);
+ buttonEnablement();
}
});
+ classBrowser.getText().setEditable(false);
+
+ errorLabel2 = new Label(groupComposite, SWT.NONE);
+ errorLabel2.setImage(MessageTransformationModelingPlugin.getDefault()
+ .getImageDescriptor("icons/error.gif").createImage()); //$NON-NLS-1$
+ errorLabel2.setVisible(false);
parent.getShell().setMinimumSize(300, 150);
parent.getShell().setText(Modeling_Messages.TXT_ADD_EXTERNAL_CL);
+
+ handleErrors();
return comp;
}
- protected void buttonEnablement()
- {
- String text = messageNameText.getText();
- this.errorLabel.setVisible(isError);
- if (getButton(IDialogConstants.OK_ID) != null)
- {
- getButton(IDialogConstants.OK_ID).setEnabled(
- !isError && !text.equalsIgnoreCase("") && text.indexOf(" ") == -1); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- protected void createButtonsForButtonBar(Composite parent)
- {
- super.createButtonsForButtonBar(parent);
- getButton(IDialogConstants.OK_ID).setEnabled(false);
- this.buttonEnablement();
- }
-
- protected void buttonPressed(int buttonId)
- {
- if (buttonId == IDialogConstants.OK_ID)
- {
- messageName = messageNameText.getText();
- }
- super.buttonPressed(buttonId);
-
- }
-
- public void modifyText(ModifyEvent arg0)
+ private void handleErrors()
{
String text = messageNameText.getText();
if (!controller.isSimpleMode())
@@ -215,13 +198,13 @@ public class ExternalClassAdditionDialog extends Dialog implements ModifyListene
}
else
{
- if (!StringUtils.isValidIdentifier(text))
+ if (!StringUtils.isValidIdentifier(text) || StringUtils.isEmpty(text))
{
isError = true;
errorLabel.setToolTipText(MessageFormat.format(
Modeling_Messages.TXT_NOT_VALID_NAME, new Object[] {text}));
}
- else
+ else
{
isError = false;
errorLabel.setToolTipText(null);
@@ -242,13 +225,57 @@ public class ExternalClassAdditionDialog extends Dialog implements ModifyListene
errorLabel.setToolTipText(null);
}
}
+
+ if (this.messageType == null)
+ {
+ isError2 = true;
+ errorLabel2.setToolTipText(Modeling_Messages.TXT_NO_CLASS_PROVIDED);
+ }
+ else
+ {
+ isError2 = false;
+ errorLabel2.setToolTipText(null);
+ }
+ errorLabel.setVisible(isError);
+ errorLabel2.setVisible(isError2);
+ }
+
+ protected void buttonEnablement()
+ {
+ handleErrors();
+ if (getButton(IDialogConstants.OK_ID) != null)
+ {
+ getButton(IDialogConstants.OK_ID).setEnabled(!isError && !isError2);
+ }
+ }
+
+ protected void createButtonsForButtonBar(Composite parent)
+ {
+ super.createButtonsForButtonBar(parent);
+ getButton(IDialogConstants.OK_ID).setEnabled(false);
+ this.buttonEnablement();
+ }
+
+ protected void buttonPressed(int buttonId)
+ {
+ if (buttonId == IDialogConstants.OK_ID)
+ {
+ messageName = messageNameText.getText();
+ }
+ super.buttonPressed(buttonId);
+
+ }
+
+ public void modifyText(ModifyEvent arg0)
+ {
buttonEnablement();
}
private void serializableTypeModified(ModifyEvent e)
{
+ this.messageType = null;
if (classBrowser.getType() != null)
- {
+ {
String messageName = classBrowser.getType().getType().getElementName();
String text = messageName;
int n = 1;
diff --git a/modeling/org.eclipse.stardust.modeling.transformation/src/org/eclipse/stardust/modeling/transformation/messaging/modeling/modeling-messages.properties b/modeling/org.eclipse.stardust.modeling.transformation/src/org/eclipse/stardust/modeling/transformation/messaging/modeling/modeling-messages.properties
index 381298b..423bef4 100644
--- a/modeling/org.eclipse.stardust.modeling.transformation/src/org/eclipse/stardust/modeling/transformation/messaging/modeling/modeling-messages.properties
+++ b/modeling/org.eclipse.stardust.modeling.transformation/src/org/eclipse/stardust/modeling/transformation/messaging/modeling/modeling-messages.properties
@@ -121,6 +121,7 @@ TXT_MSG_PRC_TEST_CFG=Message Processing Test Configuration
TXT_MSG_TRANSF_APP=Message Transformation Application:
TXT_NAME={0} Name:
TXT_NOT_VALID_NAME=''{0}'' is not a valid name.
+TXT_NO_CLASS_PROVIDED=No class provided.
TXT_OK=Ok
TXT_PLEASE_ENTER_VALID_NUMBER=Please enter a valid number:
TXT_PR=Parsing