Author: DartPeng
Date: 2009-11-30 02:41:08 -0500 (Mon, 30 Nov 2009)
New Revision: 18918
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks10/model/smooks/util/SmooksModelUtils.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksReaderFormPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/edi/EDIDataParser.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/SelectorValidator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/AbstractSmooksFormEditor.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksGraphicalEditorPart.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksJavaMappingGraphicalEditor.java
Log:
JBIDE-5298
Done
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks10/model/smooks/util/SmooksModelUtils.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks10/model/smooks/util/SmooksModelUtils.java 2009-11-30
02:32:04 UTC (rev 18917)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks10/model/smooks/util/SmooksModelUtils.java 2009-11-30
07:41:08 UTC (rev 18918)
@@ -96,7 +96,7 @@
public static final String INPUT_TYPE_EDI_1_2 = SmooksInputType.INPUT_TYPE_EDI;
- public static final String INPUT_TYPE_JSON_1_2 = SmooksInputType.INPUT_TYPE_EDI;
+ public static final String INPUT_TYPE_JSON_1_2 = SmooksInputType.INPUT_TYPE_JSON;
public static EStructuralFeature ATTRIBUTE_PROPERTY =
ExtendedMetaData.INSTANCE.demandFeature(null, "property",
false);
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksReaderFormPage.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksReaderFormPage.java 2009-11-30
02:32:04 UTC (rev 18917)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksReaderFormPage.java 2009-11-30
07:41:08 UTC (rev 18918)
@@ -197,7 +197,8 @@
mainContainer.setLayout(gl);
section.setClient(mainContainer);
- Hyperlink refreshLink = toolkit.createHyperlink(mainContainer,
Messages.SmooksReaderFormPage_RefreshLinkLabel, SWT.NONE);
+ Hyperlink refreshLink = toolkit.createHyperlink(mainContainer,
Messages.SmooksReaderFormPage_RefreshLinkLabel,
+ SWT.NONE);
refreshLink.addHyperlinkListener(new IHyperlinkListener() {
public void linkExited(HyperlinkEvent e) {
@@ -691,10 +692,14 @@
resourceList, IEditingDomainItemProvider.class);
Collection<?> collections = provider.getNewChildDescriptors(resourceList,
editDomain, null);
+ String customReaderText = null;
+ Object customReaderInstance = null;
+
ISmooksModelProvider modelProvider = getSmooksModelProvider();
if (modelProvider != null) {
String version = modelProvider.getPlatformVersion();
OnlyReaderViewerFilter filter = new OnlyReaderViewerFilter();
+ // move the custom reader to the end of the reader type list.
for (Iterator<?> iterator = collections.iterator(); iterator.hasNext();) {
Object object = (Object) iterator.next();
if (object instanceof CommandParameter) {
@@ -710,12 +715,23 @@
IItemLabelProvider lp = (IItemLabelProvider)
editDomain.getAdapterFactory().adapt(value,
IItemLabelProvider.class);
String text = lp.getText(value);
+
+ if (ReaderType.class.isInstance(value)) {
+ customReaderText = text;
+ customReaderInstance = value;
+ continue;
+ }
readerCombo.add(text);
readerTypeList.add(value);
}
}
}
}
+ if (customReaderInstance != null && customReaderText != null) {
+ readerCombo.add(customReaderText);
+ readerTypeList.add(customReaderInstance);
+ }
+
}
private void setInputDataActiveStatus(boolean active, InputType inputType, final
CompoundCommand command) {
@@ -904,7 +920,8 @@
JavaUI.openInEditor(result);
else {
MessageDialog.openError(getSite().getWorkbenchWindow().getShell(),
- Messages.SmooksReaderFormPage_CantFindTypeErrorTitle, "Can't find
type \"" + filePath + "\" in \"" //$NON-NLS-1$//$NON-NLS-2$
//$NON-NLS-3$
+ Messages.SmooksReaderFormPage_CantFindTypeErrorTitle,
+ "Can't find type \"" + filePath + "\" in
\"" //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
+ javaProject.getProject().getName() + "\" project.");
//$NON-NLS-1$
}
} catch (Exception e) {
@@ -923,7 +940,8 @@
try {
IDE.openEditorOnFileStore(page, fileStore);
} catch (PartInitException e) {
- MessageDialog.open(MessageDialog.ERROR, window.getShell(),
Messages.SmooksReaderFormPage_OpenFileErrorTitle,
+ MessageDialog.open(MessageDialog.ERROR, window.getShell(),
+ Messages.SmooksReaderFormPage_OpenFileErrorTitle,
"Can't open the file : '" + filePath + "'",
SWT.SHEET); //$NON-NLS-1$ //$NON-NLS-2$
}
} else {
@@ -931,7 +949,8 @@
}
} catch (Exception e) {
MessageDialog.open(MessageDialog.ERROR,
getSite().getWorkbenchWindow().getShell(),
- Messages.SmooksReaderFormPage_OpenFileErrorTitle, "Can't open the file
: '" + filePath + "'", SWT.SHEET); //$NON-NLS-1$//$NON-NLS-2$
//$NON-NLS-3$
+ Messages.SmooksReaderFormPage_OpenFileErrorTitle,
+ "Can't open the file : '" + filePath + "'",
SWT.SHEET); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
}
}
}
@@ -963,7 +982,8 @@
GridLayout l = new GridLayout();
buttonComposite.setLayout(l);
- addInputDataButton = toolkit.createButton(buttonComposite,
Messages.SmooksReaderFormPage_AddButtonLabel, SWT.FLAT);
+ addInputDataButton = toolkit.createButton(buttonComposite,
Messages.SmooksReaderFormPage_AddButtonLabel,
+ SWT.FLAT);
gd = new GridData(GridData.FILL_HORIZONTAL);
addInputDataButton.setLayoutData(gd);
addInputDataButton.addSelectionListener(new SelectionAdapter() {
@@ -974,7 +994,8 @@
});
- removeInputDataButton = toolkit.createButton(buttonComposite,
Messages.SmooksReaderFormPage_DeleteButtonLabel, SWT.FLAT);
+ removeInputDataButton = toolkit.createButton(buttonComposite,
Messages.SmooksReaderFormPage_DeleteButtonLabel,
+ SWT.FLAT);
gd = new GridData(GridData.FILL_HORIZONTAL);
removeInputDataButton.setLayoutData(gd);
removeInputDataButton.addSelectionListener(new SelectionAdapter() {
@@ -1075,7 +1096,11 @@
private void refreshInputModelView() {
if (inputModelViewer != null) {
List<Object> input = generateInputData();
- inputModelViewer.setInput(input);
+ try {
+ inputModelViewer.setInput(input);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
SmooksUIUtils.expandSelectorViewer(input, inputModelViewer);
}
}
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/edi/EDIDataParser.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/edi/EDIDataParser.java 2009-11-30
02:32:04 UTC (rev 18917)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/edi/EDIDataParser.java 2009-11-30
07:41:08 UTC (rev 18918)
@@ -87,8 +87,8 @@
return null;
}
- public TagList parseEDIFile(InputStream stream,SmooksResourceListType resourceList)
- throws IOException, DocumentException {
+ public TagList parseEDIFile(InputStream stream, SmooksResourceListType resourceList)
throws IOException,
+ DocumentException {
// String encoding = null;
// String mappingModel = null;
// String validate = null;
@@ -227,9 +227,9 @@
// FileInputStream stream
StringResult result = new StringResult();
smooks.filterSource(new StreamSource(ediInputStream), result);
-
+ String resultXMLContent = result.getResult();
XMLObjectAnalyzer analyzer = new XMLObjectAnalyzer();
- ByteArrayInputStream byteinputStream = new
ByteArrayInputStream(result.getResult().getBytes());
+ ByteArrayInputStream byteinputStream = new
ByteArrayInputStream(resultXMLContent.getBytes());
TagList tagList = analyzer.analyze(byteinputStream, null);
try {
@@ -253,7 +253,7 @@
return tagList;
}
- public TagList parseEDIFile(String path,SmooksResourceListType smooksResourceListType)
+ public TagList parseEDIFile(String path, SmooksResourceListType smooksResourceListType)
throws InvocationTargetException, FileNotFoundException, IOException,
DocumentException {
String filePath = SmooksUIUtils.parseFilePath(path);
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java 2009-11-30
02:32:04 UTC (rev 18917)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java 2009-11-30
07:41:08 UTC (rev 18918)
@@ -866,7 +866,8 @@
toolkit.paintBordersFor(textContainer);
if (openFile) {
final IFilePathProcessor processor = filePathProcessor;
- Button fileBrowseButton = toolkit.createButton(textContainer,
Messages.SmooksUIUtils_BrowseButtonLabel, SWT.NONE);
+ Button fileBrowseButton = toolkit.createButton(textContainer,
Messages.SmooksUIUtils_BrowseButtonLabel,
+ SWT.NONE);
fileBrowseButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
@@ -1193,7 +1194,8 @@
notificationComposite.setLayoutData(gd);
editpart.setFieldMarker(notificationComposite);
- final SearchComposite searchComposite = new SearchComposite(tcom, toolkit,
Messages.SmooksUIUtils_BrowseButtonLabel, dialog, SWT.NONE);
+ final SearchComposite searchComposite = new SearchComposite(tcom, toolkit,
+ Messages.SmooksUIUtils_BrowseButtonLabel, dialog, SWT.NONE);
gd = new GridData(GridData.FILL_HORIZONTAL);
searchComposite.setLayoutData(gd);
Object editValue = getEditValue(propertyDescriptor, model);
@@ -1239,7 +1241,8 @@
if (result != null)
JavaUI.openInEditor(result);
else {
- MessageDialog.openError(classTextComposite.getShell(),
Messages.SmooksUIUtils_CantFindTypeErrorDialogTitle,
+ MessageDialog.openError(classTextComposite.getShell(),
+ Messages.SmooksUIUtils_CantFindTypeErrorDialogTitle,
"Can't find type \"" + typeName + "\" in
\"" //$NON-NLS-1$ //$NON-NLS-2$
+ javaProject.getProject().getName() + "\" project.");
//$NON-NLS-1$
}
@@ -1858,11 +1861,10 @@
}
return null;
}
-
- public static boolean isInputParamType(ParamType param){
+
+ public static boolean isInputParamType(ParamType param) {
String type = param.getType();
- if (SmooksModelUtils.INPUT_ACTIVE_TYPE.equals(type)
- || SmooksModelUtils.INPUT_DEACTIVE_TYPE.equals(type)) {
+ if (SmooksModelUtils.INPUT_ACTIVE_TYPE.equals(type) ||
SmooksModelUtils.INPUT_DEACTIVE_TYPE.equals(type)) {
return true;
}
return false;
@@ -2648,7 +2650,13 @@
List<TreeNodeModel> parentList = new ArrayList<TreeNodeModel>();
boolean canExpand = true;
while (parent != rootEditPart.getModel()) {
- parent = (TreeNodeModel) parent.getParent();
+ Object pa = parent.getParent();
+ if (pa instanceof TreeNodeModel) {
+ parent = (TreeNodeModel) pa;
+ } else {
+ canExpand = false;
+ break;
+ }
if (parent == null) {
canExpand = false;
break;
@@ -3011,18 +3019,18 @@
}
return SmooksConstants.VERSION_1_2;
}
-
- public static void addInputTypeParam(String inputType, SmooksResourceListType
resourceList){
+
+ public static void addInputTypeParam(String inputType, SmooksResourceListType
resourceList) {
ParamsType params = resourceList.getParams();
- if(params == null){
+ if (params == null) {
params = SmooksFactory.eINSTANCE.createParamsType();
resourceList.setParams(params);
}
-
+
ParamType param = SmooksFactory.eINSTANCE.createParamType();
param.setName(SmooksModelUtils.INPUT_TYPE);
param.setStringValue(inputType);
-
+
params.getParam().add(param);
}
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/SelectorValidator.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/SelectorValidator.java 2009-11-30
02:32:04 UTC (rev 18917)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/SelectorValidator.java 2009-11-30
07:41:08 UTC (rev 18918)
@@ -17,6 +17,9 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.content.IContentDescription;
+import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.emf.common.util.Diagnostic;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EObject;
@@ -24,15 +27,12 @@
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.part.FileEditorInput;
import org.jboss.tools.smooks.configuration.SmooksConfigurationActivator;
import org.jboss.tools.smooks.configuration.editors.IXMLStructuredObject;
import org.jboss.tools.smooks.configuration.editors.SelectorCreationDialog;
import org.jboss.tools.smooks.configuration.editors.uitls.SmooksUIUtils;
-import org.jboss.tools.smooks.editor.AbstractSmooksFormEditor;
import org.jboss.tools.smooks.model.javabean.BindingsType;
import org.jboss.tools.smooks.model.javabean.ExpressionType;
import org.jboss.tools.smooks.model.javabean.ValueType;
@@ -92,7 +92,7 @@
sperator = " ";
}
if (feature != null && path != null) {
- if("#document".equals(path)){
+ if ("#document".equals(path)) {
return null;
}
Object node = null;
@@ -114,8 +114,10 @@
}
if (node == null && feature instanceof EAttribute) {
if (model instanceof BeanType || model instanceof BindingsType || model instanceof
ValueType
- || model instanceof org.jboss.tools.smooks.model.javabean12.ValueType || model
instanceof WiringType
- || model instanceof org.jboss.tools.smooks.model.javabean12.WiringType || model
instanceof ExpressionType
+ || model instanceof org.jboss.tools.smooks.model.javabean12.ValueType
+ || model instanceof WiringType
+ || model instanceof org.jboss.tools.smooks.model.javabean12.WiringType
+ || model instanceof ExpressionType
|| model instanceof org.jboss.tools.smooks.model.javabean12.ExpressionType) {
return newWaringDiagnostic("Can't find the input source node :
'" + path + "'", model,
(EAttribute) feature);
@@ -148,7 +150,26 @@
}
if (file == null)
return;
- final FileEditorInput input = new FileEditorInput(file);
+ IContentType contentType = null;
+ try {
+ IContentDescription contentDescription = file.getContentDescription();
+ if (contentDescription != null) {
+ contentType = contentDescription.getContentType();
+ }
+
+ } catch (Throwable t) {
+
+ }
+ IContentType smooksContentType = Platform.getContentTypeManager().getContentType(
+ "org.jboss.tools.smooks.ui.smooks.contentType");
+ IContentType ediMappingContentType = Platform.getContentTypeManager().getContentType(
+ "org.jboss.tools.smooks.ui.edimap.contentType");
+
+ if (!(smooksContentType.equals(contentType) ||
ediMappingContentType.equals(contentType))) {
+ return;
+ }
+
+ // final FileEditorInput input = new FileEditorInput(file);
final SmooksResourceListType finalList = listType;
Display dis = SmooksConfigurationActivator.getDefault().getWorkbench().getDisplay();
if (dis != null && !dis.isDisposed()) {
@@ -165,13 +186,15 @@
IWorkbenchPage activePage = window.getActivePage();
if (activePage != null) {
try {
- IEditorPart part = activePage.findEditor(input);
- if (part != null && part instanceof AbstractSmooksFormEditor) {
- List<Object> l = SelectorCreationDialog.generateInputData(finalList);
- if (l != null) {
- list.addAll(l);
- }
+ // IEditorPart part =
+ // activePage.findEditor(input);
+ // if (part != null && part instanceof
+ // AbstractSmooksFormEditor) {
+ List<Object> l = SelectorCreationDialog.generateInputData(finalList);
+ if (l != null) {
+ list.addAll(l);
}
+ // }
} catch (Throwable t) {
t.printStackTrace();
}
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/AbstractSmooksFormEditor.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/AbstractSmooksFormEditor.java 2009-11-30
02:32:04 UTC (rev 18917)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/AbstractSmooksFormEditor.java 2009-11-30
07:41:08 UTC (rev 18918)
@@ -683,7 +683,9 @@
}
} else {
inputType = SmooksUIUtils.judgeInputType(smooksModel);
- SmooksUIUtils.addInputTypeParam(inputType, resourceList);
+ if (inputType != null) {
+ SmooksUIUtils.addInputTypeParam(inputType, resourceList);
+ }
}
this.setInputType(inputType);
}
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksGraphicalEditorPart.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksGraphicalEditorPart.java 2009-11-30
02:32:04 UTC (rev 18917)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksGraphicalEditorPart.java 2009-11-30
07:41:08 UTC (rev 18918)
@@ -104,6 +104,12 @@
import org.jboss.tools.smooks.graphical.editors.model.xsl.XSLNodeGraphicalModel;
import org.jboss.tools.smooks.graphical.editors.model.xsl.XSLTemplateGraphicalModel;
import org.jboss.tools.smooks.graphical.editors.process.TaskType;
+import org.jboss.tools.smooks.model.javabean.BindingsType;
+import org.jboss.tools.smooks.model.javabean.JavabeanPackage;
+import org.jboss.tools.smooks.model.javabean.ValueType;
+import org.jboss.tools.smooks.model.javabean.WiringType;
+import org.jboss.tools.smooks.model.javabean12.BeanType;
+import org.jboss.tools.smooks.model.javabean12.Javabean12Package;
import org.jboss.tools.smooks.model.smooks.DocumentRoot;
import org.jboss.tools.smooks.model.smooks.ParamType;
import org.jboss.tools.smooks.model.smooks.ParamsType;
@@ -762,6 +768,9 @@
expandConnectedModels(connections);
this.autoLayout(false);
+
+ List<Diagnostic> diagnosticList =
this.getSmooksModelProvider().getDiagnosticList();
+ this.validateEnd(diagnosticList);
}
protected AbstractSmooksGraphicalModel createGraphModel(Object model) {
@@ -1353,6 +1362,45 @@
}
protected String getDiagnosticMessage(Diagnostic diagnostic){
+ List<?> datas = diagnostic.getData();
+ if (datas.size() == 2) {
+ Object parentObj = datas.get(0);
+
+ if (parentObj instanceof BeanType || parentObj instanceof BindingsType) {
+ Object obj = datas.get(1);
+ if (obj == JavabeanPackage.Literals.BINDINGS_TYPE__BEAN_ID
+ || obj == Javabean12Package.Literals.BEAN_TYPE__BEAN_ID) {
+ String message = diagnostic.getMessage();
+ if (message != null && message.startsWith("The required feature"))
{ //$NON-NLS-1$
+ return Messages.SmooksJavaMappingGraphicalEditor_BeanIdEmptyErrormessage;
+ }
+ }
+ }
+
+ if (parentObj instanceof ValueType
+ || parentObj instanceof org.jboss.tools.smooks.model.javabean12.ValueType) {
+ Object obj = datas.get(1);
+ if (obj == JavabeanPackage.Literals.VALUE_TYPE__DATA
+ || obj == Javabean12Package.Literals.VALUE_TYPE__DATA) {
+ String message = diagnostic.getMessage();
+ if (message != null && message.startsWith("The required feature"))
{ //$NON-NLS-1$
+ return Messages.SmooksJavaMappingGraphicalEditor_NodeMustLinkWithSource;
+ }
+ }
+ }
+
+ if (parentObj instanceof WiringType
+ || parentObj instanceof org.jboss.tools.smooks.model.javabean12.WiringType) {
+ Object obj = datas.get(1);
+ if (obj == JavabeanPackage.Literals.WIRING_TYPE__BEAN_ID_REF
+ || obj == Javabean12Package.Literals.WIRING_TYPE__BEAN_ID_REF) {
+ String message = diagnostic.getMessage();
+ if (message != null && message.startsWith("The required feature"))
{ //$NON-NLS-1$
+ return Messages.SmooksJavaMappingGraphicalEditor_NodeMustLinkWithJavaBean;
+ }
+ }
+ }
+ }
return diagnostic.getMessage();
}
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksJavaMappingGraphicalEditor.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksJavaMappingGraphicalEditor.java 2009-11-30
02:32:04 UTC (rev 18917)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksJavaMappingGraphicalEditor.java 2009-11-30
07:41:08 UTC (rev 18918)
@@ -55,45 +55,6 @@
*/
@Override
protected String getDiagnosticMessage(Diagnostic diagnostic) {
- List<?> datas = diagnostic.getData();
- if (datas.size() == 2) {
- Object parentObj = datas.get(0);
-
- if (parentObj instanceof BeanType || parentObj instanceof BindingsType) {
- Object obj = datas.get(1);
- if (obj == JavabeanPackage.Literals.BINDINGS_TYPE__BEAN_ID
- || obj == Javabean12Package.Literals.BEAN_TYPE__BEAN_ID) {
- String message = diagnostic.getMessage();
- if (message != null && message.startsWith("The required feature"))
{ //$NON-NLS-1$
- return Messages.SmooksJavaMappingGraphicalEditor_BeanIdEmptyErrormessage;
- }
- }
- }
-
- if (parentObj instanceof ValueType
- || parentObj instanceof org.jboss.tools.smooks.model.javabean12.ValueType) {
- Object obj = datas.get(1);
- if (obj == JavabeanPackage.Literals.VALUE_TYPE__DATA
- || obj == Javabean12Package.Literals.VALUE_TYPE__DATA) {
- String message = diagnostic.getMessage();
- if (message != null && message.startsWith("The required feature"))
{ //$NON-NLS-1$
- return Messages.SmooksJavaMappingGraphicalEditor_NodeMustLinkWithSource;
- }
- }
- }
-
- if (parentObj instanceof WiringType
- || parentObj instanceof org.jboss.tools.smooks.model.javabean12.WiringType) {
- Object obj = datas.get(1);
- if (obj == JavabeanPackage.Literals.WIRING_TYPE__BEAN_ID_REF
- || obj == Javabean12Package.Literals.WIRING_TYPE__BEAN_ID_REF) {
- String message = diagnostic.getMessage();
- if (message != null && message.startsWith("The required feature"))
{ //$NON-NLS-1$
- return Messages.SmooksJavaMappingGraphicalEditor_NodeMustLinkWithJavaBean;
- }
- }
- }
- }
return super.getDiagnosticMessage(diagnostic);
}