JBoss Tools SVN: r14743 - trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2009-04-14 14:25:10 -0400 (Tue, 14 Apr 2009)
New Revision: 14743
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/BundleHyperlink.java
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPBundleHyperlinkPartitioner.java
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPExprHyperlinkPartitioner.java
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPLoadBundleHyperlinkPartitioner.java
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/LoadBundleHyperlink.java
Log:
JBIDE-4147 A hyperlink doesn't work for <a4j:loadBundle> RichFaces tag
Bundle & Load Bundle hyperlinks and their partitioners are modified to allow them to be overriden
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/BundleHyperlink.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/BundleHyperlink.java 2009-04-14 17:15:42 UTC (rev 14742)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/BundleHyperlink.java 2009-04-14 18:25:10 UTC (rev 14743)
@@ -17,6 +17,7 @@
import java.util.Properties;
import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
import org.eclipse.ui.IEditorPart;
import org.jboss.tools.common.model.XModel;
@@ -91,20 +92,21 @@
String bundleProp = getDocument().get(region.getOffset(), region.getLength());
- String prefix = getPrefix(region);
- if(prefix == null) return null;
+ String[] prefixes = getLoadBundleTagPrefixes(region);
+ if(prefixes == null) return null;
// Find loadBundle tag
List<Element> lbTags = new ArrayList<Element>();
- NodeList list = xmlDocument.getElementsByTagName(prefix + ":loadBundle");
- for (int i = 0; list != null && i < list.getLength(); i++) {
- Element el = (Element)list.item(i);
- int end = Utils.getValueEnd(el);
- if (end >= 0 && end < region.getOffset()) {
- lbTags.add(el);
+ for (String prefix : prefixes) {
+ NodeList list = xmlDocument.getElementsByTagName(prefix + ":loadBundle");
+ for (int i = 0; list != null && i < list.getLength(); i++) {
+ Element el = (Element)list.item(i);
+ int end = Utils.getValueEnd(el);
+ if (end >= 0 && end < region.getOffset()) {
+ lbTags.add(el);
+ }
}
}
-
for (int i = 0; i < lbTags.size(); i++) {
Element el = (Element)lbTags.get(i);
Attr var = el.getAttributeNode("var");
@@ -129,18 +131,20 @@
smw.dispose();
}
}
-
- private String getPrefix(IRegion region) {
+
+ protected String[] getLoadBundleTagPrefixes(IRegion region) {
TaglibManagerWrapper tmw = new TaglibManagerWrapper();
tmw.init(getDocument(), region.getOffset());
if(tmw.exists()) {
- return tmw.getCorePrefix();
+ return new String[] { tmw.getCorePrefix() };
} else {
VpeTaglibManager taglibManager = getTaglibManager();
if(taglibManager == null) return null;
TaglibData[] data = (TaglibData[])taglibManager.getTagLibs().toArray(new TaglibData[0]);
+ ArrayList<String> prefixes = new ArrayList<String>();
for (int i = 0; i < data.length; i++) {
- if("http://java.sun.com/jsf/core".equals(data[i].getUri())) return data[i].getPrefix();
+ if("http://java.sun.com/jsf/core".equals(data[i].getUri()))
+ prefixes.add(data[i].getPrefix());
}
}
return null;
@@ -159,34 +163,34 @@
private static final String PREFIX_SEPARATOR = ":";
private String getPageLocale(IRegion region) {
+ if(getDocument() == null || region == null) return null;
+
StructuredModelWrapper smw = new StructuredModelWrapper();
try {
smw.init(getDocument());
-
- TaglibManagerWrapper tmw = new TaglibManagerWrapper();
- tmw.init(getDocument(), region.getOffset());
- if(!tmw.exists()) return null;
- String prefix = tmw.getCorePrefix();
-
- if (prefix == null || prefix.length() == 0) return null;
-
- String nodeToFind = prefix + PREFIX_SEPARATOR + VIEW_TAGNAME;
-
Document xmlDocument = smw.getDocument();
if (xmlDocument == null) return null;
+ String[] prefixes = getLoadBundleTagPrefixes(region);
+ if(prefixes == null) return null;
+
Node n = Utils.findNodeForOffset(xmlDocument, region.getOffset());
if (!(n instanceof Attr) ) return null;
Element el = ((Attr)n).getOwnerElement();
Element jsfCoreViewTag = null;
- while (el != null) {
- if (nodeToFind.equals(el.getNodeName())) {
- jsfCoreViewTag = el;
- break;
+ for (String prefix : prefixes) {
+ String nodeToFind = prefix + PREFIX_SEPARATOR + VIEW_TAGNAME;
+
+ while (el != null) {
+ if (nodeToFind.equals(el.getNodeName())) {
+ jsfCoreViewTag = el;
+ break;
+ }
+ Node parent = el.getParentNode();
+ el = (parent instanceof Element ? (Element)parent : null);
}
- el = (Element)el.getParentNode();
}
if (jsfCoreViewTag == null || !jsfCoreViewTag.hasAttribute(LOCALE_ATTRNAME)) return null;
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPBundleHyperlinkPartitioner.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPBundleHyperlinkPartitioner.java 2009-04-14 17:15:42 UTC (rev 14742)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPBundleHyperlinkPartitioner.java 2009-04-14 18:25:10 UTC (rev 14743)
@@ -37,6 +37,10 @@
*/
public class JSPBundleHyperlinkPartitioner extends AbstractHyperlinkPartitioner implements IHyperlinkPartitionRecognizer {
public static final String JSP_BUNDLE_PARTITION = "org.jboss.tools.common.text.ext.jsp.JSP_BUNDLE";
+
+ protected String getPartitionType() {
+ return JSP_BUNDLE_PARTITION;
+ }
/**
* @see com.ibm.sse.editor.hyperlink.AbstractHyperlinkPartitioner#parse(org.eclipse.jface.text.IDocument, com.ibm.sse.editor.extensions.hyperlink.IHyperlinkRegion)
@@ -55,7 +59,7 @@
String axis = getAxis(document, superRegion);
String contentType = superRegion.getContentType();
- String type = JSP_BUNDLE_PARTITION;
+ String type = getPartitionType();
int length = r.getLength() - (superRegion.getOffset() - r.getOffset());
int offset = superRegion.getOffset();
@@ -178,46 +182,52 @@
}
- if (sVar != null && sProp != null) return true;
+ if (sVar == null || sProp == null) return false;
- TaglibManagerWrapper tmw = new TaglibManagerWrapper();
- tmw.init(document, region.getOffset());
- if(!tmw.exists()) return false;
-
- String prefix = tmw.getCorePrefix();
-
- if (prefix == null) return false;
-
- // Find loadBundle tag
- List<Element> lbTags = new ArrayList<Element>();
- NodeList list = xmlDocument.getElementsByTagName(prefix + ":loadBundle");
- for (int i = 0; list != null && i < list.getLength(); i++) {
- Element el = (Element)list.item(i);
- int end = Utils.getValueEnd(el);
- if (end >= 0 && end < region.getOffset()) {
- lbTags.add(el);
- }
- }
+ String[] prefixes = getLoadBundleTagPrefixes(document, region.getOffset());
+ if (prefixes == null) return false;
- Element lbTag = null;
- for (int i = 0; i < lbTags.size(); i++) {
- Element el = lbTags.get(i);
- Attr var = el.getAttributeNode("var");
-
- if (bundleProp.startsWith(var.getValue())) {
- lbTag = el;
- break;
+ for (String prefix : prefixes) {
+ // Find loadBundle tag
+ List<Element> lbTags = new ArrayList<Element>();
+ NodeList list = xmlDocument.getElementsByTagName(prefix + ":loadBundle");
+ for (int i = 0; list != null && i < list.getLength(); i++) {
+ Element el = (Element)list.item(i);
+ int end = Utils.getValueEnd(el);
+ if (end >= 0 && end < region.getOffset()) {
+ lbTags.add(el);
+ }
}
+
+ Element lbTag = null;
+ for (int i = 0; i < lbTags.size(); i++) {
+ Element el = lbTags.get(i);
+ Attr var = el.getAttributeNode("var");
+
+ if (sVar.equals(var.getValue())) {
+ lbTag = el;
+ break;
+ }
+ }
+ if (lbTag != null) return true;
}
- if (lbTag == null) return false;
-
- return true;
+ return false;
} catch (BadLocationException x) {
JSFExtensionsPlugin.log("", x);
return false;
+ } catch (Exception x) {
+ JSFExtensionsPlugin.log("", x);
+ return false;
} finally {
smw.dispose();
}
}
+ protected String[] getLoadBundleTagPrefixes(IDocument document, int offset) {
+ TaglibManagerWrapper tmw = new TaglibManagerWrapper();
+ tmw.init(document, offset);
+ if(!tmw.exists()) return null;
+
+ return new String[] {tmw.getCorePrefix()};
+ }
}
\ No newline at end of file
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPExprHyperlinkPartitioner.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPExprHyperlinkPartitioner.java 2009-04-14 17:15:42 UTC (rev 14742)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPExprHyperlinkPartitioner.java 2009-04-14 18:25:10 UTC (rev 14743)
@@ -46,8 +46,7 @@
if (xmlDocument == null) return null;
Utils.findNodeForOffset(xmlDocument, superRegion.getOffset());
- if (!recognize(document, superRegion)) return null;
-
+
IHyperlinkRegion r = getRegion(document, superRegion.getOffset());
if (r == null) return null;
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPLoadBundleHyperlinkPartitioner.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPLoadBundleHyperlinkPartitioner.java 2009-04-14 17:15:42 UTC (rev 14742)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPLoadBundleHyperlinkPartitioner.java 2009-04-14 18:25:10 UTC (rev 14743)
@@ -32,6 +32,10 @@
*/
public class JSPLoadBundleHyperlinkPartitioner extends AbstractHyperlinkPartitioner implements IHyperlinkPartitionRecognizer {
public static final String JSP_LOADBUNDLE_PARTITION = "org.jboss.tools.common.text.ext.jsp.JSP_LOADBUNDLE";
+
+ protected String getPartitionType() {
+ return JSP_LOADBUNDLE_PARTITION;
+ }
/**
* @see com.ibm.sse.editor.hyperlink.AbstractHyperlinkPartitioner#parse(org.eclipse.jface.text.IDocument, com.ibm.sse.editor.extensions.hyperlink.IHyperlinkRegion)
@@ -51,7 +55,7 @@
String axis = getAxis(document, superRegion);
String contentType = superRegion.getContentType();
- String type = JSP_LOADBUNDLE_PARTITION;
+ String type = getPartitionType();
int length = r.getLength() - (superRegion.getOffset() - r.getOffset());
int offset = superRegion.getOffset();
@@ -147,15 +151,22 @@
String name = lbTag.getTagName();
int column = name.indexOf(":");
if (column == -1) return false;
- String prefix = name.substring(0, column);
- if (prefix == null || prefix.trim().length() == 0) return false;
+ String usedPrefix = name.substring(0, column);
+ if (usedPrefix == null || usedPrefix.trim().length() == 0) return false;
- TaglibManagerWrapper tmw = new TaglibManagerWrapper();
- tmw.init(document, region.getOffset());
- if(!tmw.exists()) return true; //xhtml
-
- if (!prefix.equals(tmw.getCorePrefix())) return false;
+ String[] prefixes = getLoadBundleTagPrefixes(document, region.getOffset());
+ if (prefixes == null) return true; //xhtml
+ boolean prefixIsAbleToBeUsed = false;
+ for (String prefix : prefixes) {
+ if (usedPrefix.equals(prefix)) {
+ prefixIsAbleToBeUsed = true;
+ break;
+ }
+ }
+ if (!prefixIsAbleToBeUsed)
+ return false;
+
Attr lbTagVar = lbTag.getAttributeNode("var");
Attr lbTagBasename = lbTag.getAttributeNode("basename");
@@ -170,4 +181,12 @@
}
}
+ protected String[] getLoadBundleTagPrefixes(IDocument document, int offset) {
+ TaglibManagerWrapper tmw = new TaglibManagerWrapper();
+ tmw.init(document, offset);
+ if(!tmw.exists()) return null;
+
+ return new String[] {tmw.getCorePrefix()};
+ }
+
}
\ No newline at end of file
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/LoadBundleHyperlink.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/LoadBundleHyperlink.java 2009-04-14 17:15:42 UTC (rev 14742)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/LoadBundleHyperlink.java 2009-04-14 18:25:10 UTC (rev 14743)
@@ -11,15 +11,21 @@
package org.jboss.tools.jsf.text.ext.hyperlink;
import java.text.MessageFormat;
+import java.util.ArrayList;
import java.util.Properties;
import org.eclipse.jface.text.IRegion;
+import org.eclipse.ui.IEditorPart;
import org.jboss.tools.common.text.ext.hyperlink.XModelBasedHyperlink;
import org.jboss.tools.common.text.ext.hyperlink.xpl.Messages;
import org.jboss.tools.common.text.ext.util.StructuredModelWrapper;
import org.jboss.tools.common.text.ext.util.TaglibManagerWrapper;
import org.jboss.tools.common.text.ext.util.Utils;
+import org.jboss.tools.jsf.text.ext.JSFExtensionsPlugin;
import org.jboss.tools.jst.web.project.list.WebPromptingProvider;
+import org.jboss.tools.jst.web.tld.TaglibData;
+import org.jboss.tools.jst.web.tld.VpeTaglibManager;
+import org.jboss.tools.jst.web.tld.VpeTaglibManagerProvider;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -81,39 +87,35 @@
StructuredModelWrapper smw = new StructuredModelWrapper();
try {
- TaglibManagerWrapper tmw = new TaglibManagerWrapper();
- tmw.init(getDocument(), region.getOffset());
-
- if (!tmw.exists()) return null;
- String prefix = tmw.getCorePrefix();
- if (prefix == null || prefix.length() == 0) return null;
-
- String nodeToFind = prefix + PREFIX_SEPARATOR + VIEW_TAGNAME;
-
smw.init(getDocument());
Document xmlDocument = smw.getDocument();
if (xmlDocument == null) return null;
+ String[] prefixes = getLoadBundleTagPrefixes(region);
+ if(prefixes == null) return null;
+
Node n = Utils.findNodeForOffset(xmlDocument, region.getOffset());
if (!(n instanceof Attr) ) return null;
Element el = ((Attr)n).getOwnerElement();
Element jsfCoreViewTag = null;
- while (el != null) {
- if (nodeToFind.equals(el.getNodeName())) {
- jsfCoreViewTag = el;
- break;
+ for (String prefix : prefixes) {
+ String nodeToFind = prefix + PREFIX_SEPARATOR + VIEW_TAGNAME;
+
+ while (el != null) {
+ if (nodeToFind.equals(el.getNodeName())) {
+ jsfCoreViewTag = el;
+ break;
+ }
+ Node parent = el.getParentNode();
+ el = (parent instanceof Element ? (Element)parent : null);
}
- if(!(el.getParentNode() instanceof Element)) {
- break;
- }
- el = (Element)el.getParentNode();
}
if (jsfCoreViewTag == null || !jsfCoreViewTag.hasAttribute(LOCALE_ATTRNAME)) return null;
- String locale = Utils.trimQuotes(((Attr)jsfCoreViewTag.getAttributeNode(LOCALE_ATTRNAME)).getValue());
+ String locale = Utils.trimQuotes((jsfCoreViewTag.getAttributeNode(LOCALE_ATTRNAME)).getValue());
if (locale == null || locale.length() == 0) return null;
return locale;
} finally {
@@ -134,4 +136,30 @@
return MessageFormat.format(Messages.OpenBundle, baseName);
}
+ protected String[] getLoadBundleTagPrefixes(IRegion region) {
+ TaglibManagerWrapper tmw = new TaglibManagerWrapper();
+ tmw.init(getDocument(), region.getOffset());
+ if(tmw.exists()) {
+ return new String[] { tmw.getCorePrefix() };
+ } else {
+ VpeTaglibManager taglibManager = getTaglibManager();
+ if(taglibManager == null) return null;
+ TaglibData[] data = (TaglibData[])taglibManager.getTagLibs().toArray(new TaglibData[0]);
+ ArrayList<String> prefixes = new ArrayList<String>();
+ for (int i = 0; i < data.length; i++) {
+ if("http://java.sun.com/jsf/core".equals(data[i].getUri()))
+ prefixes.add(data[i].getPrefix());
+ }
+ }
+ return null;
+ }
+
+ private VpeTaglibManager getTaglibManager() {
+ IEditorPart editor = JSFExtensionsPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+ if(editor instanceof VpeTaglibManagerProvider) {
+ return ((VpeTaglibManagerProvider)editor).getTaglibManager();
+ }
+ return null;
+ }
+
}
15 years, 8 months
JBoss Tools SVN: r14742 - branches/jbosstools-3.0.x/jst/plugins/org.jboss.tools.jst.jsp.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2009-04-14 13:15:42 -0400 (Tue, 14 Apr 2009)
New Revision: 14742
Modified:
branches/jbosstools-3.0.x/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml
Log:
corrected some errors which appeared after fix of JBIDE-4008
Modified: branches/jbosstools-3.0.x/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml
===================================================================
--- branches/jbosstools-3.0.x/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml 2009-04-14 16:57:11 UTC (rev 14741)
+++ branches/jbosstools-3.0.x/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml 2009-04-14 17:15:42 UTC (rev 14742)
@@ -155,102 +155,6 @@
</editorContribution>
<editorContribution
- id="AStructureSelectNext"
- targetID="org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor">
- <action
- actionID="org.eclipse.wst.sse.ui.structure.select.next"
- class="org.eclipse.wst.xml.ui.internal.selection.StructuredSelectNextXMLActionDelegate"
- definitionId="org.eclipse.wst.sse.ui.structure.select.next"
- id="StructureSelectNext"
- label="Next Element">
- </action>
- </editorContribution>
- <editorContribution
- id="ACleanupDocument"
- targetID="org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor">
- <action
- actionID="org.eclipse.wst.sse.ui.cleanup.document"
- class="org.eclipse.wst.html.ui.internal.edit.ui.CleanupActionHTMLDelegate"
- definitionId="org.eclipse.wst.sse.ui.cleanup.document"
- id="CleanupDocument"
- label="Cleanup Document...">
- </action>
- </editorContribution>
- <editorContribution
- id="AToggleComment"
- targetID="org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor">
- <action
- actionID="org.eclipse.wst.sse.ui.toggle.comment"
- class="org.eclipse.wst.xml.ui.internal.actions.ToggleCommentActionXMLDelegate"
- definitionId="org.eclipse.wst.sse.ui.toggle.comment"
- id="ToggleComment"
- menubarPath="sourceMenuId/sourceBegin"
- label="Toggle Comment">
- </action>
- </editorContribution>
- <editorContribution
- id="AAddBlockComment"
- targetID="org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor">
- <action
- actionID="org.eclipse.wst.sse.ui.add.block.comment"
- class="org.eclipse.wst.xml.ui.internal.actions.AddBlockCommentActionXMLDelegate"
- definitionId="org.eclipse.wst.sse.ui.add.block.comment"
- id="AddBlockComment"
- menubarPath="sourceMenuId/sourceBegin"
- label="Add Block Comment">
- </action>
- </editorContribution>
- <editorContribution
- id="ARemoveBlockComment"
- targetID="org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor">
- <action
- actionID="org.eclipse.wst.sse.ui.remove.block.comment"
- class="org.eclipse.wst.xml.ui.internal.actions.RemoveBlockCommentActionXMLDelegate"
- definitionId="org.eclipse.wst.sse.ui.remove.block.comment"
- id="RemoveBlockComment"
- menubarPath="sourceMenuId/sourceBegin"
- label="Remove Block Comment">
- </action>
- </editorContribution>
-
- <editorContribution
- id="HTMLToggleComment"
- targetID="org.jboss.tools.jst.jsp.jspeditor.HTMLTextEditor">
- <action
- actionID="org.eclipse.wst.sse.ui.toggle.comment"
- class="org.eclipse.wst.xml.ui.internal.actions.ToggleCommentActionXMLDelegate"
- definitionId="org.eclipse.wst.sse.ui.toggle.comment"
- id="ToggleComment"
- menubarPath="sourceMenuId/sourceBegin"
- label="Toggle Comment">
- </action>
- </editorContribution>
- <editorContribution
- id="HTMLAddBlockComment"
- targetID="org.jboss.tools.jst.jsp.jspeditor.HTMLTextEditor">
- <action
- actionID="org.eclipse.wst.sse.ui.add.block.comment"
- class="org.eclipse.wst.xml.ui.internal.actions.AddBlockCommentActionXMLDelegate"
- definitionId="org.eclipse.wst.sse.ui.add.block.comment"
- id="AddBlockComment"
- menubarPath="sourceMenuId/sourceBegin"
- label="Add Block Comment">
- </action>
- </editorContribution>
- <editorContribution
- id="HTMLRemoveBlockComment"
- targetID="org.jboss.tools.jst.jsp.jspeditor.HTMLTextEditor">
- <action
- actionID="org.eclipse.wst.sse.ui.remove.block.comment"
- class="org.eclipse.wst.xml.ui.internal.actions.RemoveBlockCommentActionXMLDelegate"
- definitionId="org.eclipse.wst.sse.ui.remove.block.comment"
- id="RemoveBlockComment"
- menubarPath="sourceMenuId/sourceBegin"
- label="Remove Block Comment">
- </action>
- </editorContribution>
-
- <editorContribution
id="ARenameElement"
targetID="org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor">
<action
@@ -271,50 +175,6 @@
id="MoveElement"
label="Move">
</action>
- </editorContribution>
- <editorContribution
- id="AFindOccurrences"
- targetID="org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor">
- <action
- actionID="org.eclipse.wst.sse.ui.search.find.occurrences"
- class="org.eclipse.jst.jsp.ui.internal.java.search.JSPFindOccurrencesActionDelegate"
- definitionId="org.eclipse.wst.sse.ui.search.find.occurrences"
- id="FindOccurrences"
- label="Occurrences in File">
- </action>
- </editorContribution>
- <editorContribution
- id="AStructureSelectEnclosing"
- targetID="org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor">
- <action
- actionID="org.eclipse.wst.sse.ui.structure.select.enclosing"
- class="org.eclipse.wst.xml.ui.internal.selection.StructuredSelectEnclosingXMLActionDelegate"
- definitionId="org.eclipse.wst.sse.ui.structure.select.enclosing"
- id="StructureSelectEnclosing"
- label="Enclosing Element">
- </action>
- </editorContribution>
- <editorContribution
- id="AStructureSelectPrevious"
- targetID="org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor">
- <action
- actionID="org.eclipse.wst.sse.ui.structure.select.previous"
- class="org.eclipse.wst.xml.ui.internal.selection.StructuredSelectPreviousXMLActionDelegate"
- definitionId="org.eclipse.wst.sse.ui.structure.select.previous"
- id="StructureSelectPrevious"
- label="Previous Element">
- </action>
- </editorContribution>
- <editorContribution
- id="AStructureSelectHistory"
- targetID="org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor">
- <action
- actionID="org.eclipse.wst.sse.ui.structure.select.last"
- class="org.eclipse.wst.sse.ui.internal.selection.StructuredSelectHistoryActionDelegate"
- definitionId="org.eclipse.wst.sse.ui.structure.select.last"
- id="StructureSelectHistory"
- label="Restore Last Selection">
- </action>
</editorContribution>-->
<editorContribution
id="org.jboss.tools.jst.jsp.cssClassDialogEditorContribution"
@@ -353,7 +213,7 @@
mnemonic="%command.toggle.comment.mnemonic"
style="push">
<visibleWhen checkEnabled="false">
- <reference definitionId="org.jboss.tools.ui.sourceMenu"/>
+ <reference definitionId="org.jboss.tools.ui.structuredEditor"/>
</visibleWhen>
</command>
<command commandId="org.eclipse.wst.sse.ui.add.block.comment"
@@ -361,7 +221,7 @@
mnemonic="%command.add.block.comment.mnemonic"
style="push">
<visibleWhen checkEnabled="false">
- <reference definitionId="org.jboss.tools.ui.sourceMenu"/>
+ <reference definitionId="org.jboss.tools.ui.structuredEditor"/>
</visibleWhen>
</command>
<command commandId="org.eclipse.wst.sse.ui.remove.block.comment"
@@ -369,7 +229,7 @@
mnemonic="%command.remove.block.comment.mnemonic"
style="push">
<visibleWhen checkEnabled="false">
- <reference definitionId="org.jboss.tools.ui.sourceMenu"/>
+ <reference definitionId="org.jboss.tools.ui.structuredEditor"/>
</visibleWhen>
</command>
</menuContribution>
@@ -381,56 +241,96 @@
class="org.eclipse.wst.xml.ui.internal.handlers.ToggleCommentHandler"
commandId="org.eclipse.wst.sse.ui.toggle.comment">
<activeWhen>
- <reference definitionId="org.jboss.tools.ui.sourceMenu"/>
+ <reference definitionId="org.jboss.tools.ui.structuredEditor"/>
</activeWhen>
<enabledWhen>
- <reference definitionId="org.jboss.tools.ui.sourceMenu"/>
+ <reference definitionId="org.jboss.tools.ui.structuredEditor"/>
</enabledWhen>
</handler>
<handler
class="org.eclipse.wst.xml.ui.internal.handlers.AddBlockCommentHandler"
commandId="org.eclipse.wst.sse.ui.add.block.comment">
<activeWhen>
- <reference definitionId="org.jboss.tools.ui.sourceMenu"/>
+ <reference definitionId="org.jboss.tools.ui.structuredEditor"/>
</activeWhen>
<enabledWhen>
- <reference definitionId="org.jboss.tools.ui.sourceMenu"/>
+ <reference definitionId="org.jboss.tools.ui.structuredEditor"/>
</enabledWhen>
</handler>
<handler
class="org.eclipse.wst.xml.ui.internal.handlers.RemoveBlockCommentHandler"
commandId="org.eclipse.wst.sse.ui.remove.block.comment">
<activeWhen>
- <reference definitionId="org.jboss.tools.ui.sourceMenu"/>
+ <reference definitionId="org.jboss.tools.ui.structuredEditor"/>
</activeWhen>
<enabledWhen>
- <reference definitionId="org.jboss.tools.ui.sourceMenu"/>
+ <reference definitionId="org.jboss.tools.ui.structuredEditor"/>
</enabledWhen>
</handler>
<handler
class="org.eclipse.jst.jsp.ui.internal.handlers.JSPFindOccurrencesHandler"
commandId="org.eclipse.wst.sse.ui.search.find.occurrences">
<activeWhen>
- <reference definitionId="org.jboss.tools.ui.sourceMenu"/>
+ <reference definitionId="org.jboss.tools.ui.structuredEditor"/>
</activeWhen>
<enabledWhen>
- <reference definitionId="org.jboss.tools.ui.sourceMenu"/>
+ <reference definitionId="org.jboss.tools.ui.structuredEditor"/>
</enabledWhen>
</handler>
<handler
class="org.eclipse.wst.html.ui.internal.edit.ui.CleanupDocumentHandler"
commandId="org.eclipse.wst.sse.ui.cleanup.document">
<activeWhen>
- <reference definitionId="org.jboss.tools.ui.sourceMenu"/>
+ <reference definitionId="org.jboss.tools.ui.structuredEditor"/>
</activeWhen>
<enabledWhen>
- <reference definitionId="org.jboss.tools.ui.sourceMenu"/>
+ <reference definitionId="org.jboss.tools.ui.structuredEditor"/>
</enabledWhen>
</handler>
+ <handler
+ class="org.eclipse.wst.xml.ui.internal.handlers.StructuredSelectEnclosingXMLHandler"
+ commandId="org.eclipse.wst.sse.ui.structure.select.enclosing">
+ <activeWhen>
+ <reference definitionId="org.jboss.tools.ui.structuredEditor"/>
+ </activeWhen>
+ <enabledWhen>
+ <reference definitionId="org.jboss.tools.ui.structuredEditor"/>
+ </enabledWhen>
+ </handler>
+ <handler
+ class="org.eclipse.wst.xml.ui.internal.handlers.StructuredSelectNextXMLHandler"
+ commandId="org.eclipse.wst.sse.ui.structure.select.next">
+ <activeWhen>
+ <reference definitionId="org.jboss.tools.ui.structuredEditor"/>
+ </activeWhen>
+ <enabledWhen>
+ <reference definitionId="org.jboss.tools.ui.structuredEditor"/>
+ </enabledWhen>
+ </handler>
+ <handler
+ class="org.eclipse.wst.xml.ui.internal.handlers.StructuredSelectPreviousXMLHandler"
+ commandId="org.eclipse.wst.sse.ui.structure.select.previous">
+ <activeWhen>
+ <reference definitionId="org.jboss.tools.ui.structuredEditor"/>
+ </activeWhen>
+ <enabledWhen>
+ <reference definitionId="org.jboss.tools.ui.structuredEditor"/>
+ </enabledWhen>
+ </handler>
+ <handler
+ class="org.eclipse.wst.sse.ui.internal.handlers.StructuredSelectHistoryHandler"
+ commandId="org.eclipse.wst.sse.ui.structure.select.last">
+ <activeWhen>
+ <reference definitionId="org.jboss.tools.ui.structuredEditor"/>
+ </activeWhen>
+ <enabledWhen>
+ <reference definitionId="org.jboss.tools.ui.structuredEditor"/>
+ </enabledWhen>
+ </handler>
</extension>
<extension point="org.eclipse.core.expressions.definitions">
- <definition id="org.jboss.tools.ui.sourceMenu">
+ <definition id="org.jboss.tools.ui.structuredEditor">
<and>
<with variable="activeContexts">
<iterate operator="or">
15 years, 8 months
JBoss Tools SVN: r14741 - in trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors: smooks and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2009-04-14 12:57:11 -0400 (Tue, 14 Apr 2009)
New Revision: 14741
Added:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/ConditionsTypeUICreator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/FeaturesTypeUICreator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/HandlerTypeUICreator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/HandlersTypeUICreator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/ParamsTypeUICreator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/ProfileTypeUICreator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/ProfilesTypeUICreator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/ReaderTypeUICreator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/SetOffTypeUICreator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/SetOnTypeUICreator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/SmooksResourceListTypeUICreator.java
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/Codegenerator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/PropertyUICreatorManager.java
Log:
JBIDE-4171
Develop new attribute UI for smooks-1.1 xsd
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/Codegenerator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/Codegenerator.java 2009-04-14 16:46:09 UTC (rev 14740)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/Codegenerator.java 2009-04-14 16:57:11 UTC (rev 14741)
@@ -14,16 +14,17 @@
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EPackage;
import org.jboss.tools.smooks.model.dbrouting.DbroutingPackage;
+import org.jboss.tools.smooks.model.smooks.SmooksPackage;
public class Codegenerator {
- String basePath = "/home/DartPeng/Work/eclipse/smooks-configuration-workspace/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/temp/";
+ String basePath = "F:\\works\\eclipse_wtp_3.0.3\\eclipse\\workspace_cr1\\org.jboss.tools.smooks.ui\\src\\org\\jboss\\tools\\smooks\\configuration\\editors\\uitls\\temp\\";
String tempContents = "";
public Codegenerator() {
try {
FileReader reader = new FileReader(
new File(
- "/home/DartPeng/Work/eclipse/smooks-configuration-workspace/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/Template.txt"));
+ "F:\\works\\eclipse_wtp_3.0.3\\eclipse\\workspace_cr1\\org.jboss.tools.smooks.ui\\src\\org\\jboss\\tools\\smooks\\configuration\\editors\\Template.txt"));
BufferedReader r = new BufferedReader(reader);
String line = r.readLine();
while (line != null) {
@@ -43,7 +44,7 @@
public static void main(String[] args) {
Codegenerator g = new Codegenerator();
try {
- g.generateCodes(DbroutingPackage.eINSTANCE);
+ g.generateCodes(SmooksPackage.eINSTANCE);
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/PropertyUICreatorManager.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/PropertyUICreatorManager.java 2009-04-14 16:46:09 UTC (rev 14740)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/PropertyUICreatorManager.java 2009-04-14 16:57:11 UTC (rev 14741)
@@ -47,10 +47,21 @@
import org.jboss.tools.smooks.configuration.editors.json.KeyMapUICreator;
import org.jboss.tools.smooks.configuration.editors.json.KeyUICreator;
import org.jboss.tools.smooks.configuration.editors.smooks.ConditionTypeUICreator;
+import org.jboss.tools.smooks.configuration.editors.smooks.ConditionsTypeUICreator;
+import org.jboss.tools.smooks.configuration.editors.smooks.FeaturesTypeUICreator;
+import org.jboss.tools.smooks.configuration.editors.smooks.HandlerTypeUICreator;
+import org.jboss.tools.smooks.configuration.editors.smooks.HandlersTypeUICreator;
import org.jboss.tools.smooks.configuration.editors.smooks.ImportTypeUICreator;
import org.jboss.tools.smooks.configuration.editors.smooks.ParamTypeUICreator;
+import org.jboss.tools.smooks.configuration.editors.smooks.ParamsTypeUICreator;
+import org.jboss.tools.smooks.configuration.editors.smooks.ProfileTypeUICreator;
+import org.jboss.tools.smooks.configuration.editors.smooks.ProfilesTypeUICreator;
+import org.jboss.tools.smooks.configuration.editors.smooks.ReaderTypeUICreator;
import org.jboss.tools.smooks.configuration.editors.smooks.ResourceConfigTypeUICreator;
import org.jboss.tools.smooks.configuration.editors.smooks.ResourceTypeUICreator;
+import org.jboss.tools.smooks.configuration.editors.smooks.SetOffTypeUICreator;
+import org.jboss.tools.smooks.configuration.editors.smooks.SetOnTypeUICreator;
+import org.jboss.tools.smooks.configuration.editors.smooks.SmooksResourceListTypeUICreator;
import org.jboss.tools.smooks.configuration.editors.xsl.BindToUICreator;
import org.jboss.tools.smooks.configuration.editors.xsl.OutputToUICreator;
import org.jboss.tools.smooks.configuration.editors.xsl.TemplateUICreator;
@@ -89,10 +100,21 @@
import org.jboss.tools.smooks.model.medi.impl.SegmentsImpl;
import org.jboss.tools.smooks.model.medi.impl.SubComponentImpl;
import org.jboss.tools.smooks.model.smooks.impl.ConditionTypeImpl;
+import org.jboss.tools.smooks.model.smooks.impl.ConditionsTypeImpl;
+import org.jboss.tools.smooks.model.smooks.impl.FeaturesTypeImpl;
+import org.jboss.tools.smooks.model.smooks.impl.HandlerTypeImpl;
+import org.jboss.tools.smooks.model.smooks.impl.HandlersTypeImpl;
import org.jboss.tools.smooks.model.smooks.impl.ImportTypeImpl;
import org.jboss.tools.smooks.model.smooks.impl.ParamTypeImpl;
+import org.jboss.tools.smooks.model.smooks.impl.ParamsTypeImpl;
+import org.jboss.tools.smooks.model.smooks.impl.ProfileTypeImpl;
+import org.jboss.tools.smooks.model.smooks.impl.ProfilesTypeImpl;
+import org.jboss.tools.smooks.model.smooks.impl.ReaderTypeImpl;
import org.jboss.tools.smooks.model.smooks.impl.ResourceConfigTypeImpl;
import org.jboss.tools.smooks.model.smooks.impl.ResourceTypeImpl;
+import org.jboss.tools.smooks.model.smooks.impl.SetOffTypeImpl;
+import org.jboss.tools.smooks.model.smooks.impl.SetOnTypeImpl;
+import org.jboss.tools.smooks.model.smooks.impl.SmooksResourceListTypeImpl;
import org.jboss.tools.smooks.model.xsl.impl.BindToImpl;
import org.jboss.tools.smooks.model.xsl.impl.OutputToImpl;
import org.jboss.tools.smooks.model.xsl.impl.TemplateImpl;
@@ -128,7 +150,19 @@
map.put(ParamTypeImpl.class, new ParamTypeUICreator());
map.put(ResourceConfigTypeImpl.class, new ResourceConfigTypeUICreator());
map.put(ResourceTypeImpl.class, new ResourceTypeUICreator());
+ map.put(ConditionsTypeImpl.class, new ConditionsTypeUICreator());
+ map.put(FeaturesTypeImpl.class, new FeaturesTypeUICreator());
+ map.put(HandlersTypeImpl.class, new HandlersTypeUICreator());
+ map.put(HandlerTypeImpl.class, new HandlerTypeUICreator());
+ map.put(ParamsTypeImpl.class, new ParamsTypeUICreator());
+ map.put(ProfilesTypeImpl.class, new ProfilesTypeUICreator());
+ map.put(ProfileTypeImpl.class, new ProfileTypeUICreator());
+ map.put(ReaderTypeImpl.class, new ReaderTypeUICreator());
+ map.put(SetOffTypeImpl.class, new SetOffTypeUICreator());
+ map.put(SetOnTypeImpl.class, new SetOnTypeUICreator());
+ map.put(SmooksResourceListTypeImpl.class, new SmooksResourceListTypeUICreator());
+
// for xsl models
map.put(BindToImpl.class, new BindToUICreator());
map.put(OutputToImpl.class, new OutputToUICreator());
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/ConditionsTypeUICreator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/ConditionsTypeUICreator.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/ConditionsTypeUICreator.java 2009-04-14 16:57:11 UTC (rev 14741)
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.configuration.editors.smooks;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.jboss.tools.smooks.configuration.editors.PropertyUICreator;
+import org.jboss.tools.smooks.configuration.editors.SmooksMultiFormEditor;
+
+/**
+ * @author Dart Peng (dpeng(a)redhat.com) Date Apr 10, 2009
+ */
+public class ConditionsTypeUICreator extends PropertyUICreator {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @seeorg.jboss.tools.smooks.configuration.editors.IPropertyUICreator#
+ * createPropertyUI(org.eclipse.ui.forms.widgets.FormToolkit,
+ * org.eclipse.swt.widgets.Composite,
+ * org.eclipse.emf.edit.provider.IItemPropertyDescriptor, java.lang.Object,
+ * org.eclipse.emf.ecore.EAttribute)
+ */
+ public Composite createPropertyUI(FormToolkit toolkit, Composite parent,
+ IItemPropertyDescriptor propertyDescriptor, Object model, EAttribute feature,
+ SmooksMultiFormEditor formEditor) {
+ return super.createPropertyUI(toolkit, parent, propertyDescriptor, model, feature, formEditor);
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/ConditionsTypeUICreator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/FeaturesTypeUICreator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/FeaturesTypeUICreator.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/FeaturesTypeUICreator.java 2009-04-14 16:57:11 UTC (rev 14741)
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.configuration.editors.smooks;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.jboss.tools.smooks.configuration.editors.PropertyUICreator;
+import org.jboss.tools.smooks.configuration.editors.SmooksMultiFormEditor;
+
+/**
+ * @author Dart Peng (dpeng(a)redhat.com) Date Apr 10, 2009
+ */
+public class FeaturesTypeUICreator extends PropertyUICreator {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @seeorg.jboss.tools.smooks.configuration.editors.IPropertyUICreator#
+ * createPropertyUI(org.eclipse.ui.forms.widgets.FormToolkit,
+ * org.eclipse.swt.widgets.Composite,
+ * org.eclipse.emf.edit.provider.IItemPropertyDescriptor, java.lang.Object,
+ * org.eclipse.emf.ecore.EAttribute)
+ */
+ public Composite createPropertyUI(FormToolkit toolkit, Composite parent,
+ IItemPropertyDescriptor propertyDescriptor, Object model, EAttribute feature,
+ SmooksMultiFormEditor formEditor) {
+
+ return super.createPropertyUI(toolkit, parent, propertyDescriptor, model, feature, formEditor);
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/FeaturesTypeUICreator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/HandlerTypeUICreator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/HandlerTypeUICreator.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/HandlerTypeUICreator.java 2009-04-14 16:57:11 UTC (rev 14741)
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.configuration.editors.smooks;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.jboss.tools.smooks.configuration.editors.PropertyUICreator;
+import org.jboss.tools.smooks.configuration.editors.SmooksMultiFormEditor;
+import org.jboss.tools.smooks.model.smooks.SmooksPackage;
+
+/**
+ * @author Dart Peng (dpeng(a)redhat.com) Date Apr 10, 2009
+ */
+public class HandlerTypeUICreator extends PropertyUICreator {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @seeorg.jboss.tools.smooks.configuration.editors.IPropertyUICreator#
+ * createPropertyUI(org.eclipse.ui.forms.widgets.FormToolkit,
+ * org.eclipse.swt.widgets.Composite,
+ * org.eclipse.emf.edit.provider.IItemPropertyDescriptor, java.lang.Object,
+ * org.eclipse.emf.ecore.EAttribute)
+ */
+ public Composite createPropertyUI(FormToolkit toolkit, Composite parent,
+ IItemPropertyDescriptor propertyDescriptor, Object model, EAttribute feature,
+ SmooksMultiFormEditor formEditor) {
+ return super.createPropertyUI(toolkit, parent, propertyDescriptor, model, feature, formEditor);
+ }
+
+ @Override
+ public boolean isJavaTypeFeature(EAttribute attribute) {
+ if (attribute == SmooksPackage.eINSTANCE.getHandlerType_Class()) {
+ return true;
+ }
+ return super.isJavaTypeFeature(attribute);
+ }
+
+
+
+}
\ No newline at end of file
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/HandlerTypeUICreator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/HandlersTypeUICreator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/HandlersTypeUICreator.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/HandlersTypeUICreator.java 2009-04-14 16:57:11 UTC (rev 14741)
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.configuration.editors.smooks;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.jboss.tools.smooks.configuration.editors.PropertyUICreator;
+import org.jboss.tools.smooks.configuration.editors.SmooksMultiFormEditor;
+
+/**
+ * @author Dart Peng (dpeng(a)redhat.com) Date Apr 10, 2009
+ */
+public class HandlersTypeUICreator extends PropertyUICreator {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @seeorg.jboss.tools.smooks.configuration.editors.IPropertyUICreator#
+ * createPropertyUI(org.eclipse.ui.forms.widgets.FormToolkit,
+ * org.eclipse.swt.widgets.Composite,
+ * org.eclipse.emf.edit.provider.IItemPropertyDescriptor, java.lang.Object,
+ * org.eclipse.emf.ecore.EAttribute)
+ */
+ public Composite createPropertyUI(FormToolkit toolkit, Composite parent,
+ IItemPropertyDescriptor propertyDescriptor, Object model, EAttribute feature,
+ SmooksMultiFormEditor formEditor) {
+
+ return super.createPropertyUI(toolkit, parent, propertyDescriptor, model, feature, formEditor);
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/HandlersTypeUICreator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/ParamsTypeUICreator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/ParamsTypeUICreator.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/ParamsTypeUICreator.java 2009-04-14 16:57:11 UTC (rev 14741)
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.configuration.editors.smooks;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.jboss.tools.smooks.configuration.editors.PropertyUICreator;
+import org.jboss.tools.smooks.configuration.editors.SmooksMultiFormEditor;
+
+/**
+ * @author Dart Peng (dpeng(a)redhat.com) Date Apr 10, 2009
+ */
+public class ParamsTypeUICreator extends PropertyUICreator {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @seeorg.jboss.tools.smooks.configuration.editors.IPropertyUICreator#
+ * createPropertyUI(org.eclipse.ui.forms.widgets.FormToolkit,
+ * org.eclipse.swt.widgets.Composite,
+ * org.eclipse.emf.edit.provider.IItemPropertyDescriptor, java.lang.Object,
+ * org.eclipse.emf.ecore.EAttribute)
+ */
+ public Composite createPropertyUI(FormToolkit toolkit, Composite parent,
+ IItemPropertyDescriptor propertyDescriptor, Object model, EAttribute feature ,SmooksMultiFormEditor formEditor) {
+
+ return super.createPropertyUI(toolkit, parent, propertyDescriptor, model, feature,
+ formEditor);
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/ParamsTypeUICreator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/ProfileTypeUICreator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/ProfileTypeUICreator.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/ProfileTypeUICreator.java 2009-04-14 16:57:11 UTC (rev 14741)
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.configuration.editors.smooks;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.jboss.tools.smooks.configuration.editors.PropertyUICreator;
+import org.jboss.tools.smooks.configuration.editors.SmooksMultiFormEditor;
+import org.jboss.tools.smooks.model.smooks.SmooksPackage;
+
+/**
+ * @author Dart Peng (dpeng(a)redhat.com) Date Apr 10, 2009
+ */
+public class ProfileTypeUICreator extends PropertyUICreator {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @seeorg.jboss.tools.smooks.configuration.editors.IPropertyUICreator#
+ * createPropertyUI(org.eclipse.ui.forms.widgets.FormToolkit,
+ * org.eclipse.swt.widgets.Composite,
+ * org.eclipse.emf.edit.provider.IItemPropertyDescriptor, java.lang.Object,
+ * org.eclipse.emf.ecore.EAttribute)
+ */
+ public Composite createPropertyUI(FormToolkit toolkit, Composite parent,
+ IItemPropertyDescriptor propertyDescriptor, Object model, EAttribute feature,
+ SmooksMultiFormEditor formEditor) {
+ if (feature == SmooksPackage.eINSTANCE.getProfileType_Value()) {
+ }
+ if (feature == SmooksPackage.eINSTANCE.getProfileType_BaseProfile()) {
+ }
+ if (feature == SmooksPackage.eINSTANCE.getProfileType_SubProfiles()) {
+ }
+
+ return super.createPropertyUI(toolkit, parent, propertyDescriptor, model, feature, formEditor);
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/ProfileTypeUICreator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/ProfilesTypeUICreator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/ProfilesTypeUICreator.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/ProfilesTypeUICreator.java 2009-04-14 16:57:11 UTC (rev 14741)
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.configuration.editors.smooks;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.jboss.tools.smooks.configuration.editors.PropertyUICreator;
+import org.jboss.tools.smooks.configuration.editors.SmooksMultiFormEditor;
+
+/**
+ * @author Dart Peng (dpeng(a)redhat.com) Date Apr 10, 2009
+ */
+public class ProfilesTypeUICreator extends PropertyUICreator {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @seeorg.jboss.tools.smooks.configuration.editors.IPropertyUICreator#
+ * createPropertyUI(org.eclipse.ui.forms.widgets.FormToolkit,
+ * org.eclipse.swt.widgets.Composite,
+ * org.eclipse.emf.edit.provider.IItemPropertyDescriptor, java.lang.Object,
+ * org.eclipse.emf.ecore.EAttribute)
+ */
+ public Composite createPropertyUI(FormToolkit toolkit, Composite parent,
+ IItemPropertyDescriptor propertyDescriptor, Object model, EAttribute feature ,SmooksMultiFormEditor formEditor) {
+ return super.createPropertyUI(toolkit, parent, propertyDescriptor, model, feature,
+ formEditor);
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/ProfilesTypeUICreator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/ReaderTypeUICreator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/ReaderTypeUICreator.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/ReaderTypeUICreator.java 2009-04-14 16:57:11 UTC (rev 14741)
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.configuration.editors.smooks;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.jboss.tools.smooks.configuration.editors.PropertyUICreator;
+import org.jboss.tools.smooks.configuration.editors.SmooksMultiFormEditor;
+import org.jboss.tools.smooks.model.smooks.SmooksPackage;
+
+/**
+ * @author Dart Peng (dpeng(a)redhat.com) Date Apr 10, 2009
+ */
+public class ReaderTypeUICreator extends PropertyUICreator {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @seeorg.jboss.tools.smooks.configuration.editors.IPropertyUICreator#
+ * createPropertyUI(org.eclipse.ui.forms.widgets.FormToolkit,
+ * org.eclipse.swt.widgets.Composite,
+ * org.eclipse.emf.edit.provider.IItemPropertyDescriptor, java.lang.Object,
+ * org.eclipse.emf.ecore.EAttribute)
+ */
+ public Composite createPropertyUI(FormToolkit toolkit, Composite parent,
+ IItemPropertyDescriptor propertyDescriptor, Object model, EAttribute feature,
+ SmooksMultiFormEditor formEditor) {
+ return super.createPropertyUI(toolkit, parent, propertyDescriptor, model, feature, formEditor);
+ }
+
+ @Override
+ public boolean isJavaTypeFeature(EAttribute attribute) {
+ if (attribute == SmooksPackage.eINSTANCE.getReaderType_Class()) {
+ return true;
+ }
+ return super.isJavaTypeFeature(attribute);
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/ReaderTypeUICreator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/SetOffTypeUICreator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/SetOffTypeUICreator.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/SetOffTypeUICreator.java 2009-04-14 16:57:11 UTC (rev 14741)
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.configuration.editors.smooks;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.jboss.tools.smooks.configuration.editors.PropertyUICreator;
+import org.jboss.tools.smooks.configuration.editors.SmooksMultiFormEditor;
+import org.jboss.tools.smooks.model.smooks.SmooksPackage;
+
+/**
+ * @author Dart Peng (dpeng(a)redhat.com) Date Apr 10, 2009
+ */
+public class SetOffTypeUICreator extends PropertyUICreator {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @seeorg.jboss.tools.smooks.configuration.editors.IPropertyUICreator#
+ * createPropertyUI(org.eclipse.ui.forms.widgets.FormToolkit,
+ * org.eclipse.swt.widgets.Composite,
+ * org.eclipse.emf.edit.provider.IItemPropertyDescriptor, java.lang.Object,
+ * org.eclipse.emf.ecore.EAttribute)
+ */
+ public Composite createPropertyUI(FormToolkit toolkit, Composite parent,
+ IItemPropertyDescriptor propertyDescriptor, Object model, EAttribute feature,
+ SmooksMultiFormEditor formEditor) {
+
+ if (feature == SmooksPackage.eINSTANCE.getSetOffType_Feature()) {
+ }
+
+ return super.createPropertyUI(toolkit, parent, propertyDescriptor, model, feature, formEditor);
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/SetOffTypeUICreator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/SetOnTypeUICreator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/SetOnTypeUICreator.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/SetOnTypeUICreator.java 2009-04-14 16:57:11 UTC (rev 14741)
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.configuration.editors.smooks;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.jboss.tools.smooks.configuration.editors.PropertyUICreator;
+import org.jboss.tools.smooks.configuration.editors.SmooksMultiFormEditor;
+import org.jboss.tools.smooks.model.smooks.SmooksPackage;
+
+/**
+ * @author Dart Peng (dpeng(a)redhat.com) Date Apr 10, 2009
+ */
+public class SetOnTypeUICreator extends PropertyUICreator {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @seeorg.jboss.tools.smooks.configuration.editors.IPropertyUICreator#
+ * createPropertyUI(org.eclipse.ui.forms.widgets.FormToolkit,
+ * org.eclipse.swt.widgets.Composite,
+ * org.eclipse.emf.edit.provider.IItemPropertyDescriptor, java.lang.Object,
+ * org.eclipse.emf.ecore.EAttribute)
+ */
+ public Composite createPropertyUI(FormToolkit toolkit, Composite parent,
+ IItemPropertyDescriptor propertyDescriptor, Object model, EAttribute feature,
+ SmooksMultiFormEditor formEditor) {
+ if (feature == SmooksPackage.eINSTANCE.getSetOnType_Feature()) {
+ }
+
+ return super.createPropertyUI(toolkit, parent, propertyDescriptor, model, feature, formEditor);
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/SetOnTypeUICreator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/SmooksResourceListTypeUICreator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/SmooksResourceListTypeUICreator.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/SmooksResourceListTypeUICreator.java 2009-04-14 16:57:11 UTC (rev 14741)
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.configuration.editors.smooks;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.jboss.tools.smooks.configuration.editors.PropertyUICreator;
+import org.jboss.tools.smooks.configuration.editors.SmooksMultiFormEditor;
+import org.jboss.tools.smooks.model.smooks.SmooksPackage;
+
+/**
+ * @author Dart Peng (dpeng(a)redhat.com) Date Apr 10, 2009
+ */
+public class SmooksResourceListTypeUICreator extends PropertyUICreator {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @seeorg.jboss.tools.smooks.configuration.editors.IPropertyUICreator#
+ * createPropertyUI(org.eclipse.ui.forms.widgets.FormToolkit,
+ * org.eclipse.swt.widgets.Composite,
+ * org.eclipse.emf.edit.provider.IItemPropertyDescriptor, java.lang.Object,
+ * org.eclipse.emf.ecore.EAttribute)
+ */
+ public Composite createPropertyUI(FormToolkit toolkit, Composite parent,
+ IItemPropertyDescriptor propertyDescriptor, Object model, EAttribute feature,
+ SmooksMultiFormEditor formEditor) {
+ if (feature == SmooksPackage.eINSTANCE.getSmooksResourceListType_AbstractReaderGroup()) {
+ }
+ if (feature == SmooksPackage.eINSTANCE.getSmooksResourceListType_AbstractResourceConfigGroup()) {
+ }
+ if (feature == SmooksPackage.eINSTANCE.getSmooksResourceListType_DefaultConditionRef()) {
+ }
+ if (feature == SmooksPackage.eINSTANCE.getSmooksResourceListType_DefaultSelectorNamespace()) {
+ }
+ if (feature == SmooksPackage.eINSTANCE.getSmooksResourceListType_DefaultTargetProfile()) {
+ }
+
+ return super.createPropertyUI(toolkit, parent, propertyDescriptor, model, feature, formEditor);
+ }
+
+ @Override
+ public boolean isSelectorFeature(EAttribute attribute) {
+ if (attribute == SmooksPackage.eINSTANCE.getSmooksResourceListType_DefaultSelector()) {
+ return true;
+ }
+ return super.isSelectorFeature(attribute);
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/SmooksResourceListTypeUICreator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 8 months
JBoss Tools SVN: r14740 - trunk/jst/plugins/org.jboss.tools.jst.jsp.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2009-04-14 12:46:09 -0400 (Tue, 14 Apr 2009)
New Revision: 14740
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml
Log:
corrected some errors which appeared after fix of JBIDE-4008
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml 2009-04-14 16:07:31 UTC (rev 14739)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml 2009-04-14 16:46:09 UTC (rev 14740)
@@ -155,102 +155,6 @@
</editorContribution>
<editorContribution
- id="AStructureSelectNext"
- targetID="org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor">
- <action
- actionID="org.eclipse.wst.sse.ui.structure.select.next"
- class="org.eclipse.wst.xml.ui.internal.selection.StructuredSelectNextXMLActionDelegate"
- definitionId="org.eclipse.wst.sse.ui.structure.select.next"
- id="StructureSelectNext"
- label="Next Element">
- </action>
- </editorContribution>
- <editorContribution
- id="ACleanupDocument"
- targetID="org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor">
- <action
- actionID="org.eclipse.wst.sse.ui.cleanup.document"
- class="org.eclipse.wst.html.ui.internal.edit.ui.CleanupActionHTMLDelegate"
- definitionId="org.eclipse.wst.sse.ui.cleanup.document"
- id="CleanupDocument"
- label="Cleanup Document...">
- </action>
- </editorContribution>
- <editorContribution
- id="AToggleComment"
- targetID="org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor">
- <action
- actionID="org.eclipse.wst.sse.ui.toggle.comment"
- class="org.eclipse.wst.xml.ui.internal.actions.ToggleCommentActionXMLDelegate"
- definitionId="org.eclipse.wst.sse.ui.toggle.comment"
- id="ToggleComment"
- menubarPath="sourceMenuId/sourceBegin"
- label="Toggle Comment">
- </action>
- </editorContribution>
- <editorContribution
- id="AAddBlockComment"
- targetID="org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor">
- <action
- actionID="org.eclipse.wst.sse.ui.add.block.comment"
- class="org.eclipse.wst.xml.ui.internal.actions.AddBlockCommentActionXMLDelegate"
- definitionId="org.eclipse.wst.sse.ui.add.block.comment"
- id="AddBlockComment"
- menubarPath="sourceMenuId/sourceBegin"
- label="Add Block Comment">
- </action>
- </editorContribution>
- <editorContribution
- id="ARemoveBlockComment"
- targetID="org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor">
- <action
- actionID="org.eclipse.wst.sse.ui.remove.block.comment"
- class="org.eclipse.wst.xml.ui.internal.actions.RemoveBlockCommentActionXMLDelegate"
- definitionId="org.eclipse.wst.sse.ui.remove.block.comment"
- id="RemoveBlockComment"
- menubarPath="sourceMenuId/sourceBegin"
- label="Remove Block Comment">
- </action>
- </editorContribution>
-
- <editorContribution
- id="HTMLToggleComment"
- targetID="org.jboss.tools.jst.jsp.jspeditor.HTMLTextEditor">
- <action
- actionID="org.eclipse.wst.sse.ui.toggle.comment"
- class="org.eclipse.wst.xml.ui.internal.actions.ToggleCommentActionXMLDelegate"
- definitionId="org.eclipse.wst.sse.ui.toggle.comment"
- id="ToggleComment"
- menubarPath="sourceMenuId/sourceBegin"
- label="Toggle Comment">
- </action>
- </editorContribution>
- <editorContribution
- id="HTMLAddBlockComment"
- targetID="org.jboss.tools.jst.jsp.jspeditor.HTMLTextEditor">
- <action
- actionID="org.eclipse.wst.sse.ui.add.block.comment"
- class="org.eclipse.wst.xml.ui.internal.actions.AddBlockCommentActionXMLDelegate"
- definitionId="org.eclipse.wst.sse.ui.add.block.comment"
- id="AddBlockComment"
- menubarPath="sourceMenuId/sourceBegin"
- label="Add Block Comment">
- </action>
- </editorContribution>
- <editorContribution
- id="HTMLRemoveBlockComment"
- targetID="org.jboss.tools.jst.jsp.jspeditor.HTMLTextEditor">
- <action
- actionID="org.eclipse.wst.sse.ui.remove.block.comment"
- class="org.eclipse.wst.xml.ui.internal.actions.RemoveBlockCommentActionXMLDelegate"
- definitionId="org.eclipse.wst.sse.ui.remove.block.comment"
- id="RemoveBlockComment"
- menubarPath="sourceMenuId/sourceBegin"
- label="Remove Block Comment">
- </action>
- </editorContribution>
-
- <editorContribution
id="ARenameElement"
targetID="org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor">
<action
@@ -271,50 +175,6 @@
id="MoveElement"
label="Move">
</action>
- </editorContribution>
- <editorContribution
- id="AFindOccurrences"
- targetID="org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor">
- <action
- actionID="org.eclipse.wst.sse.ui.search.find.occurrences"
- class="org.eclipse.jst.jsp.ui.internal.java.search.JSPFindOccurrencesActionDelegate"
- definitionId="org.eclipse.wst.sse.ui.search.find.occurrences"
- id="FindOccurrences"
- label="Occurrences in File">
- </action>
- </editorContribution>
- <editorContribution
- id="AStructureSelectEnclosing"
- targetID="org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor">
- <action
- actionID="org.eclipse.wst.sse.ui.structure.select.enclosing"
- class="org.eclipse.wst.xml.ui.internal.selection.StructuredSelectEnclosingXMLActionDelegate"
- definitionId="org.eclipse.wst.sse.ui.structure.select.enclosing"
- id="StructureSelectEnclosing"
- label="Enclosing Element">
- </action>
- </editorContribution>
- <editorContribution
- id="AStructureSelectPrevious"
- targetID="org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor">
- <action
- actionID="org.eclipse.wst.sse.ui.structure.select.previous"
- class="org.eclipse.wst.xml.ui.internal.selection.StructuredSelectPreviousXMLActionDelegate"
- definitionId="org.eclipse.wst.sse.ui.structure.select.previous"
- id="StructureSelectPrevious"
- label="Previous Element">
- </action>
- </editorContribution>
- <editorContribution
- id="AStructureSelectHistory"
- targetID="org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor">
- <action
- actionID="org.eclipse.wst.sse.ui.structure.select.last"
- class="org.eclipse.wst.sse.ui.internal.selection.StructuredSelectHistoryActionDelegate"
- definitionId="org.eclipse.wst.sse.ui.structure.select.last"
- id="StructureSelectHistory"
- label="Restore Last Selection">
- </action>
</editorContribution>-->
<editorContribution
id="org.jboss.tools.jst.jsp.cssClassDialogEditorContribution"
@@ -353,7 +213,7 @@
mnemonic="%command.toggle.comment.mnemonic"
style="push">
<visibleWhen checkEnabled="false">
- <reference definitionId="org.jboss.tools.ui.sourceMenu"/>
+ <reference definitionId="org.jboss.tools.ui.structuredEditor"/>
</visibleWhen>
</command>
<command commandId="org.eclipse.wst.sse.ui.add.block.comment"
@@ -361,7 +221,7 @@
mnemonic="%command.add.block.comment.mnemonic"
style="push">
<visibleWhen checkEnabled="false">
- <reference definitionId="org.jboss.tools.ui.sourceMenu"/>
+ <reference definitionId="org.jboss.tools.ui.structuredEditor"/>
</visibleWhen>
</command>
<command commandId="org.eclipse.wst.sse.ui.remove.block.comment"
@@ -369,7 +229,7 @@
mnemonic="%command.remove.block.comment.mnemonic"
style="push">
<visibleWhen checkEnabled="false">
- <reference definitionId="org.jboss.tools.ui.sourceMenu"/>
+ <reference definitionId="org.jboss.tools.ui.structuredEditor"/>
</visibleWhen>
</command>
</menuContribution>
@@ -381,56 +241,96 @@
class="org.eclipse.wst.xml.ui.internal.handlers.ToggleCommentHandler"
commandId="org.eclipse.wst.sse.ui.toggle.comment">
<activeWhen>
- <reference definitionId="org.jboss.tools.ui.sourceMenu"/>
+ <reference definitionId="org.jboss.tools.ui.structuredEditor"/>
</activeWhen>
<enabledWhen>
- <reference definitionId="org.jboss.tools.ui.sourceMenu"/>
+ <reference definitionId="org.jboss.tools.ui.structuredEditor"/>
</enabledWhen>
</handler>
<handler
class="org.eclipse.wst.xml.ui.internal.handlers.AddBlockCommentHandler"
commandId="org.eclipse.wst.sse.ui.add.block.comment">
<activeWhen>
- <reference definitionId="org.jboss.tools.ui.sourceMenu"/>
+ <reference definitionId="org.jboss.tools.ui.structuredEditor"/>
</activeWhen>
<enabledWhen>
- <reference definitionId="org.jboss.tools.ui.sourceMenu"/>
+ <reference definitionId="org.jboss.tools.ui.structuredEditor"/>
</enabledWhen>
</handler>
<handler
class="org.eclipse.wst.xml.ui.internal.handlers.RemoveBlockCommentHandler"
commandId="org.eclipse.wst.sse.ui.remove.block.comment">
<activeWhen>
- <reference definitionId="org.jboss.tools.ui.sourceMenu"/>
+ <reference definitionId="org.jboss.tools.ui.structuredEditor"/>
</activeWhen>
<enabledWhen>
- <reference definitionId="org.jboss.tools.ui.sourceMenu"/>
+ <reference definitionId="org.jboss.tools.ui.structuredEditor"/>
</enabledWhen>
</handler>
<handler
class="org.eclipse.jst.jsp.ui.internal.handlers.JSPFindOccurrencesHandler"
commandId="org.eclipse.wst.sse.ui.search.find.occurrences">
<activeWhen>
- <reference definitionId="org.jboss.tools.ui.sourceMenu"/>
+ <reference definitionId="org.jboss.tools.ui.structuredEditor"/>
</activeWhen>
<enabledWhen>
- <reference definitionId="org.jboss.tools.ui.sourceMenu"/>
+ <reference definitionId="org.jboss.tools.ui.structuredEditor"/>
</enabledWhen>
</handler>
<handler
class="org.eclipse.wst.html.ui.internal.edit.ui.CleanupDocumentHandler"
commandId="org.eclipse.wst.sse.ui.cleanup.document">
<activeWhen>
- <reference definitionId="org.jboss.tools.ui.sourceMenu"/>
+ <reference definitionId="org.jboss.tools.ui.structuredEditor"/>
</activeWhen>
<enabledWhen>
- <reference definitionId="org.jboss.tools.ui.sourceMenu"/>
+ <reference definitionId="org.jboss.tools.ui.structuredEditor"/>
</enabledWhen>
</handler>
+ <handler
+ class="org.eclipse.wst.xml.ui.internal.handlers.StructuredSelectEnclosingXMLHandler"
+ commandId="org.eclipse.wst.sse.ui.structure.select.enclosing">
+ <activeWhen>
+ <reference definitionId="org.jboss.tools.ui.structuredEditor"/>
+ </activeWhen>
+ <enabledWhen>
+ <reference definitionId="org.jboss.tools.ui.structuredEditor"/>
+ </enabledWhen>
+ </handler>
+ <handler
+ class="org.eclipse.wst.xml.ui.internal.handlers.StructuredSelectNextXMLHandler"
+ commandId="org.eclipse.wst.sse.ui.structure.select.next">
+ <activeWhen>
+ <reference definitionId="org.jboss.tools.ui.structuredEditor"/>
+ </activeWhen>
+ <enabledWhen>
+ <reference definitionId="org.jboss.tools.ui.structuredEditor"/>
+ </enabledWhen>
+ </handler>
+ <handler
+ class="org.eclipse.wst.xml.ui.internal.handlers.StructuredSelectPreviousXMLHandler"
+ commandId="org.eclipse.wst.sse.ui.structure.select.previous">
+ <activeWhen>
+ <reference definitionId="org.jboss.tools.ui.structuredEditor"/>
+ </activeWhen>
+ <enabledWhen>
+ <reference definitionId="org.jboss.tools.ui.structuredEditor"/>
+ </enabledWhen>
+ </handler>
+ <handler
+ class="org.eclipse.wst.sse.ui.internal.handlers.StructuredSelectHistoryHandler"
+ commandId="org.eclipse.wst.sse.ui.structure.select.last">
+ <activeWhen>
+ <reference definitionId="org.jboss.tools.ui.structuredEditor"/>
+ </activeWhen>
+ <enabledWhen>
+ <reference definitionId="org.jboss.tools.ui.structuredEditor"/>
+ </enabledWhen>
+ </handler>
</extension>
<extension point="org.eclipse.core.expressions.definitions">
- <definition id="org.jboss.tools.ui.sourceMenu">
+ <definition id="org.jboss.tools.ui.structuredEditor">
<and>
<with variable="activeContexts">
<iterate operator="or">
15 years, 8 months
JBoss Tools SVN: r14739 - in trunk/smooks/plugins: org.jboss.tools.smooks.core/src/org/jboss/tools/smooks/model/validate and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2009-04-14 12:07:31 -0400 (Tue, 14 Apr 2009)
New Revision: 14739
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.core/plugin.xml
trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks/model/validate/SmooksModelValidator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/PropertyUICreator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SelectoreSelectionDialog.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMultiFormEditor.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksStuffPropertyDetailPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SearchComposite.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java
Log:
JBIDE-4171
1.Change Boolean attribute display UI
2.Fix some warning problem with plugin.xml
3.Change attribute display UI creation order.
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.core/plugin.xml
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.core/plugin.xml 2009-04-14 15:33:33 UTC (rev 14738)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.core/plugin.xml 2009-04-14 16:07:31 UTC (rev 14739)
@@ -13,7 +13,7 @@
<extension point="org.eclipse.emf.ecore.extension_parser">
<parser
- type="smooks"
+ type="smooks10"
class="org.jboss.tools.smooks10.model.smooks.util.SmooksResourceFactoryImpl"/>
</extension>
<extension point="org.eclipse.emf.edit.itemProviderAdapterFactories">
@@ -72,7 +72,7 @@
<package
uri="http://www.milyn.org/xsd/smooks-1.1.xsd"
class="org.jboss.tools.smooks.model.smooks.SmooksPackage"
- genModel="ecore.model/freemarker-1.1.genmodel"/>
+ genModel="ecore.model/smooks-1.1.genmodel"/>
</extension>
<extension point="org.eclipse.emf.ecore.extension_parser">
@@ -157,7 +157,7 @@
<package
class="org.jboss.tools.smooks.model.iorouting.IoroutingPackage"
genModel="model/io-routing-1.1.genmodel"
- uri="http://www.milyn.org/xsd/smooks/csv-1.1.xsd">
+ uri="http://www.milyn.org/xsd/smooks/io-routing-1.1.xsd">
</package>
</extension>
<extension
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks/model/validate/SmooksModelValidator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks/model/validate/SmooksModelValidator.java 2009-04-14 15:33:33 UTC (rev 14738)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks/model/validate/SmooksModelValidator.java 2009-04-14 16:07:31 UTC (rev 14739)
@@ -25,7 +25,6 @@
import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
-//import org.eclipse.emf.edit.ui.EMFEditUIPlugin;
/**
* @author Dart (dpeng(a)redhat.com)
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/PropertyUICreator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/PropertyUICreator.java 2009-04-14 15:33:33 UTC (rev 14738)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/PropertyUICreator.java 2009-04-14 16:07:31 UTC (rev 14739)
@@ -24,12 +24,13 @@
import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.forms.IFormColors;
import org.eclipse.ui.forms.events.IHyperlinkListener;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.jboss.tools.smooks.configuration.editors.uitls.IFieldDialog;
@@ -117,7 +118,6 @@
public void createExtendUI(AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit, Composite parent, Object model,
SmooksMultiFormEditor formEditor) {
-
}
public boolean isFileSelectionFeature(EAttribute attribute) {
@@ -190,8 +190,8 @@
SmooksResourceListType smooksResourceList = getSmooksResourceList((EObject) model);
if (smooksResourceList != null) {
String displayName = propertyDescriptor.getDisplayName(model);
- toolkit.createLabel(parent, displayName + " :");
- final CCombo combo = new CCombo(parent, SWT.BORDER);
+ toolkit.createLabel(parent, displayName + " :").setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
+ final Combo combo = new Combo(parent, SWT.BORDER);
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
combo.setLayoutData(gd);
Object editValue = SmooksUIUtils.getEditValue(propertyDescriptor, model);
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SelectoreSelectionDialog.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SelectoreSelectionDialog.java 2009-04-14 15:33:33 UTC (rev 14738)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SelectoreSelectionDialog.java 2009-04-14 16:07:31 UTC (rev 14739)
@@ -212,8 +212,8 @@
list.add(model);
}
}
- } finally {
-
+ } catch(Throwable e){
+
}
}
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMultiFormEditor.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMultiFormEditor.java 2009-04-14 15:33:33 UTC (rev 14738)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMultiFormEditor.java 2009-04-14 16:07:31 UTC (rev 14739)
@@ -75,6 +75,7 @@
import org.jboss.tools.smooks.model.json.provider.JsonItemProviderAdapterFactory;
import org.jboss.tools.smooks.model.medi.provider.MEdiItemProviderAdapterFactory;
import org.jboss.tools.smooks.model.smooks.provider.SmooksItemProviderAdapterFactory;
+import org.jboss.tools.smooks.model.validate.SmooksModelValidator;
import org.jboss.tools.smooks.model.xsl.provider.XslItemProviderAdapterFactory;
import org.jboss.tools.smooks10.model.smooks.util.SmooksResourceFactoryImpl;
@@ -142,7 +143,8 @@
}
int newEndIndex = newContent.length() - 1;
int oldEndIndex = oldContent.length() - 1;
- while (newEndIndex >= startIndex && oldEndIndex >= startIndex && newContent.charAt(newEndIndex) == oldContent.charAt(oldEndIndex)) {
+ while (newEndIndex >= startIndex && oldEndIndex >= startIndex
+ && newContent.charAt(newEndIndex) == oldContent.charAt(oldEndIndex)) {
--newEndIndex;
--oldEndIndex;
}
@@ -327,36 +329,42 @@
textEditor.doSave(monitor);
((BasicCommandStack) editingDomain.getCommandStack()).saveIsDone();
firePropertyChange(PROP_DIRTY);
- return;
- }
- Map<?, ?> options = Collections.emptyMap();
- initSaveOptions(options);
- if (editingDomain != null) {
- ResourceSet resourceSet = editingDomain.getResourceSet();
- List<Resource> resourceList = resourceSet.getResources();
- monitor.beginTask("Saving Smooks config file", resourceList.size());
- try {
- for (Iterator<Resource> iterator = resourceList.iterator(); iterator.hasNext();) {
- Resource resource = (Resource) iterator.next();
- resource.save(options);
- monitor.worked(1);
+ } else {
+ Map<?, ?> options = Collections.emptyMap();
+ initSaveOptions(options);
+ if (editingDomain != null) {
+ ResourceSet resourceSet = editingDomain.getResourceSet();
+ List<Resource> resourceList = resourceSet.getResources();
+ monitor.beginTask("Saving Smooks config file", resourceList.size());
+ try {
+ for (Iterator<Resource> iterator = resourceList.iterator(); iterator.hasNext();) {
+ Resource resource = (Resource) iterator.next();
+ resource.save(options);
+ monitor.worked(1);
+ }
+ ((BasicCommandStack) editingDomain.getCommandStack()).saveIsDone();
+ textEditor.doRevertToSaved();
+ firePropertyChange(PROP_DIRTY);
+ } catch (IOException e) {
+ SmooksConfigurationActivator.getDefault().log(e);
+ } finally {
+ monitor.done();
}
- ((BasicCommandStack) editingDomain.getCommandStack()).saveIsDone();
- textEditor.doRevertToSaved();
- firePropertyChange(PROP_DIRTY);
- } catch (IOException e) {
- SmooksConfigurationActivator.getDefault().log(e);
- } finally {
- monitor.done();
}
}
+ if(this.smooksModel != null){
+ List<Object> lists = new ArrayList<Object>();
+ lists.add(smooksModel);
+ SmooksModelValidator validator = new SmooksModelValidator(lists,getEditingDomain());
+ validator.validate(monitor);
+ }
}
@Override
public void init(IEditorSite site, IEditorInput input) throws PartInitException {
IFile file = ((IFileEditorInput) input).getFile();
- Resource smooksResource = new SmooksResourceFactoryImpl().createResource(URI.createPlatformResourceURI(file.getFullPath().toPortableString(),
- false));
+ Resource smooksResource = new SmooksResourceFactoryImpl().createResource(URI.createPlatformResourceURI(file
+ .getFullPath().toPortableString(), false));
try {
smooksResource.load(Collections.emptyMap());
smooksModel = smooksResource.getContents().get(0);
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksStuffPropertyDetailPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksStuffPropertyDetailPage.java 2009-04-14 15:33:33 UTC (rev 14738)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksStuffPropertyDetailPage.java 2009-04-14 16:07:31 UTC (rev 14739)
@@ -28,7 +28,6 @@
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
@@ -36,11 +35,12 @@
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Spinner;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.forms.IDetailsPage;
+import org.eclipse.ui.forms.IFormColors;
import org.eclipse.ui.forms.IFormPart;
import org.eclipse.ui.forms.IManagedForm;
import org.eclipse.ui.forms.widgets.FormToolkit;
@@ -73,13 +73,16 @@
public SmooksStuffPropertyDetailPage(SmooksMultiFormEditor formEditor) {
super();
this.formEditor = formEditor;
- editingDomain = (AdapterFactoryEditingDomain) formEditor.getEditingDomain();
- labelProvider = new AdapterFactoryLabelProvider(editingDomain.getAdapterFactory());
+ editingDomain = (AdapterFactoryEditingDomain) formEditor
+ .getEditingDomain();
+ labelProvider = new AdapterFactoryLabelProvider(editingDomain
+ .getAdapterFactory());
}
public void createContents(Composite parent) {
parent.setLayout(new FillLayout());
- section = formToolkit.createSection(parent, Section.DESCRIPTION | Section.TITLE_BAR);
+ section = formToolkit.createSection(parent, Section.DESCRIPTION
+ | Section.TITLE_BAR);
Composite client = formToolkit.createComposite(section);
section.setLayout(new FillLayout());
@@ -103,57 +106,28 @@
GridLayout layout = new GridLayout();
layout.numColumns = 2;
detailsComposite.setLayout(layout);
- IPropertyUICreator creator = PropertyUICreatorManager.getInstance().getPropertyUICreator(
- getModel());
- List<IItemPropertyDescriptor> propertyDes = itemPropertySource.getPropertyDescriptors(getModel());
- for (Iterator<IItemPropertyDescriptor> iterator = propertyDes.iterator(); iterator.hasNext();) {
- final IItemPropertyDescriptor itemPropertyDescriptor = (IItemPropertyDescriptor) iterator
- .next();
- EAttribute feature = (EAttribute) itemPropertyDescriptor.getFeature(getModel());
- boolean createDefault = true;
- if (creator != null) {
- if (creator.ignoreProperty(feature)) {
- continue;
- }
- Composite composite = creator.createPropertyUI(formToolkit, detailsComposite,
- itemPropertyDescriptor, getModel(), feature, getFormEditor());
- if (composite != null) {
- createDefault = false;
- }
+ IPropertyUICreator creator = PropertyUICreatorManager.getInstance()
+ .getPropertyUICreator(getModel());
+ List<IItemPropertyDescriptor> propertyDes = itemPropertySource
+ .getPropertyDescriptors(getModel());
+ for (int i = 0; i < propertyDes.size(); i++) {
+ IItemPropertyDescriptor pd = propertyDes.get(i);
+ EAttribute attribute = (EAttribute) pd.getFeature(getModel());
+ if (attribute.isRequired()) {
+ createAttributeUI(detailsComposite, pd, creator);
}
- if (createDefault) {
- EClassifier typeClazz = feature.getEType();
- boolean hasCreated = false;
- if (typeClazz instanceof EEnum) {
- createEnumFieldEditor(detailsComposite, feature, (EEnum) typeClazz, formToolkit,
- itemPropertyDescriptor);
- hasCreated = true;
- }
- if (typeClazz.getInstanceClass() == String.class) {
- createStringFieldEditor(detailsComposite, feature, formToolkit,
- itemPropertyDescriptor);
- }
- if (typeClazz.getInstanceClass() == Boolean.class
- || typeClazz.getInstanceClass() == boolean.class) {
- createBooleanFieldEditor(detailsComposite, feature, formToolkit,
- itemPropertyDescriptor);
- hasCreated = true;
- }
- if (typeClazz.getInstanceClass() == Integer.class
- || typeClazz.getInstanceClass() == int.class) {
- createIntegerFieldEditor(detailsComposite, feature, formToolkit,
- itemPropertyDescriptor);
- hasCreated = true;
- }
-// if (!hasCreated) {
-// createStringFieldEditor(detailsComposite, feature, formToolkit,
-// itemPropertyDescriptor);
-// }
+ }
+ for (int i = 0; i < propertyDes.size(); i++) {
+ IItemPropertyDescriptor pd = propertyDes.get(i);
+ EAttribute attribute = (EAttribute) pd.getFeature(getModel());
+ if (!attribute.isRequired()) {
+ createAttributeUI(detailsComposite, pd, creator);
}
}
if (creator != null) {
- creator.createExtendUI((AdapterFactoryEditingDomain) formEditor.getEditingDomain(),
- formToolkit, detailsComposite, getModel(), getFormEditor());
+ creator.createExtendUI((AdapterFactoryEditingDomain) formEditor
+ .getEditingDomain(), formToolkit, detailsComposite,
+ getModel(), getFormEditor());
}
formToolkit.paintBordersFor(detailsComposite);
detailsComposite.pack();
@@ -163,23 +137,79 @@
}
}
- protected void createEnumFieldEditor(Composite propertyComposite, EAttribute feature,
- final EEnum typeClass, FormToolkit formToolKit,
+ protected void createAttributeUI(Composite detailsComposite,
+ IItemPropertyDescriptor propertyDescriptor,
+ IPropertyUICreator creator) {
+ final IItemPropertyDescriptor itemPropertyDescriptor = propertyDescriptor;
+ EAttribute feature = (EAttribute) itemPropertyDescriptor
+ .getFeature(getModel());
+ boolean createDefault = true;
+ if (creator != null) {
+ if (creator.ignoreProperty(feature)) {
+ return;
+ }
+ Composite composite = creator.createPropertyUI(formToolkit,
+ detailsComposite, itemPropertyDescriptor, getModel(),
+ feature, getFormEditor());
+ if (composite != null) {
+ createDefault = false;
+ }
+ }
+ if (createDefault) {
+ EClassifier typeClazz = feature.getEType();
+ boolean hasCreated = false;
+ if (typeClazz instanceof EEnum) {
+ createEnumFieldEditor(detailsComposite, feature,
+ (EEnum) typeClazz, formToolkit, itemPropertyDescriptor);
+ hasCreated = true;
+ }
+ if (typeClazz.getInstanceClass() == String.class) {
+ createStringFieldEditor(detailsComposite, feature, formToolkit,
+ itemPropertyDescriptor);
+ }
+ if (typeClazz.getInstanceClass() == Boolean.class
+ || typeClazz.getInstanceClass() == boolean.class) {
+ createBooleanFieldEditor(detailsComposite, feature,
+ formToolkit, itemPropertyDescriptor);
+ hasCreated = true;
+ }
+ if (typeClazz.getInstanceClass() == Integer.class
+ || typeClazz.getInstanceClass() == int.class) {
+ createIntegerFieldEditor(detailsComposite, feature,
+ formToolkit, itemPropertyDescriptor);
+ hasCreated = true;
+ }
+ if (!hasCreated) {
+ // createStringFieldEditor(detailsComposite, feature,
+ // formToolkit,
+ // itemPropertyDescriptor);
+ }
+ }
+ }
+
+ protected void createEnumFieldEditor(Composite propertyComposite,
+ EAttribute feature, final EEnum typeClass, FormToolkit formToolKit,
final IItemPropertyDescriptor itemPropertyDescriptor) {
String displayName = itemPropertyDescriptor.getDisplayName(getModel());
if (feature.isRequired()) {
displayName = "*" + displayName;
}
- formToolKit.createLabel(propertyComposite, displayName + " :");
- final CCombo combo = new CCombo(propertyComposite, SWT.NONE);
+ formToolKit.createLabel(propertyComposite, displayName + " :")
+ .setForeground(
+ formToolKit.getColors().getColor(IFormColors.TITLE));
+ final Combo combo = new Combo(propertyComposite, SWT.BORDER
+ | SWT.READ_ONLY);
+ formToolKit.adapt(combo, true, false);
List<EEnumLiteral> literalList = typeClass.getELiterals();
- for (Iterator<EEnumLiteral> iterator = literalList.iterator(); iterator.hasNext();) {
+ for (Iterator<EEnumLiteral> iterator = literalList.iterator(); iterator
+ .hasNext();) {
EEnumLiteral enumLiteral = (EEnumLiteral) iterator.next();
combo.add(enumLiteral.getName());
}
Object value = itemPropertyDescriptor.getPropertyValue(getModel());
if (value != null && value instanceof PropertyValueWrapper) {
- Object editValue = ((PropertyValueWrapper) value).getEditableValue(getModel());
+ Object editValue = ((PropertyValueWrapper) value)
+ .getEditableValue(getModel());
if (editValue != null && editValue instanceof Enumerator) {
String[] strings = combo.getItems();
for (int i = 0; i < strings.length; i++) {
@@ -194,20 +224,24 @@
combo.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
try {
- Object value = itemPropertyDescriptor.getPropertyValue(getModel());
- Method method = typeClass.getInstanceClass().getMethod("get",
- new Class<?>[] { String.class });
+ Object value = itemPropertyDescriptor
+ .getPropertyValue(getModel());
+ Method method = typeClass.getInstanceClass().getMethod(
+ "get", new Class<?>[] { String.class });
// it's static method
Object v = method.invoke(null, combo.getText());
if (value != null && value instanceof PropertyValueWrapper) {
- Object editValue = ((PropertyValueWrapper) value).getEditableValue(getModel());
+ Object editValue = ((PropertyValueWrapper) value)
+ .getEditableValue(getModel());
if (editValue != null) {
if (!editValue.equals(v)) {
- itemPropertyDescriptor.setPropertyValue(getModel(), v);
+ itemPropertyDescriptor.setPropertyValue(
+ getModel(), v);
}
} else {
- itemPropertyDescriptor.setPropertyValue(getModel(), v);
+ itemPropertyDescriptor.setPropertyValue(getModel(),
+ v);
}
} else {
itemPropertyDescriptor.setPropertyValue(getModel(), v);
@@ -221,58 +255,85 @@
combo.setLayoutData(gd);
}
- protected void createBooleanFieldEditor(final Composite propertyComposite, EAttribute feature,
- FormToolkit formToolkit, final IItemPropertyDescriptor itemPropertyDescriptor) {
+ protected void createBooleanFieldEditor(final Composite propertyComposite,
+ EAttribute feature, FormToolkit formToolkit,
+ final IItemPropertyDescriptor itemPropertyDescriptor) {
String displayName = itemPropertyDescriptor.getDisplayName(getModel());
+ displayName += " :";
if (feature.isRequired()) {
displayName = "*" + displayName;
}
+ formToolkit.createLabel(propertyComposite, displayName + " :")
+ .setForeground(
+ formToolkit.getColors().getColor(IFormColors.TITLE));
Object value = itemPropertyDescriptor.getPropertyValue(getModel());
- final Button checkButton = formToolkit.createButton(propertyComposite, displayName, SWT.CHECK);
+ final Combo combo = new Combo(propertyComposite, SWT.BORDER
+ | SWT.READ_ONLY);
+ combo.add("TRUE");
+ combo.add("FALSE");
+ // combo.setEditable(false);
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = 2;
- checkButton.setLayoutData(gd);
+ combo.setLayoutData(gd);
Object editValue = null;
if (value != null && value instanceof PropertyValueWrapper) {
- editValue = ((PropertyValueWrapper) value).getEditableValue(getModel());
- if (editValue != null && editValue instanceof Boolean)
- checkButton.setSelection((Boolean) editValue);
+ editValue = ((PropertyValueWrapper) value)
+ .getEditableValue(getModel());
+ if (editValue != null && editValue instanceof Boolean) {
+ if ((Boolean) editValue) {
+ combo.select(0);
+ } else {
+ combo.select(1);
+ }
+ }
}
- checkButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- itemPropertyDescriptor.setPropertyValue(getModel(), checkButton.getSelection());
+ combo.addModifyListener(new ModifyListener() {
+
+ public void modifyText(ModifyEvent e) {
+ boolean bv = Boolean.valueOf(combo.getText());
+ itemPropertyDescriptor.setPropertyValue(getModel(), bv);
}
+
});
}
- protected void createStringFieldEditor(final Composite propertyComposite, EAttribute feature,
- FormToolkit formToolKit, final IItemPropertyDescriptor itemPropertyDescriptor) {
+ protected void createStringFieldEditor(final Composite propertyComposite,
+ EAttribute feature, FormToolkit formToolKit,
+ final IItemPropertyDescriptor itemPropertyDescriptor) {
String displayName = itemPropertyDescriptor.getDisplayName(getModel());
if (feature.isRequired()) {
displayName = "*" + displayName;
}
- formToolKit.createLabel(propertyComposite, displayName + " :");
- final Text text = formToolKit.createText(propertyComposite, "", SWT.NONE);
+ formToolKit.createLabel(propertyComposite, displayName + " :")
+ .setForeground(
+ formToolKit.getColors().getColor(IFormColors.TITLE));
+ final Text text = formToolKit.createText(propertyComposite, "",
+ SWT.NONE);
Object value = itemPropertyDescriptor.getPropertyValue(getModel());
if (value != null && value instanceof PropertyValueWrapper) {
- Object editValue = ((PropertyValueWrapper) value).getEditableValue(getModel());
+ Object editValue = ((PropertyValueWrapper) value)
+ .getEditableValue(getModel());
if (editValue != null)
text.setText(editValue.toString());
}
text.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
- Object value = itemPropertyDescriptor.getPropertyValue(getModel());
+ Object value = itemPropertyDescriptor
+ .getPropertyValue(getModel());
if (value != null && value instanceof PropertyValueWrapper) {
- Object editValue = ((PropertyValueWrapper) value).getEditableValue(getModel());
+ Object editValue = ((PropertyValueWrapper) value)
+ .getEditableValue(getModel());
if (editValue != null) {
if (!editValue.equals(text.getText())) {
- itemPropertyDescriptor.setPropertyValue(getModel(), text.getText());
+ itemPropertyDescriptor.setPropertyValue(getModel(),
+ text.getText());
}
} else {
- itemPropertyDescriptor.setPropertyValue(getModel(), text.getText());
+ itemPropertyDescriptor.setPropertyValue(getModel(),
+ text.getText());
}
} else {
- itemPropertyDescriptor.setPropertyValue(getModel(), text.getText());
+ itemPropertyDescriptor.setPropertyValue(getModel(), text
+ .getText());
}
}
});
@@ -280,34 +341,43 @@
text.setLayoutData(gd);
}
- protected void createIntegerFieldEditor(final Composite propertyComposite, EAttribute feature,
- FormToolkit formToolKit, final IItemPropertyDescriptor itemPropertyDescriptor) {
+ protected void createIntegerFieldEditor(final Composite propertyComposite,
+ EAttribute feature, FormToolkit formToolKit,
+ final IItemPropertyDescriptor itemPropertyDescriptor) {
String displayName = itemPropertyDescriptor.getDisplayName(getModel());
if (feature.isRequired()) {
displayName = "*" + displayName;
}
- formToolKit.createLabel(propertyComposite, displayName + " :");
+ formToolKit.createLabel(propertyComposite, displayName + " :")
+ .setForeground(
+ formToolKit.getColors().getColor(IFormColors.TITLE));
final Spinner spinner = new Spinner(propertyComposite, SWT.BORDER);
Object value = itemPropertyDescriptor.getPropertyValue(getModel());
if (value != null && value instanceof PropertyValueWrapper) {
- Object editValue = ((PropertyValueWrapper) value).getEditableValue(getModel());
+ Object editValue = ((PropertyValueWrapper) value)
+ .getEditableValue(getModel());
if (editValue != null && editValue instanceof Integer)
spinner.setSelection((Integer) editValue);
}
spinner.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
- Object value = itemPropertyDescriptor.getPropertyValue(getModel());
+ Object value = itemPropertyDescriptor
+ .getPropertyValue(getModel());
if (value != null && value instanceof PropertyValueWrapper) {
- Object editValue = ((PropertyValueWrapper) value).getEditableValue(getModel());
+ Object editValue = ((PropertyValueWrapper) value)
+ .getEditableValue(getModel());
if (editValue != null) {
if (!editValue.equals(spinner.getSelection())) {
- itemPropertyDescriptor.setPropertyValue(getModel(), spinner.getSelection());
+ itemPropertyDescriptor.setPropertyValue(getModel(),
+ spinner.getSelection());
}
} else {
- itemPropertyDescriptor.setPropertyValue(getModel(), spinner.getSelection());
+ itemPropertyDescriptor.setPropertyValue(getModel(),
+ spinner.getSelection());
}
} else {
- itemPropertyDescriptor.setPropertyValue(getModel(), spinner.getSelection());
+ itemPropertyDescriptor.setPropertyValue(getModel(), spinner
+ .getSelection());
}
}
});
@@ -327,14 +397,16 @@
setOldModel(oldModel);
this.selection = selection;
this.formPart = part;
- this.itemPropertySource = (IItemPropertySource) editingDomain.getAdapterFactory().adapt(getModel(),
- IItemPropertySource.class);
+ this.itemPropertySource = (IItemPropertySource) editingDomain
+ .getAdapterFactory().adapt(getModel(),
+ IItemPropertySource.class);
if (getOldModel() == getModel())
return;
if (getOldModel() != getModel()) {
if (propertyComposite != null) {
propertyComposite.dispose();
- propertyComposite = new Composite(propertyMainComposite, SWT.NONE);
+ propertyComposite = new Composite(propertyMainComposite,
+ SWT.NONE);
}
createStuffDetailsComposite(propertyComposite);
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SearchComposite.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SearchComposite.java 2009-04-14 15:33:33 UTC (rev 14738)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SearchComposite.java 2009-04-14 16:07:31 UTC (rev 14739)
@@ -36,10 +36,10 @@
super(parent, style);
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
GridLayout gl = new GridLayout();
- gl.marginWidth = 2;
+ gl.marginWidth = 0;
gl.numColumns = 2;
gl.makeColumnsEqualWidth = false;
- gl.marginHeight = 2;
+ gl.marginHeight = 0;
this.setLayout(gl);
if (toolkit != null) {
text = toolkit.createText(this, "");
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-04-14 15:33:33 UTC (rev 14738)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java 2009-04-14 16:07:31 UTC (rev 14739)
@@ -49,6 +49,7 @@
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.forms.IFormColors;
import org.eclipse.ui.forms.events.HyperlinkEvent;
import org.eclipse.ui.forms.events.IHyperlinkListener;
import org.eclipse.ui.forms.widgets.FormToolkit;
@@ -79,19 +80,19 @@
public static final String XSL_NAMESPACE = " xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" ";
- public static void createMixedTextFieldEditor(String label, AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit, Composite parent,
- Object model) {
+ public static void createMixedTextFieldEditor(String label, AdapterFactoryEditingDomain editingdomain,
+ FormToolkit toolkit, Composite parent, Object model) {
createMixedTextFieldEditor(label, editingdomain, toolkit, parent, model, false, 0);
}
- public static void createMultiMixedTextFieldEditor(String label, AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit,
- Composite parent, Object model, int height) {
+ public static void createMultiMixedTextFieldEditor(String label, AdapterFactoryEditingDomain editingdomain,
+ FormToolkit toolkit, Composite parent, Object model, int height) {
createMixedTextFieldEditor(label, editingdomain, toolkit, parent, model, true, height);
}
- public static void createMixedTextFieldEditor(String label, AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit, Composite parent,
- Object model, boolean multiText, int height) {
- toolkit.createLabel(parent, label + " :");
+ public static void createMixedTextFieldEditor(String label, AdapterFactoryEditingDomain editingdomain,
+ FormToolkit toolkit, Composite parent, Object model, boolean multiText, int height) {
+ toolkit.createLabel(parent, label + " :").setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
int textType = SWT.FLAT;
if (multiText) {
@@ -132,19 +133,21 @@
* @param parent
* @param model
*/
- public static void createFilePathFieldEditor(AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit, Composite parent, Object model) {
+ public static void createFilePathFieldEditor(AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit,
+ Composite parent, Object model) {
// IHyperlinkListener link
}
- public static void createLinkMixedTextFieldEditor(String label, AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit, Composite parent,
- Object model, boolean multiText, int height, boolean linkLabel, IHyperlinkListener listener) {
+ public static void createLinkMixedTextFieldEditor(String label, AdapterFactoryEditingDomain editingdomain,
+ FormToolkit toolkit, Composite parent, Object model, boolean multiText, int height, boolean linkLabel,
+ IHyperlinkListener listener) {
if (linkLabel) {
Hyperlink link = toolkit.createHyperlink(parent, label, SWT.NONE);
if (listener != null) {
link.addHyperlinkListener(listener);
}
} else {
- toolkit.createLabel(parent, label + " :");
+ toolkit.createLabel(parent, label + " :").setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
}
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
int textType = SWT.FLAT;
@@ -181,15 +184,15 @@
}
public static void createLinkTextValueFieldEditor(String label, AdapterFactoryEditingDomain editingdomain,
- IItemPropertyDescriptor propertyDescriptor, FormToolkit toolkit, Composite parent, Object model, boolean multiText, int height,
- boolean linkLabel, IHyperlinkListener listener) {
+ IItemPropertyDescriptor propertyDescriptor, FormToolkit toolkit, Composite parent, Object model,
+ boolean multiText, int height, boolean linkLabel, IHyperlinkListener listener) {
if (linkLabel) {
Hyperlink link = toolkit.createHyperlink(parent, label, SWT.NONE);
if (listener != null) {
link.addHyperlinkListener(listener);
}
} else {
- toolkit.createLabel(parent, label + " :");
+ toolkit.createLabel(parent, label + " :").setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
}
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
int textType = SWT.FLAT;
@@ -244,8 +247,8 @@
return path;
}
- public static Composite createSelectorFieldEditor(FormToolkit toolkit, Composite parent, final IItemPropertyDescriptor propertyDescriptor,
- Object model, final SmooksGraphicsExtType extType) {
+ public static Composite createSelectorFieldEditor(FormToolkit toolkit, Composite parent,
+ final IItemPropertyDescriptor propertyDescriptor, Object model, final SmooksGraphicsExtType extType) {
return createDialogFieldEditor(parent, toolkit, propertyDescriptor, "Browse", new IFieldDialog() {
public Object open(Shell shell) {
SelectoreSelectionDialog dialog = new SelectoreSelectionDialog(shell, extType);
@@ -265,15 +268,15 @@
}
public void setModelProcesser(IModelProcsser processer) {
-
+
}
}, (EObject) model);
}
public static SmooksGraphicsExtType loadSmooksGraphicsExt(IFile file) throws IOException {
- Resource resource = new SmooksGraphicsExtResourceFactoryImpl().createResource(URI.createPlatformResourceURI(file.getFullPath()
- .toPortableString(), false));
+ Resource resource = new SmooksGraphicsExtResourceFactoryImpl().createResource(URI.createPlatformResourceURI(
+ file.getFullPath().toPortableString(), false));
resource.load(Collections.emptyMap());
if (resource.getContents().size() > 0) {
Object obj = resource.getContents().get(0);
@@ -284,9 +287,10 @@
return null;
}
- public static void createCDATAFieldEditor(String label, AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit, Composite parent,
- Object model) {
+ public static void createCDATAFieldEditor(String label, AdapterFactoryEditingDomain editingdomain,
+ FormToolkit toolkit, Composite parent, Object model) {
Label label1 = toolkit.createLabel(parent, label + " :");
+ label1.setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
GridData gd = new GridData(GridData.VERTICAL_ALIGN_BEGINNING);
label1.setLayoutData(gd);
gd = new GridData(GridData.FILL_HORIZONTAL);
@@ -316,9 +320,10 @@
});
}
- public static void createCommentFieldEditor(String label, AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit, Composite parent,
- Object model) {
+ public static void createCommentFieldEditor(String label, AdapterFactoryEditingDomain editingdomain,
+ FormToolkit toolkit, Composite parent, Object model) {
Label label1 = toolkit.createLabel(parent, label + " :");
+ label1.setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
GridData gd = new GridData(GridData.VERTICAL_ALIGN_BEGINNING);
label1.setLayoutData(gd);
gd = new GridData(GridData.FILL_HORIZONTAL);
@@ -348,8 +353,8 @@
});
}
- public static Composite createJavaTypeSearchFieldEditor(Composite parent, FormToolkit toolkit, final IItemPropertyDescriptor propertyDescriptor,
- final EObject model) {
+ public static Composite createJavaTypeSearchFieldEditor(Composite parent, FormToolkit toolkit,
+ final IItemPropertyDescriptor propertyDescriptor, final EObject model) {
if (model instanceof EObject) {
final Resource resource = ((EObject) model).eResource();
URI uri = resource.getURI();
@@ -367,7 +372,8 @@
fillLayout.marginHeight = 0;
fillLayout.marginWidth = 0;
classTextComposite.setLayout(fillLayout);
- final SearchComposite searchComposite = new SearchComposite(classTextComposite, toolkit, "Search Class", dialog, SWT.NONE);
+ final SearchComposite searchComposite = new SearchComposite(classTextComposite, toolkit,
+ "Search Class", dialog, SWT.NONE);
Object editValue = getEditValue(propertyDescriptor, model);
if (editValue != null) {
searchComposite.getText().setText(editValue.toString());
@@ -403,8 +409,9 @@
if (result != null)
JavaUI.openInEditor(result);
else {
- MessageDialog.openInformation(classTextComposite.getShell(), "Can't find type", "Can't find type \"" + typeName
- + "\" in \"" + javaProject.getProject().getName() + "\" project.");
+ MessageDialog.openInformation(classTextComposite.getShell(), "Can't find type",
+ "Can't find type \"" + typeName + "\" in \""
+ + javaProject.getProject().getName() + "\" project.");
}
}
} catch (PartInitException ex) {
@@ -453,15 +460,17 @@
return null;
}
- public static Composite createJavaMethodSearchFieldEditor(BindingsType container, Composite parent, FormToolkit toolkit,
- final IItemPropertyDescriptor propertyDescriptor, String buttonName, final EObject model) {
+ public static Composite createJavaMethodSearchFieldEditor(BindingsType container, Composite parent,
+ FormToolkit toolkit, final IItemPropertyDescriptor propertyDescriptor, String buttonName,
+ final EObject model) {
String classString = ((BindingsType) container).getClass_();
IJavaProject project = getJavaProject(container);
try {
ProjectClassLoader classLoader = new ProjectClassLoader(project);
Class<?> clazz = classLoader.loadClass(classString);
JavaMethodsSelectionDialog dialog = new JavaMethodsSelectionDialog(project, clazz);
- return SmooksUIUtils.createDialogFieldEditor(parent, toolkit, propertyDescriptor, "Select method", dialog, (EObject) model);
+ return SmooksUIUtils.createDialogFieldEditor(parent, toolkit, propertyDescriptor, "Select method", dialog,
+ (EObject) model);
} catch (Exception e) {
// ignore
}
@@ -508,7 +517,8 @@
return generateFullPath(node, sperator);
}
- public static String generatePath(IXMLStructuredObject startNode, IXMLStructuredObject stopNode, final String sperator, boolean includeContext) {
+ public static String generatePath(IXMLStructuredObject startNode, IXMLStructuredObject stopNode,
+ final String sperator, boolean includeContext) {
String name = "";
if (startNode == stopNode) {
return startNode.getNodeName();
@@ -536,15 +546,17 @@
return name.trim();
}
- public static Composite createJavaPropertySearchFieldEditor(BindingsType container, Composite parent, FormToolkit toolkit,
- final IItemPropertyDescriptor propertyDescriptor, String buttonName, final EObject model) {
+ public static Composite createJavaPropertySearchFieldEditor(BindingsType container, Composite parent,
+ FormToolkit toolkit, final IItemPropertyDescriptor propertyDescriptor, String buttonName,
+ final EObject model) {
String classString = ((BindingsType) container).getClass_();
IJavaProject project = getJavaProject(container);
try {
ProjectClassLoader classLoader = new ProjectClassLoader(project);
Class<?> clazz = classLoader.loadClass(classString);
JavaPropertiesSelectionDialog dialog = new JavaPropertiesSelectionDialog(project, clazz);
- return SmooksUIUtils.createDialogFieldEditor(parent, toolkit, propertyDescriptor, "Select property", dialog, (EObject) model);
+ return SmooksUIUtils.createDialogFieldEditor(parent, toolkit, propertyDescriptor, "Select property",
+ dialog, (EObject) model);
} catch (Exception e) {
// ignore
}
@@ -560,15 +572,16 @@
return null;
}
- public static Composite createDialogFieldEditor(Composite parent, FormToolkit toolkit, final IItemPropertyDescriptor propertyDescriptor,
- String buttonName, IFieldDialog dialog, final EObject model) {
+ public static Composite createDialogFieldEditor(Composite parent, FormToolkit toolkit,
+ final IItemPropertyDescriptor propertyDescriptor, String buttonName, IFieldDialog dialog,
+ final EObject model) {
return createDialogFieldEditor(parent, toolkit, propertyDescriptor, buttonName, dialog, model, false, null);
}
+ public static Composite createDialogFieldEditor(Composite parent, FormToolkit toolkit,
+ final IItemPropertyDescriptor propertyDescriptor, String buttonName, IFieldDialog dialog,
+ final EObject model, boolean labelLink, IHyperlinkListener listener) {
- public static Composite createDialogFieldEditor(Composite parent, FormToolkit toolkit, final IItemPropertyDescriptor propertyDescriptor,
- String buttonName, IFieldDialog dialog, final EObject model, boolean labelLink, IHyperlinkListener listener) {
-
String displayName = propertyDescriptor.getDisplayName(model);
if (labelLink) {
Hyperlink link = toolkit.createHyperlink(parent, displayName + " :", SWT.NONE);
@@ -576,7 +589,8 @@
link.addHyperlinkListener(listener);
}
} else {
- toolkit.createLabel(parent, displayName + " :");
+ toolkit.createLabel(parent, displayName + " :").setForeground(
+ toolkit.getColors().getColor(IFormColors.TITLE));
}
final Composite classTextComposite = toolkit.createComposite(parent);
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
@@ -585,7 +599,8 @@
fillLayout.marginHeight = 0;
fillLayout.marginWidth = 0;
classTextComposite.setLayout(fillLayout);
- final SearchComposite searchComposite = new SearchComposite(classTextComposite, toolkit, buttonName, dialog, SWT.NONE);
+ final SearchComposite searchComposite = new SearchComposite(classTextComposite, toolkit, buttonName, dialog,
+ SWT.NONE);
Object editValue = getEditValue(propertyDescriptor, model);
if (editValue != null) {
searchComposite.getText().setText(editValue.toString());
15 years, 8 months
JBoss Tools SVN: r14738 - trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2009-04-14 11:33:33 -0400 (Tue, 14 Apr 2009)
New Revision: 14738
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/transformImageBlur.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/transformImageSize.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/transformImageType.xhtml
Log:
https://jira.jboss.org/jira/browse/JBIDE-4105, s:transformImageSize template was added, JUnits were updated
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/transformImageBlur.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/transformImageBlur.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/transformImageSize.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/transformImageSize.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/transformImageType.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/transformImageType.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
15 years, 8 months
JBoss Tools SVN: r14737 - in trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam: src/org/jboss/tools/jsf/vpe/seam/template and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2009-04-14 11:32:21 -0400 (Tue, 14 Apr 2009)
New Revision: 14737
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamGraphicImageTemplate.java
Removed:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/ComponentUtil.java
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/util/Seam.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/templates/vpe-templates-seam.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-4105, s:transformImageSize template was added, JUnits were updated
Deleted: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/ComponentUtil.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/ComponentUtil.java 2009-04-14 15:32:15 UTC (rev 14736)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/ComponentUtil.java 2009-04-14 15:32:21 UTC (rev 14737)
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is 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:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jsf.vpe.seam;
-
-import org.mozilla.interfaces.nsIDOMElement;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-public class ComponentUtil {
-
- /**
- * Copies all attributes from source node to visual node.
- *
- * @param sourceNode
- * @param visualNode
- */
- public static void copyAttributes(Node sourceNode,
- nsIDOMElement visualElement) {
- NamedNodeMap namedNodeMap = sourceNode.getAttributes();
- for (int i = 0; i < namedNodeMap.getLength(); i++) {
- Node attribute = namedNodeMap.item(i);
- visualElement.setAttribute(attribute.getNodeName(), attribute
- .getNodeValue());
- }
- }
-
-}
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamGraphicImageTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamGraphicImageTemplate.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamGraphicImageTemplate.java 2009-04-14 15:32:21 UTC (rev 14737)
@@ -0,0 +1,117 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.seam.template;
+
+import java.util.List;
+
+import org.jboss.tools.jsf.vpe.jsf.template.util.ComponentUtil;
+import org.jboss.tools.jsf.vpe.seam.template.util.Seam;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.jboss.tools.vpe.editor.util.VpeStyleUtil;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ * Class for s:graphicImage template.
+ *
+ * @author dmaliarevich
+ */
+public class SeamGraphicImageTemplate extends VpeAbstractTemplate {
+
+ /*
+ * s:transformImageSize tag name.
+ */
+ private final String TRANSFORM_IMAGE_SIZE_NAME = ":transformImageSize"; //$NON-NLS-1$
+
+ public SeamGraphicImageTemplate() {
+ super();
+ }
+
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument) {
+ Element sourceElement = (Element) sourceNode;
+ nsIDOMElement img = visualDocument.createElement(HTML.TAG_IMG);
+
+ /*
+ * Indicates that source node has width or height attributes.
+ */
+ boolean hasWidth = false;
+ boolean hasHeight = false;
+
+ /*
+ * Reading source attributes and setting them to the visual node.
+ */
+ if (sourceElement.hasAttribute(HTML.ATTR_ALT)) {
+ img.setAttribute(HTML.ATTR_ALT, sourceElement.getAttribute(HTML.ATTR_ALT));
+ }
+ if (sourceElement.hasAttribute(HTML.ATTR_DIR)) {
+ img.setAttribute(HTML.ATTR_DIR, sourceElement.getAttribute(HTML.ATTR_DIR));
+ }
+ if (sourceElement.hasAttribute(HTML.ATTR_WIDTH)) {
+ img.setAttribute(HTML.ATTR_WIDTH, sourceElement.getAttribute(HTML.ATTR_WIDTH));
+ hasWidth = true;
+ }
+ if (sourceElement.hasAttribute(HTML.ATTR_HEIGHT)) {
+ img.setAttribute(HTML.ATTR_HEIGHT, sourceElement.getAttribute(HTML.ATTR_HEIGHT));
+ hasHeight = true;
+ }
+ if (sourceElement.hasAttribute(HTML.ATTR_STYLE)) {
+ img.setAttribute(HTML.ATTR_STYLE, sourceElement.getAttribute(HTML.ATTR_STYLE));
+ }
+ if (sourceElement.hasAttribute(Seam.ATTR_STYLE_CLASS)) {
+ img.setAttribute(HTML.ATTR_CLASS, sourceElement.getAttribute(Seam.ATTR_STYLE_CLASS));
+ }
+ if (sourceElement.hasAttribute(HTML.ATTR_VALUE)) {
+ img.setAttribute(HTML.ATTR_SRC, VpeStyleUtil.addFullPathToImgSrc(
+ sourceElement.getAttribute(HTML.ATTR_VALUE), pageContext,
+ true));
+ } else if (sourceElement.hasAttribute(Seam.ATTR_URL)) {
+ img.setAttribute(HTML.ATTR_SRC, VpeStyleUtil.addFullPathToImgSrc(
+ sourceElement.getAttribute(Seam.ATTR_URL), pageContext,
+ true));
+ }
+
+ /*
+ * Looking for any seam transformation tag to apply the transformation to the image.
+ */
+ List<Node> children = ComponentUtil.getChildren(sourceElement);
+ /*
+ * If s:graphicImage has width and height attributes
+ * skip any size transformation.
+ */
+ if (!(hasHeight || hasWidth)) {
+ for (Node node : children) {
+ if (node.getNodeName().endsWith(TRANSFORM_IMAGE_SIZE_NAME)) {
+ Element transform = (Element) node;
+ if (transform.hasAttribute(HTML.ATTR_WIDTH)) {
+ img.setAttribute(HTML.ATTR_WIDTH, transform
+ .getAttribute(HTML.ATTR_WIDTH));
+ }
+ if (transform.hasAttribute(HTML.ATTR_HEIGHT)) {
+ img.setAttribute(HTML.ATTR_HEIGHT, transform
+ .getAttribute(HTML.ATTR_HEIGHT));
+ }
+ /*
+ * Apply only the first transform element.
+ */
+ break;
+ }
+ }
+ }
+ return new VpeCreationData(img);
+ }
+
+}
Property changes on: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamGraphicImageTemplate.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/util/Seam.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/util/Seam.java 2009-04-14 15:32:15 UTC (rev 14736)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/util/Seam.java 2009-04-14 15:32:21 UTC (rev 14737)
@@ -20,5 +20,6 @@
public static final String ATTR_TEMPLATE = "template"; //$NON-NLS-1$
public static final String ATTR_STYLE_CLASS = "styleClass"; //$NON-NLS-1$
+ public static final String ATTR_URL = "url"; //$NON-NLS-1$
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/templates/vpe-templates-seam.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/templates/vpe-templates-seam.xml 2009-04-14 15:32:15 UTC (rev 14736)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/templates/vpe-templates-seam.xml 2009-04-14 15:32:21 UTC (rev 14737)
@@ -190,29 +190,7 @@
</vpe:tag>
<vpe:tag name="s:graphicImage" case-sensitive="yes">
- <vpe:if test="attrpresent('value')">
- <vpe:template children="no" modify="yes">
- <img src="{src(jsfvalue(@value))}" width="{@width}"
- height="{@height}" class="{@styleClass}" style="{@style}"
- title="{tagstring()}" alt="{jsfvalue(@alt)}"/>
- <vpe:dnd>
- <vpe:drag start-enable="yes" />
- </vpe:dnd>
- <vpe:resize>
- <vpe:width width-attr="style.width" />
- <vpe:height height-attr="style.height" />
- </vpe:resize>
- </vpe:template>
- </vpe:if>
- <vpe:template children="no" modify="yes">
- <img src="{src(jsfvalue(@url))}" width="{@width}"
- height="{@height}" class="{@styleClass}" style="{@style}"
- title="{tagstring()}" alt="{jsfvalue(@alt)}"/>
- <vpe:resize>
- <vpe:width width-attr="style.width" />
- <vpe:height height-attr="style.height" />
- </vpe:resize>
- </vpe:template>
+ <vpe:template children="no" modify="yes" class="org.jboss.tools.jsf.vpe.seam.template.SeamGraphicImageTemplate" />
</vpe:tag>
<vpe:tag name="s:label" case-sensitive="yes">
15 years, 8 months
JBoss Tools SVN: r14736 - in trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test: src/org/jboss/tools/jsf/vpe/seam/test and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2009-04-14 11:32:15 -0400 (Tue, 14 Apr 2009)
New Revision: 14736
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/transformImageSize.xhtml.xml
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/graphicImage.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/src/org/jboss/tools/jsf/vpe/seam/test/SeamComponentContentTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4105, s:transformImageSize template was added, JUnits were updated
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/graphicImage.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/graphicImage.xhtml.xml 2009-04-14 13:38:48 UTC (rev 14735)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/graphicImage.xhtml.xml 2009-04-14 15:32:15 UTC (rev 14736)
@@ -1,7 +1,6 @@
<tests>
<test id="id1">
<IMG
- SRC="/.*ve/unresolved_image.gif/"
- STYLE="-moz-user-modify: read-write;" />
+ SRC="/.*ve/unresolved_image.gif/"/>
</test>
</tests>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/transformImageSize.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/transformImageSize.xhtml.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/transformImageSize.xhtml.xml 2009-04-14 15:32:15 UTC (rev 14736)
@@ -0,0 +1,27 @@
+<tests>
+ <test id="id1">
+ <IMG HEIGHT="10" CLASS="btn"
+ SRC="/.*ve/unresolved_image.gif/" />
+ </test>
+ <test id="id2">
+ <IMG WIDTH="200" CLASS="btn"
+ SRC="/.*ve/unresolved_image.gif/" />
+ </test>
+ <test id="id3">
+ <IMG WIDTH="" CLASS="btn"
+ SRC="/.*ve/unresolved_image.gif/" />
+ </test>
+ <test id="id4">
+ <IMG WIDTH="jjjjj" CLASS="btn"
+ SRC="/.*ve/unresolved_image.gif/" />
+ </test>
+ <test id="id5">
+ <IMG WIDTH="100" CLASS="btn" />
+ </test>
+ <test id="id6">
+ <IMG WIDTH="jjjjj" CLASS="btn" />
+ </test>
+ <test id="id7">
+ <IMG WIDTH="200" CLASS="btn" />
+ </test>
+</tests>
\ No newline at end of file
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/transformImageSize.xhtml.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:eol-style
+ native
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/src/org/jboss/tools/jsf/vpe/seam/test/SeamComponentContentTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/src/org/jboss/tools/jsf/vpe/seam/test/SeamComponentContentTest.java 2009-04-14 13:38:48 UTC (rev 14735)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/src/org/jboss/tools/jsf/vpe/seam/test/SeamComponentContentTest.java 2009-04-14 15:32:15 UTC (rev 14736)
@@ -98,6 +98,18 @@
performContentTest("components/span.xhtml"); //$NON-NLS-1$
}
+ public void testTransformImageSize() throws Throwable {
+ performContentTest("components/transformImageSize.xhtml"); //$NON-NLS-1$
+ }
+
+ public void testTransformImageBlur() throws Throwable {
+ performInvisibleTagTest("components/transformImageBlur.xhtml", "id1"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ public void testTransformImageType() throws Throwable {
+ performInvisibleTagTest("components/transformImageType.xhtml", "id1"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
public void testValidate() throws Throwable {
performInvisibleTagTest("components/validate.xhtml", "id1"); //$NON-NLS-1$ //$NON-NLS-2$
}
15 years, 8 months
JBoss Tools SVN: r14735 - in trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors: edireader and 6 other directories.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2009-04-14 09:38:48 -0400 (Tue, 14 Apr 2009)
New Revision: 14735
Added:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/IModelProcsser.java
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/FileSelectionWizard.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/PropertyUICreator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/edireader/EDIReaderUICreator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/freemarker/TemplateUICreator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/javabean/JavaMethodsSelectionDialog.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/javabean/JavaPropertiesSelectionDialog.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/ParamTypeUICreator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/IFieldDialog.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/JavaTypeFieldDialog.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/editors/xml/AbstractFileSelectionWizardPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xsl/TemplateUICreator.java
Log:
JBIDE-4171
Add UI for editing EDI element
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/FileSelectionWizard.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/FileSelectionWizard.java 2009-04-14 11:30:02 UTC (rev 14734)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/FileSelectionWizard.java 2009-04-14 13:38:48 UTC (rev 14735)
@@ -10,7 +10,10 @@
******************************************************************************/
package org.jboss.tools.smooks.configuration.editors;
+import java.util.List;
+
import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.ui.INewWizard;
import org.eclipse.ui.IWorkbench;
@@ -21,14 +24,23 @@
*/
public class FileSelectionWizard extends Wizard implements INewWizard {
- private FileSelectionWizardPage wizardPage = null;
+ private FileSelectionWizardPage fileSelectionWizardPage = null;
private String filePath = null;
+
+ private List<ViewerFilter> viewerFilters = null;
+
+ private Object[] initSelections = null;
+
+ private boolean multiSelect = false;
@Override
public void addPages() {
- wizardPage = new FileSelectionWizardPage("File Selection");
- this.addPage(wizardPage);
+ fileSelectionWizardPage = new FileSelectionWizardPage("File Selection");
+ fileSelectionWizardPage.setFilters(viewerFilters);
+ fileSelectionWizardPage.setInitSelections(getInitSelections());
+ fileSelectionWizardPage.setMultiSelect(isMultiSelect());
+ this.addPage(fileSelectionWizardPage);
}
/* (non-Javadoc)
@@ -36,7 +48,7 @@
*/
@Override
public boolean performFinish() {
- filePath = wizardPage.getFilePath();
+ filePath = fileSelectionWizardPage.getFilePath();
return true;
}
@@ -47,6 +59,22 @@
}
+ public Object[] getInitSelections() {
+ return initSelections;
+ }
+
+ public void setInitSelections(Object[] initSelections) {
+ this.initSelections = initSelections;
+ }
+
+ public boolean isMultiSelect() {
+ return multiSelect;
+ }
+
+ public void setMultiSelect(boolean multiSelect) {
+ this.multiSelect = multiSelect;
+ }
+
public String getFilePath() {
return filePath;
}
@@ -54,6 +82,14 @@
public void setFilePath(String filePath) {
this.filePath = filePath;
}
+
+ public List<ViewerFilter> getViewerFilters() {
+ return viewerFilters;
+ }
+
+ public void setViewerFilters(List<ViewerFilter> viewerFilters) {
+ this.viewerFilters = viewerFilters;
+ }
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/PropertyUICreator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/PropertyUICreator.java 2009-04-14 11:30:02 UTC (rev 14734)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/PropertyUICreator.java 2009-04-14 13:38:48 UTC (rev 14735)
@@ -21,6 +21,7 @@
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CCombo;
@@ -29,10 +30,10 @@
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.forms.events.HyperlinkEvent;
import org.eclipse.ui.forms.events.IHyperlinkListener;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.jboss.tools.smooks.configuration.editors.uitls.IFieldDialog;
+import org.jboss.tools.smooks.configuration.editors.uitls.IModelProcsser;
import org.jboss.tools.smooks.configuration.editors.uitls.SmooksUIUtils;
import org.jboss.tools.smooks.model.graphics.ext.SmooksGraphicsExtType;
import org.jboss.tools.smooks.model.javabean.BindingsType;
@@ -47,6 +48,12 @@
*/
public class PropertyUICreator implements IPropertyUICreator {
+ protected IModelProcsser fileFiledEditorModelProcess;
+
+ protected IHyperlinkListener fileFiledEditorLinkListener;
+
+ protected List<ViewerFilter> viewerFilters = null;
+
/*
* (non-Javadoc)
*
@@ -56,24 +63,19 @@
* org.eclipse.emf.edit.provider.IItemPropertyDescriptor, java.lang.Object,
* org.eclipse.emf.ecore.EAttribute)
*/
- public Composite createPropertyUI(FormToolkit toolkit, Composite parent,
- IItemPropertyDescriptor propertyDescriptor, Object model, EAttribute feature,
- SmooksMultiFormEditor formEditor) {
+ public Composite createPropertyUI(FormToolkit toolkit, Composite parent, IItemPropertyDescriptor propertyDescriptor, Object model,
+ EAttribute feature, SmooksMultiFormEditor formEditor) {
if (isBeanIDRefFieldFeature(feature)) {
- return createBeanIDRefFieldEditor(toolkit, parent, propertyDescriptor, model, feature,
- formEditor);
+ return createBeanIDRefFieldEditor(toolkit, parent, propertyDescriptor, model, feature, formEditor);
}
if (isSelectorFeature(feature)) {
- return createSelectorFieldEditor(toolkit, parent, propertyDescriptor, model, feature,
- formEditor);
+ return createSelectorFieldEditor(toolkit, parent, propertyDescriptor, model, feature, formEditor);
}
if (isJavaTypeFeature(feature)) {
- return createJavaTypeSearchEditor(toolkit, parent, propertyDescriptor, model, feature,
- formEditor);
+ return createJavaTypeSearchEditor(toolkit, parent, propertyDescriptor, model, feature, formEditor);
}
if (isFileSelectionFeature(feature)) {
- return createFileSelectionFieldEditor(toolkit, parent, propertyDescriptor, model,
- feature, formEditor);
+ return createFileSelectionFieldEditor(toolkit, parent, propertyDescriptor, model, feature, formEditor);
}
if (feature == SmooksPackage.eINSTANCE.getAbstractReader_TargetProfile()) {
@@ -81,6 +83,30 @@
return null;
}
+ public IHyperlinkListener getFileFiledEditorLinkListener() {
+ return fileFiledEditorLinkListener;
+ }
+
+ public void setFileFiledEditorLinkListener(IHyperlinkListener fileFiledEditorLinkListener) {
+ this.fileFiledEditorLinkListener = fileFiledEditorLinkListener;
+ }
+
+ public IModelProcsser getFileFiledEditorModelProcess() {
+ return fileFiledEditorModelProcess;
+ }
+
+ public void setFileFiledEditorModelProcess(IModelProcsser fileFiledEditorModelProcess) {
+ this.fileFiledEditorModelProcess = fileFiledEditorModelProcess;
+ }
+
+ public List<ViewerFilter> getFileDialogViewerFilters() {
+ return viewerFilters;
+ }
+
+ public void setDialogViewerFilters(List<ViewerFilter> viewerFilters) {
+ this.viewerFilters = viewerFilters;
+ }
+
public IResource getResource(EObject model) {
return SmooksUIUtils.getResource(model);
}
@@ -89,61 +115,56 @@
return SmooksUIUtils.getJavaProject(model);
}
- public void createExtendUI(AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit,
- Composite parent, Object model, SmooksMultiFormEditor formEditor) {
+ public void createExtendUI(AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit, Composite parent, Object model,
+ SmooksMultiFormEditor formEditor) {
}
public boolean isFileSelectionFeature(EAttribute attribute) {
return false;
}
+
- public Composite createFileSelectionFieldEditor(FormToolkit toolkit, Composite parent,
- IItemPropertyDescriptor propertyDescriptor, Object model, EAttribute feature,
- SmooksMultiFormEditor formEditor) {
+ public Composite createFileSelectionFieldEditor(FormToolkit toolkit, Composite parent, IItemPropertyDescriptor propertyDescriptor, Object model,
+ EAttribute feature, SmooksMultiFormEditor formEditor) {
IFieldDialog dialog = new IFieldDialog() {
public Object open(Shell shell) {
FileSelectionWizard wizard = new FileSelectionWizard();
+ wizard.setViewerFilters(getFileDialogViewerFilters());
WizardDialog dialog = new WizardDialog(shell, wizard);
if (dialog.open() == Dialog.OK) {
- return wizard.getFilePath();
+ IModelProcsser p = getModelProcesser();
+ String path = wizard.getFilePath();
+ if (p != null) {
+ path = p.processModel(path).toString();
+ }
+ return path;
}
return null;
}
- };
- final IItemPropertyDescriptor fp = propertyDescriptor;
- final Object fm = model;
- IHyperlinkListener listener = new IHyperlinkListener() {
- public void linkActivated(HyperlinkEvent e) {
- Object value = SmooksUIUtils.getEditValue(fp, fm);
- System.out.println(value);
+ public IModelProcsser getModelProcesser() {
+ return getFileFiledEditorModelProcess();
}
- public void linkEntered(HyperlinkEvent e) {
+ public void setModelProcesser(IModelProcsser processer) {
}
- public void linkExited(HyperlinkEvent e) {
-
- }
};
-
- return SmooksUIUtils.createDialogFieldEditor(parent, toolkit, propertyDescriptor, "Browse",
- dialog, (EObject) model, true, listener);
+ return SmooksUIUtils.createDialogFieldEditor(parent, toolkit, propertyDescriptor, "Browse", dialog, (EObject) model, true,
+ getFileFiledEditorLinkListener());
}
public boolean isSelectorFeature(EAttribute attribute) {
return false;
}
- public Composite createSelectorFieldEditor(FormToolkit toolkit, Composite parent,
- IItemPropertyDescriptor propertyDescriptor, Object model, EAttribute feature,
- SmooksMultiFormEditor formEditor) {
+ public Composite createSelectorFieldEditor(FormToolkit toolkit, Composite parent, IItemPropertyDescriptor propertyDescriptor, Object model,
+ EAttribute feature, SmooksMultiFormEditor formEditor) {
SmooksGraphicsExtType ext = formEditor.getSmooksGraphicsExt();
if (ext != null) {
- return SmooksUIUtils.createSelectorFieldEditor(toolkit, parent, propertyDescriptor,
- model, ext);
+ return SmooksUIUtils.createSelectorFieldEditor(toolkit, parent, propertyDescriptor, model, ext);
}
return null;
}
@@ -152,11 +173,10 @@
return false;
}
- public Composite createJavaTypeSearchEditor(FormToolkit toolkit, Composite parent,
- IItemPropertyDescriptor propertyDescriptor, Object model, EAttribute feature,
- SmooksMultiFormEditor formEditor) {
- if (model instanceof EObject) return SmooksUIUtils.createJavaTypeSearchFieldEditor(parent,
- toolkit, propertyDescriptor, (EObject) model);
+ public Composite createJavaTypeSearchEditor(FormToolkit toolkit, Composite parent, IItemPropertyDescriptor propertyDescriptor, Object model,
+ EAttribute feature, SmooksMultiFormEditor formEditor) {
+ if (model instanceof EObject)
+ return SmooksUIUtils.createJavaTypeSearchFieldEditor(parent, toolkit, propertyDescriptor, (EObject) model);
return null;
}
@@ -164,9 +184,8 @@
return false;
}
- public Composite createBeanIDRefFieldEditor(FormToolkit toolkit, Composite parent,
- IItemPropertyDescriptor propertyDescriptor, Object model, EAttribute feature,
- SmooksMultiFormEditor formEditor) {
+ public Composite createBeanIDRefFieldEditor(FormToolkit toolkit, Composite parent, IItemPropertyDescriptor propertyDescriptor, Object model,
+ EAttribute feature, SmooksMultiFormEditor formEditor) {
if (model instanceof EObject) {
SmooksResourceListType smooksResourceList = getSmooksResourceList((EObject) model);
if (smooksResourceList != null) {
@@ -220,11 +239,11 @@
List<AbstractResourceConfig> rlist = resourceList.getAbstractResourceConfig();
List<String> beanIdList = new ArrayList<String>();
for (Iterator<?> iterator = rlist.iterator(); iterator.hasNext();) {
- AbstractResourceConfig abstractResourceConfig = (AbstractResourceConfig) iterator
- .next();
+ AbstractResourceConfig abstractResourceConfig = (AbstractResourceConfig) iterator.next();
if (abstractResourceConfig instanceof BindingsType) {
String beanId = ((BindingsType) abstractResourceConfig).getBeanId();
- if (beanId == null) continue;
+ if (beanId == null)
+ continue;
beanIdList.add(beanId);
}
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/edireader/EDIReaderUICreator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/edireader/EDIReaderUICreator.java 2009-04-14 11:30:02 UTC (rev 14734)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/edireader/EDIReaderUICreator.java 2009-04-14 13:38:48 UTC (rev 14735)
@@ -10,12 +10,30 @@
******************************************************************************/
package org.jboss.tools.smooks.configuration.editors.edireader;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.Path;
import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.forms.events.HyperlinkEvent;
+import org.eclipse.ui.forms.events.IHyperlinkListener;
import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.part.FileEditorInput;
+import org.jboss.tools.smooks.configuration.SmooksConfigurationActivator;
import org.jboss.tools.smooks.configuration.editors.PropertyUICreator;
import org.jboss.tools.smooks.configuration.editors.SmooksMultiFormEditor;
+import org.jboss.tools.smooks.configuration.editors.uitls.SmooksUIUtils;
import org.jboss.tools.smooks.model.edi.EdiPackage;
/**
@@ -23,6 +41,54 @@
*/
public class EDIReaderUICreator extends PropertyUICreator {
+ public EDIReaderUICreator() {
+ }
+
+ private void openFile(IItemPropertyDescriptor propertyDescriptor, Object model) {
+ Object path = SmooksUIUtils.getEditValue(propertyDescriptor, model);
+ String p = null;
+ if (path != null && path instanceof String) {
+ p = ((String) path).trim();
+ }
+ try {
+ IResource resource = SmooksUIUtils.getResource((EObject) model);
+ IFile file1 = null;
+ if (resource != null) {
+ IProject project = resource.getProject();
+ IJavaProject javaProject = JavaCore.create(project);
+ if (javaProject != null) {
+ IClasspathEntry[] classPathEntrys = javaProject.getRawClasspath();
+ for (int i = 0; i < classPathEntrys.length; i++) {
+ IClasspathEntry entry = classPathEntrys[i];
+ if (entry.getEntryKind() == IClasspathEntry.CPE_SOURCE) {
+ IFolder folder = ResourcesPlugin.getWorkspace().getRoot().getFolder(entry.getPath());
+ if (folder != null && folder.exists()) {
+ IFile file = folder.getFile(new Path(p));
+ if (file != null && file.exists()) {
+ file1 = file;
+ break;
+ }
+ }
+ }
+ }
+ }
+ if (file1 != null) {
+ IWorkbenchWindow window = SmooksConfigurationActivator.getDefault().getWorkbench().getActiveWorkbenchWindow();
+ window.getActivePage().openEditor(new FileEditorInput(file1), SmooksMultiFormEditor.EDITOR_ID);
+ } else {
+ String message = "Path is null";
+ if (p != null && p.length() != 0) {
+ message = "Can't find file : " + p;
+ }
+ MessageDialog.openInformation(SmooksConfigurationActivator.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell(),
+ "Can't open editor", message);
+ }
+ }
+ } catch (Exception e) {
+
+ }
+ }
+
/*
* (non-Javadoc)
*
@@ -37,9 +103,63 @@
if (feature == EdiPackage.eINSTANCE.getEDIReader_Encoding()) {
}
if (feature == EdiPackage.eINSTANCE.getEDIReader_MappingModel()) {
+ // IResource resource =SmooksUIUtils.getResource((EObject)model);
+ // if(resource != null){
+ // final IProject project = resource.getProject();
+ // ViewerFilter viewerFilter = new ViewerFilter(){
+ // @Override
+ // public boolean select(Viewer viewer, Object parentElement, Object
+ // element) {
+ // IResource re = null;
+ // if(element instanceof IResource){
+ // re = (IResource)element;
+ // }
+ // if(element instanceof IAdaptable){
+ // re = (IResource)
+ // ((IAdaptable)element).getAdapter(IResource.class);
+ // }
+ // if(re != null){
+ // if(re.getProject() == project){
+ // return true;
+ // }
+ // }
+ // return false;
+ // }
+ // };
+ // List<ViewerFilter> list = new ArrayList<ViewerFilter>();
+ // list.add(viewerFilter);
+ // setDialogViewerFilters(list);
+ // }
+ final Object fm = model;
+ final IItemPropertyDescriptor fpd = propertyDescriptor;
+ IHyperlinkListener listener = new IHyperlinkListener() {
+
+ public void linkActivated(HyperlinkEvent e) {
+ openFile(fpd, fm);
+ }
+
+ public void linkEntered(HyperlinkEvent e) {
+
+ }
+
+ public void linkExited(HyperlinkEvent e) {
+
+ }
+
+ };
+ SmooksUIUtils.createLinkTextValueFieldEditor("Mapping Model", (AdapterFactoryEditingDomain) formEditor.getEditingDomain(), propertyDescriptor,
+ toolkit, parent, model, false, 0, true, listener);
+ return parent;
}
-
return super.createPropertyUI(toolkit, parent, propertyDescriptor, model, feature, formEditor);
}
+ @Override
+ public boolean isFileSelectionFeature(EAttribute attribute) {
+// if (attribute == EdiPackage.eINSTANCE.getEDIReader_MappingModel()) {
+// return true;
+// }
+ return super.isFileSelectionFeature(attribute);
+ }
+
}
\ No newline at end of file
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/freemarker/TemplateUICreator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/freemarker/TemplateUICreator.java 2009-04-14 11:30:02 UTC (rev 14734)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/freemarker/TemplateUICreator.java 2009-04-14 13:38:48 UTC (rev 14735)
@@ -48,7 +48,7 @@
@Override
public void createExtendUI(AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit,
Composite parent, Object model, SmooksMultiFormEditor formEditor) {
- SmooksUIUtils.createTextFieldEditor("Value", editingdomain, toolkit, parent, model);
+ SmooksUIUtils.createMixedTextFieldEditor("Value", editingdomain, toolkit, parent, model);
SmooksUIUtils.createCDATAFieldEditor("Template Contents", editingdomain, toolkit, parent, model);
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/javabean/JavaMethodsSelectionDialog.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/javabean/JavaMethodsSelectionDialog.java 2009-04-14 11:30:02 UTC (rev 14734)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/javabean/JavaMethodsSelectionDialog.java 2009-04-14 13:38:48 UTC (rev 14735)
@@ -38,6 +38,7 @@
import org.jboss.tools.smooks.configuration.SmooksConfigurationActivator;
import org.jboss.tools.smooks.configuration.editors.GraphicsConstants;
import org.jboss.tools.smooks.configuration.editors.uitls.IFieldDialog;
+import org.jboss.tools.smooks.configuration.editors.uitls.IModelProcsser;
import org.jboss.tools.smooks.configuration.editors.uitls.JavaPropertyUtils;
/**
@@ -195,4 +196,14 @@
return getText(element);
}
}
+
+ public IModelProcsser getModelProcesser() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void setModelProcesser(IModelProcsser processer) {
+ // TODO Auto-generated method stub
+
+ }
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/javabean/JavaPropertiesSelectionDialog.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/javabean/JavaPropertiesSelectionDialog.java 2009-04-14 11:30:02 UTC (rev 14734)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/javabean/JavaPropertiesSelectionDialog.java 2009-04-14 13:38:48 UTC (rev 14735)
@@ -38,6 +38,7 @@
import org.jboss.tools.smooks.configuration.SmooksConfigurationActivator;
import org.jboss.tools.smooks.configuration.editors.GraphicsConstants;
import org.jboss.tools.smooks.configuration.editors.uitls.IFieldDialog;
+import org.jboss.tools.smooks.configuration.editors.uitls.IModelProcsser;
import org.jboss.tools.smooks.configuration.editors.uitls.JavaPropertyUtils;
/**
@@ -183,4 +184,14 @@
return getText(element);
}
}
+
+ public IModelProcsser getModelProcesser() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void setModelProcesser(IModelProcsser processer) {
+ // TODO Auto-generated method stub
+
+ }
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/ParamTypeUICreator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/ParamTypeUICreator.java 2009-04-14 11:30:02 UTC (rev 14734)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/ParamTypeUICreator.java 2009-04-14 13:38:48 UTC (rev 14735)
@@ -46,7 +46,7 @@
@Override
public void createExtendUI(AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit,
Composite parent, Object model, SmooksMultiFormEditor formEditor) {
- SmooksUIUtils.createTextFieldEditor("Value", editingdomain, toolkit, parent, model);
+ SmooksUIUtils.createMixedTextFieldEditor("Value", editingdomain, toolkit, parent, model);
SmooksUIUtils.createCDATAFieldEditor("CDATA", editingdomain, toolkit, parent, model);
}
}
\ No newline at end of file
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/IFieldDialog.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/IFieldDialog.java 2009-04-14 11:30:02 UTC (rev 14734)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/IFieldDialog.java 2009-04-14 13:38:48 UTC (rev 14735)
@@ -18,4 +18,6 @@
*/
public interface IFieldDialog {
Object open(Shell shell);
+ IModelProcsser getModelProcesser();
+ void setModelProcesser(IModelProcsser processer);
}
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/IModelProcsser.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/IModelProcsser.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/IModelProcsser.java 2009-04-14 13:38:48 UTC (rev 14735)
@@ -0,0 +1,12 @@
+/**
+ *
+ */
+package org.jboss.tools.smooks.configuration.editors.uitls;
+
+/**
+ * @author DartPeng
+ *
+ */
+public interface IModelProcsser {
+ Object processModel(Object model);
+}
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/IModelProcsser.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/JavaTypeFieldDialog.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/JavaTypeFieldDialog.java 2009-04-14 11:30:02 UTC (rev 14734)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/JavaTypeFieldDialog.java 2009-04-14 13:38:48 UTC (rev 14735)
@@ -104,5 +104,15 @@
return className;
}
+ public IModelProcsser getModelProcesser() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+ public void setModelProcesser(IModelProcsser processer) {
+ // TODO Auto-generated method stub
+
+ }
+
+
}
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-04-14 11:30:02 UTC (rev 14734)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java 2009-04-14 13:38:48 UTC (rev 14735)
@@ -79,21 +79,18 @@
public static final String XSL_NAMESPACE = " xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" ";
- public static void createTextFieldEditor(String label,
- AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit, Composite parent,
- Object model) {
- createTextFieldEditor(label, editingdomain, toolkit, parent, model, false, 0);
+ public static void createMixedTextFieldEditor(String label, AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit, Composite parent,
+ Object model) {
+ createMixedTextFieldEditor(label, editingdomain, toolkit, parent, model, false, 0);
}
- public static void createMultiTextFieldEditor(String label,
- AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit, Composite parent,
- Object model, int height) {
- createTextFieldEditor(label, editingdomain, toolkit, parent, model, true, height);
+ public static void createMultiMixedTextFieldEditor(String label, AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit,
+ Composite parent, Object model, int height) {
+ createMixedTextFieldEditor(label, editingdomain, toolkit, parent, model, true, height);
}
- public static void createTextFieldEditor(String label,
- AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit, Composite parent,
- Object model, boolean multiText, int height) {
+ public static void createMixedTextFieldEditor(String label, AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit, Composite parent,
+ Object model, boolean multiText, int height) {
toolkit.createLabel(parent, label + " :");
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
int textType = SWT.FLAT;
@@ -121,13 +118,110 @@
}
String text = SmooksModelUtils.getAnyTypeText((AnyType) fm);
if (!valueText.getText().equals(text)) {
- SmooksModelUtils.setTextToSmooksType(fEditingDomain, (AnyType) fm, valueText
- .getText());
+ SmooksModelUtils.setTextToSmooksType(fEditingDomain, (AnyType) fm, valueText.getText());
}
}
});
}
+ /**
+ * Can't use
+ *
+ * @param editingdomain
+ * @param toolkit
+ * @param parent
+ * @param model
+ */
+ public static void createFilePathFieldEditor(AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit, Composite parent, Object model) {
+ // IHyperlinkListener link
+ }
+
+ public static void createLinkMixedTextFieldEditor(String label, AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit, Composite parent,
+ Object model, boolean multiText, int height, boolean linkLabel, IHyperlinkListener listener) {
+ if (linkLabel) {
+ Hyperlink link = toolkit.createHyperlink(parent, label, SWT.NONE);
+ if (listener != null) {
+ link.addHyperlinkListener(listener);
+ }
+ } else {
+ toolkit.createLabel(parent, label + " :");
+ }
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ int textType = SWT.FLAT;
+ if (multiText) {
+ textType = SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL;
+ }
+ final Text valueText = toolkit.createText(parent, "", textType);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ if (multiText && height > 0) {
+ gd.heightHint = height;
+ }
+ valueText.setLayoutData(gd);
+ if (model instanceof AnyType) {
+ String text = SmooksModelUtils.getAnyTypeText((AnyType) model);
+ if (text != null) {
+ valueText.setText(text);
+ }
+ } else {
+
+ }
+ final Object fm = model;
+ final AdapterFactoryEditingDomain fEditingDomain = editingdomain;
+ valueText.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ if (!(fm instanceof AnyType)) {
+ return;
+ }
+ String text = SmooksModelUtils.getAnyTypeText((AnyType) fm);
+ if (!valueText.getText().equals(text)) {
+ SmooksModelUtils.setTextToSmooksType(fEditingDomain, (AnyType) fm, valueText.getText());
+ }
+ }
+ });
+ }
+
+ public static void createLinkTextValueFieldEditor(String label, AdapterFactoryEditingDomain editingdomain,
+ IItemPropertyDescriptor propertyDescriptor, FormToolkit toolkit, Composite parent, Object model, boolean multiText, int height,
+ boolean linkLabel, IHyperlinkListener listener) {
+ if (linkLabel) {
+ Hyperlink link = toolkit.createHyperlink(parent, label, SWT.NONE);
+ if (listener != null) {
+ link.addHyperlinkListener(listener);
+ }
+ } else {
+ toolkit.createLabel(parent, label + " :");
+ }
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ int textType = SWT.FLAT;
+ if (multiText) {
+ textType = SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL;
+ }
+ final Text valueText = toolkit.createText(parent, "", textType);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ if (multiText && height > 0) {
+ gd.heightHint = height;
+ }
+ valueText.setLayoutData(gd);
+ Object path = SmooksUIUtils.getEditValue(propertyDescriptor, model);
+ String string = null;
+ if (path != null) {
+ string = path.toString();
+ }
+ if (string != null) {
+ valueText.setText(string);
+ }
+ final Object fm = model;
+ final IItemPropertyDescriptor fpd = propertyDescriptor;
+ valueText.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ Object text = getEditValue(fpd, fm);
+ if (!valueText.getText().equals(text)) {
+ fpd.setPropertyValue(fm, valueText.getText());
+ }
+ }
+ });
+ }
+
public static String parseFilePath(String path) throws InvocationTargetException {
int index = path.indexOf(FILE_PRIX);
if (index != -1) {
@@ -141,42 +235,45 @@
if (file.exists()) {
path = file.getLocation().toOSString();
} else {
- throw new InvocationTargetException(new Exception(
- "File : " + path + " isn't exsit")); //$NON-NLS-1$ //$NON-NLS-2$
+ throw new InvocationTargetException(new Exception("File : " + path + " isn't exsit")); //$NON-NLS-1$ //$NON-NLS-2$
}
} else {
- throw new InvocationTargetException(new Exception(
- "This path is un-support" + path + ".")); //$NON-NLS-1$ //$NON-NLS-2$
+ throw new InvocationTargetException(new Exception("This path is un-support" + path + ".")); //$NON-NLS-1$ //$NON-NLS-2$
}
}
return path;
}
- public static Composite createSelectorFieldEditor(FormToolkit toolkit, Composite parent,
- final IItemPropertyDescriptor propertyDescriptor, Object model,
- final SmooksGraphicsExtType extType) {
- return createDialogFieldEditor(parent, toolkit, propertyDescriptor, "Browse",
- new IFieldDialog() {
- public Object open(Shell shell) {
- SelectoreSelectionDialog dialog = new SelectoreSelectionDialog(shell, extType);
- if (dialog.open() == Dialog.OK) {
- Object currentSelection = dialog.getCurrentSelection();
- SelectorAttributes sa = dialog.getSelectorAttributes();
- if (currentSelection instanceof IXMLStructuredObject) {
- String s = SmooksUIUtils.generatePath(
- (IXMLStructuredObject) currentSelection, sa);
- return s;
- }
+ public static Composite createSelectorFieldEditor(FormToolkit toolkit, Composite parent, final IItemPropertyDescriptor propertyDescriptor,
+ Object model, final SmooksGraphicsExtType extType) {
+ return createDialogFieldEditor(parent, toolkit, propertyDescriptor, "Browse", new IFieldDialog() {
+ public Object open(Shell shell) {
+ SelectoreSelectionDialog dialog = new SelectoreSelectionDialog(shell, extType);
+ if (dialog.open() == Dialog.OK) {
+ Object currentSelection = dialog.getCurrentSelection();
+ SelectorAttributes sa = dialog.getSelectorAttributes();
+ if (currentSelection instanceof IXMLStructuredObject) {
+ String s = SmooksUIUtils.generatePath((IXMLStructuredObject) currentSelection, sa);
+ return s;
}
- return null;
}
+ return null;
+ }
- }, (EObject) model);
+ public IModelProcsser getModelProcesser() {
+ return null;
+ }
+
+ public void setModelProcesser(IModelProcsser processer) {
+
+ }
+
+ }, (EObject) model);
}
public static SmooksGraphicsExtType loadSmooksGraphicsExt(IFile file) throws IOException {
- Resource resource = new SmooksGraphicsExtResourceFactoryImpl().createResource(URI
- .createPlatformResourceURI(file.getFullPath().toPortableString(), false));
+ Resource resource = new SmooksGraphicsExtResourceFactoryImpl().createResource(URI.createPlatformResourceURI(file.getFullPath()
+ .toPortableString(), false));
resource.load(Collections.emptyMap());
if (resource.getContents().size() > 0) {
Object obj = resource.getContents().get(0);
@@ -187,15 +284,13 @@
return null;
}
- public static void createCDATAFieldEditor(String label,
- AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit, Composite parent,
- Object model) {
+ public static void createCDATAFieldEditor(String label, AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit, Composite parent,
+ Object model) {
Label label1 = toolkit.createLabel(parent, label + " :");
GridData gd = new GridData(GridData.VERTICAL_ALIGN_BEGINNING);
label1.setLayoutData(gd);
gd = new GridData(GridData.FILL_HORIZONTAL);
- final Text cdataText = toolkit.createText(parent, "", SWT.MULTI | SWT.H_SCROLL
- | SWT.V_SCROLL);
+ final Text cdataText = toolkit.createText(parent, "", SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.heightHint = 300;
cdataText.setLayoutData(gd);
@@ -215,22 +310,19 @@
}
String text = SmooksModelUtils.getAnyTypeCDATA((AnyType) fm);
if (!cdataText.getText().equals(text)) {
- SmooksModelUtils.setCDATAToSmooksType(fEditingDomain, (AnyType) fm, cdataText
- .getText());
+ SmooksModelUtils.setCDATAToSmooksType(fEditingDomain, (AnyType) fm, cdataText.getText());
}
}
});
}
- public static void createCommentFieldEditor(String label,
- AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit, Composite parent,
- Object model) {
+ public static void createCommentFieldEditor(String label, AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit, Composite parent,
+ Object model) {
Label label1 = toolkit.createLabel(parent, label + " :");
GridData gd = new GridData(GridData.VERTICAL_ALIGN_BEGINNING);
label1.setLayoutData(gd);
gd = new GridData(GridData.FILL_HORIZONTAL);
- final Text cdataText = toolkit.createText(parent, "", SWT.MULTI | SWT.H_SCROLL
- | SWT.V_SCROLL);
+ final Text cdataText = toolkit.createText(parent, "", SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.heightHint = 300;
cdataText.setLayoutData(gd);
@@ -250,23 +342,21 @@
}
String text = SmooksModelUtils.getAnyTypeCDATA((AnyType) fm);
if (!cdataText.getText().equals(text)) {
- SmooksModelUtils.setCommentToSmooksType(fEditingDomain, (AnyType) fm, cdataText
- .getText());
+ SmooksModelUtils.setCommentToSmooksType(fEditingDomain, (AnyType) fm, cdataText.getText());
}
}
});
}
- public static Composite createJavaTypeSearchFieldEditor(Composite parent, FormToolkit toolkit,
- final IItemPropertyDescriptor propertyDescriptor, final EObject model) {
+ public static Composite createJavaTypeSearchFieldEditor(Composite parent, FormToolkit toolkit, final IItemPropertyDescriptor propertyDescriptor,
+ final EObject model) {
if (model instanceof EObject) {
final Resource resource = ((EObject) model).eResource();
URI uri = resource.getURI();
IResource workspaceResource = null;
if (uri.isPlatformResource()) {
String path = uri.toPlatformString(true);
- workspaceResource = ResourcesPlugin.getWorkspace().getRoot().findMember(
- new Path(path));
+ workspaceResource = ResourcesPlugin.getWorkspace().getRoot().findMember(new Path(path));
JavaTypeFieldDialog dialog = new JavaTypeFieldDialog(workspaceResource);
String displayName = propertyDescriptor.getDisplayName(model);
Hyperlink link = toolkit.createHyperlink(parent, displayName + " :", SWT.NONE);
@@ -277,8 +367,7 @@
fillLayout.marginHeight = 0;
fillLayout.marginWidth = 0;
classTextComposite.setLayout(fillLayout);
- final SearchComposite searchComposite = new SearchComposite(classTextComposite,
- toolkit, "Search Class", dialog, SWT.NONE);
+ final SearchComposite searchComposite = new SearchComposite(classTextComposite, toolkit, "Search Class", dialog, SWT.NONE);
Object editValue = getEditValue(propertyDescriptor, model);
if (editValue != null) {
searchComposite.getText().setText(editValue.toString());
@@ -287,20 +376,16 @@
public void modifyText(ModifyEvent e) {
Object value = propertyDescriptor.getPropertyValue(model);
if (value != null && value instanceof PropertyValueWrapper) {
- Object editValue = ((PropertyValueWrapper) value)
- .getEditableValue(model);
+ Object editValue = ((PropertyValueWrapper) value).getEditableValue(model);
if (editValue != null) {
if (!editValue.equals(searchComposite.getText().getText())) {
- propertyDescriptor.setPropertyValue(model, searchComposite
- .getText().getText());
+ propertyDescriptor.setPropertyValue(model, searchComposite.getText().getText());
}
} else {
- propertyDescriptor.setPropertyValue(model, searchComposite
- .getText().getText());
+ propertyDescriptor.setPropertyValue(model, searchComposite.getText().getText());
}
} else {
- propertyDescriptor.setPropertyValue(model, searchComposite.getText()
- .getText());
+ propertyDescriptor.setPropertyValue(model, searchComposite.getText().getText());
}
}
});
@@ -309,17 +394,17 @@
public void linkActivated(HyperlinkEvent e) {
try {
- if (fresource == null) return;
+ if (fresource == null)
+ return;
if (fresource.getProject().hasNature(JavaCore.NATURE_ID)) {
IJavaProject javaProject = JavaCore.create(fresource.getProject());
String typeName = searchComposite.getText().getText();
IJavaElement result = javaProject.findType(typeName);
- if (result != null) JavaUI.openInEditor(result);
+ if (result != null)
+ JavaUI.openInEditor(result);
else {
- MessageDialog.openInformation(classTextComposite.getShell(),
- "Can't find type", "Can't find type \"" + typeName
- + "\" in \"" + javaProject.getProject().getName()
- + "\" project.");
+ MessageDialog.openInformation(classTextComposite.getShell(), "Can't find type", "Can't find type \"" + typeName
+ + "\" in \"" + javaProject.getProject().getName() + "\" project.");
}
}
} catch (PartInitException ex) {
@@ -368,17 +453,15 @@
return null;
}
- public static Composite createJavaMethodSearchFieldEditor(BindingsType container,
- Composite parent, FormToolkit toolkit, final IItemPropertyDescriptor propertyDescriptor,
- String buttonName, final EObject model) {
+ public static Composite createJavaMethodSearchFieldEditor(BindingsType container, Composite parent, FormToolkit toolkit,
+ final IItemPropertyDescriptor propertyDescriptor, String buttonName, final EObject model) {
String classString = ((BindingsType) container).getClass_();
IJavaProject project = getJavaProject(container);
try {
ProjectClassLoader classLoader = new ProjectClassLoader(project);
Class<?> clazz = classLoader.loadClass(classString);
JavaMethodsSelectionDialog dialog = new JavaMethodsSelectionDialog(project, clazz);
- return SmooksUIUtils.createDialogFieldEditor(parent, toolkit, propertyDescriptor,
- "Select method", dialog, (EObject) model);
+ return SmooksUIUtils.createDialogFieldEditor(parent, toolkit, propertyDescriptor, "Select method", dialog, (EObject) model);
} catch (Exception e) {
// ignore
}
@@ -391,8 +474,10 @@
public static IXMLStructuredObject getRootParent(IXMLStructuredObject child) {
IXMLStructuredObject parent = child.getParent();
- if (child.isRootNode()) return child;
- if (parent == null || parent.isRootNode()) return child;
+ if (child.isRootNode())
+ return child;
+ if (parent == null || parent.isRootNode())
+ return child;
IXMLStructuredObject temp = parent;
while (temp != null && !temp.isRootNode()) {
parent = temp;
@@ -401,12 +486,13 @@
return parent;
}
- public static String generatePath(IXMLStructuredObject node,
- SelectorAttributes selectorAttributes) {
+ public static String generatePath(IXMLStructuredObject node, SelectorAttributes selectorAttributes) {
String sperator = selectorAttributes.getSelectorSperator();
String policy = selectorAttributes.getSelectorPolicy();
- if (sperator == null) sperator = " ";
- if (policy == null) policy = SelectorAttributes.FULL_PATH;
+ if (sperator == null)
+ sperator = " ";
+ if (policy == null)
+ policy = SelectorAttributes.FULL_PATH;
if (policy.equals(SelectorAttributes.FULL_PATH)) {
return generateFullPath(node, sperator);
}
@@ -422,8 +508,7 @@
return generateFullPath(node, sperator);
}
- public static String generatePath(IXMLStructuredObject startNode,
- IXMLStructuredObject stopNode, final String sperator, boolean includeContext) {
+ public static String generatePath(IXMLStructuredObject startNode, IXMLStructuredObject stopNode, final String sperator, boolean includeContext) {
String name = "";
if (startNode == stopNode) {
return startNode.getNodeName();
@@ -451,17 +536,15 @@
return name.trim();
}
- public static Composite createJavaPropertySearchFieldEditor(BindingsType container,
- Composite parent, FormToolkit toolkit, final IItemPropertyDescriptor propertyDescriptor,
- String buttonName, final EObject model) {
+ public static Composite createJavaPropertySearchFieldEditor(BindingsType container, Composite parent, FormToolkit toolkit,
+ final IItemPropertyDescriptor propertyDescriptor, String buttonName, final EObject model) {
String classString = ((BindingsType) container).getClass_();
IJavaProject project = getJavaProject(container);
try {
ProjectClassLoader classLoader = new ProjectClassLoader(project);
Class<?> clazz = classLoader.loadClass(classString);
JavaPropertiesSelectionDialog dialog = new JavaPropertiesSelectionDialog(project, clazz);
- return SmooksUIUtils.createDialogFieldEditor(parent, toolkit, propertyDescriptor,
- "Select property", dialog, (EObject) model);
+ return SmooksUIUtils.createDialogFieldEditor(parent, toolkit, propertyDescriptor, "Select property", dialog, (EObject) model);
} catch (Exception e) {
// ignore
}
@@ -477,19 +560,19 @@
return null;
}
- public static Composite createDialogFieldEditor(Composite parent, FormToolkit toolkit,
- final IItemPropertyDescriptor propertyDescriptor, String buttonName, IFieldDialog dialog,
- final EObject model) {
+ public static Composite createDialogFieldEditor(Composite parent, FormToolkit toolkit, final IItemPropertyDescriptor propertyDescriptor,
+ String buttonName, IFieldDialog dialog, final EObject model) {
return createDialogFieldEditor(parent, toolkit, propertyDescriptor, buttonName, dialog, model, false, null);
}
- public static Composite createDialogFieldEditor(Composite parent, FormToolkit toolkit,
- final IItemPropertyDescriptor propertyDescriptor, String buttonName, IFieldDialog dialog,
- final EObject model, boolean labelLink, IHyperlinkListener listener) {
+
+ public static Composite createDialogFieldEditor(Composite parent, FormToolkit toolkit, final IItemPropertyDescriptor propertyDescriptor,
+ String buttonName, IFieldDialog dialog, final EObject model, boolean labelLink, IHyperlinkListener listener) {
+
String displayName = propertyDescriptor.getDisplayName(model);
if (labelLink) {
- Hyperlink link = toolkit.createHyperlink(parent, displayName + " :", SWT.NONE);
- if(listener != null){
+ Hyperlink link = toolkit.createHyperlink(parent, displayName + " :", SWT.NONE);
+ if (listener != null) {
link.addHyperlinkListener(listener);
}
} else {
@@ -502,28 +585,21 @@
fillLayout.marginHeight = 0;
fillLayout.marginWidth = 0;
classTextComposite.setLayout(fillLayout);
- final SearchComposite searchComposite = new SearchComposite(classTextComposite, toolkit,
- buttonName, dialog, SWT.NONE);
+ final SearchComposite searchComposite = new SearchComposite(classTextComposite, toolkit, buttonName, dialog, SWT.NONE);
Object editValue = getEditValue(propertyDescriptor, model);
if (editValue != null) {
searchComposite.getText().setText(editValue.toString());
}
searchComposite.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
- Object value = propertyDescriptor.getPropertyValue(model);
- if (value != null && value instanceof PropertyValueWrapper) {
- Object editValue = ((PropertyValueWrapper) value).getEditableValue(model);
- if (editValue != null) {
- if (!editValue.equals(searchComposite.getText().getText())) {
- propertyDescriptor.setPropertyValue(model, searchComposite.getText()
- .getText());
- }
- } else {
- propertyDescriptor.setPropertyValue(model, searchComposite.getText()
- .getText());
+ Object editValue = getEditValue(propertyDescriptor, model);
+ Object value = searchComposite.getText().getText();
+ if (editValue != null) {
+ if (!editValue.equals(value)) {
+ propertyDescriptor.setPropertyValue(model, value);
}
} else {
- propertyDescriptor.setPropertyValue(model, searchComposite.getText().getText());
+ propertyDescriptor.setPropertyValue(model, value);
}
}
});
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/AbstractFileSelectionWizardPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/AbstractFileSelectionWizardPage.java 2009-04-14 11:30:02 UTC (rev 14734)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/AbstractFileSelectionWizardPage.java 2009-04-14 13:38:48 UTC (rev 14735)
@@ -4,11 +4,13 @@
package org.jboss.tools.smooks.configuration.editors.xml;
import java.util.Collections;
+import java.util.List;
import org.eclipse.core.resources.IFile;
import org.eclipse.emf.common.ui.dialogs.WorkspaceResourceDialog;
import org.eclipse.jface.viewers.CheckboxTableViewer;
import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
@@ -41,11 +43,21 @@
protected boolean reasourceLoaded = false;
protected Button workspaceBrowseButton;
private String filePath = null;
-
- public AbstractFileSelectionWizardPage(String pageName) {
+ protected Object[] initSelections;
+ protected List<ViewerFilter> filters = null;
+ protected boolean multiSelect =false;
+
+ public AbstractFileSelectionWizardPage(String pageName,boolean multiSelect , Object[] initSelections,List<ViewerFilter> filters) {
super(pageName);
- // TODO Auto-generated constructor stub
+ this.initSelections = initSelections;
+ this.filters = filters;
+ this.multiSelect = multiSelect;
}
+
+ public AbstractFileSelectionWizardPage(String pageName){
+ this(pageName,false,null,Collections.EMPTY_LIST);
+ }
+
public Object getReturnValue() {
try {
@@ -152,7 +164,7 @@
protected void openWorkSpaceSelection(Text relationT) {
IFile[] files = WorkspaceResourceDialog.openFileSelection(getShell(),
- "Select Files", "", false, null, Collections.EMPTY_LIST); //$NON-NLS-1$ //$NON-NLS-2$
+ "Select Files", "", false, initSelections, filters); //$NON-NLS-1$ //$NON-NLS-2$
// dialog.setInitialSelections(selectedResources);
if (files.length > 0) {
IFile file = files[0];
@@ -338,4 +350,30 @@
this.selection = selection;
}
+ public Object[] getInitSelections() {
+ return initSelections;
+ }
+
+ public void setInitSelections(Object[] initSelections) {
+ this.initSelections = initSelections;
+ }
+
+ public List<ViewerFilter> getFilters() {
+ return filters;
+ }
+
+ public void setFilters(List<ViewerFilter> filters) {
+ this.filters = filters;
+ }
+
+ public boolean isMultiSelect() {
+ return multiSelect;
+ }
+
+ public void setMultiSelect(boolean multiSelect) {
+ this.multiSelect = multiSelect;
+ }
+
+
+
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xsl/TemplateUICreator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xsl/TemplateUICreator.java 2009-04-14 11:30:02 UTC (rev 14734)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xsl/TemplateUICreator.java 2009-04-14 13:38:48 UTC (rev 14735)
@@ -62,7 +62,7 @@
@Override
public void createExtendUI(AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit,
Composite parent, Object model, SmooksMultiFormEditor formEditor) {
- SmooksUIUtils.createTextFieldEditor("Value", editingdomain, toolkit, parent, model);
+ SmooksUIUtils.createMixedTextFieldEditor("Value", editingdomain, toolkit, parent, model);
SmooksUIUtils.createCDATAFieldEditor("Template Contents", editingdomain, toolkit, parent, model);
}
15 years, 8 months
JBoss Tools SVN: r14734 - in trunk/seam/plugins: org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-04-14 07:30:02 -0400 (Tue, 14 Apr 2009)
New Revision: 14734
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamRuntimeManager.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPreferenceInitializer.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4135 Fixed
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamRuntimeManager.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamRuntimeManager.java 2009-04-14 10:33:00 UTC (rev 14733)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamRuntimeManager.java 2009-04-14 11:30:02 UTC (rev 14734)
@@ -86,6 +86,27 @@
}
/**
+ * @return the latest version of installed Seam runtimes. If there are a few runtimes with the same version
+ * then the default one will be returned.
+ */
+ public SeamRuntime getLatestSeamRuntime() {
+ SeamVersion latestVersion = SeamVersion.SEAM_1_2;
+ for (SeamRuntime runtime : runtimes.values()) {
+ if(runtime.getVersion().compareTo(latestVersion)>=0) {
+ latestVersion = runtime.getVersion();
+ }
+ }
+ SeamRuntime runtime = getDefaultRuntime(latestVersion);
+ if(runtime==null) {
+ SeamRuntime[] runtimes = getRuntimes(latestVersion);
+ if(runtimes.length>0) {
+ runtime = runtimes[0];
+ }
+ }
+ return runtime;
+ }
+
+ /**
* Return array of SeamRuntimes that is compatible with given version
*
* @param version
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPreferenceInitializer.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPreferenceInitializer.java 2009-04-14 10:33:00 UTC (rev 14733)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPreferenceInitializer.java 2009-04-14 11:30:02 UTC (rev 14734)
@@ -54,7 +54,7 @@
.node(DefaultScope.SCOPE)
.node(SeamCorePlugin.PLUGIN_ID);
- node.put(SeamProjectPreferences.SEAM_CONFIG_TEMPLATE, "template.jst.seam2"); //$NON-NLS-1$
+// node.put(SeamProjectPreferences.SEAM_CONFIG_TEMPLATE, "template.jst.seam2"); //$NON-NLS-1$
node.put(SeamProjectPreferences.RUNTIME_CONFIG_FORMAT_VERSION, RUNTIME_CONFIG_FORMAT_VERSION);
node.put(SeamProjectPreferences.JBOSS_AS_DEFAULT_DEPLOY_AS, "war"); //$NON-NLS-1$
node.put(SeamProjectPreferences.HIBERNATE_DEFAULT_DB_TYPE, "HSQL"); //$NON-NLS-1$
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java 2009-04-14 10:33:00 UTC (rev 14733)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java 2009-04-14 11:30:02 UTC (rev 14734)
@@ -73,6 +73,9 @@
import org.jboss.tools.jst.web.server.RegistrationHelper;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.core.project.facet.SeamProjectPreferences;
+import org.jboss.tools.seam.core.project.facet.SeamRuntime;
+import org.jboss.tools.seam.core.project.facet.SeamRuntimeManager;
+import org.jboss.tools.seam.core.project.facet.SeamVersion;
import org.jboss.tools.seam.internal.core.project.facet.AntCopyUtils;
import org.jboss.tools.seam.internal.core.project.facet.DataSourceXmlDeployer;
import org.jboss.tools.seam.internal.core.project.facet.ISeamFacetDataModelProperties;
@@ -121,11 +124,15 @@
return firstPage;
}
+ private static final String templateJstSeam1 = "template.jst.seam"; //$NON-NLS-1$
+ private static final String templateJstSeam2 = "template.jst.seam2"; //$NON-NLS-1$
+ private static final String templateJstSeam21 = "template.jst.seam21"; //$NON-NLS-1$
+
private static final Map<String, String> templates = new HashMap<String, String>();
static {
- templates.put("jst.seam.preset", "template.jst.seam");
- templates.put("jst.seam2.preset", "template.jst.seam2");
- templates.put("jst.seam21.preset", "template.jst.seam21");
+ templates.put("jst.seam.preset", templateJstSeam1); //$NON-NLS-1$
+ templates.put("jst.seam2.preset", templateJstSeam2); //$NON-NLS-1$
+ templates.put("jst.seam21.preset", templateJstSeam21); //$NON-NLS-1$
}
private void setSeamConfigTemplate(String seamConfigTemplate) {
@@ -225,6 +232,20 @@
protected IFacetedProjectTemplate getTemplate() {
seamConfigTemplate = SeamCorePlugin.getDefault().getPluginPreferences().getString(SeamProjectPreferences.SEAM_CONFIG_TEMPLATE);
+ if(seamConfigTemplate==null || seamConfigTemplate.length()==0) {
+ SeamRuntime runtime = SeamRuntimeManager.getInstance().getLatestSeamRuntime();
+ if(runtime!=null) {
+ if(runtime.getVersion()==SeamVersion.SEAM_1_2) {
+ seamConfigTemplate = templateJstSeam1;
+ } else if(runtime.getVersion()==SeamVersion.SEAM_2_0) {
+ seamConfigTemplate = templateJstSeam2;
+ } else {
+ seamConfigTemplate = templateJstSeam21;
+ }
+ } else {
+ seamConfigTemplate = templateJstSeam21;
+ }
+ }
return ProjectFacetsManager.getTemplate(seamConfigTemplate);
}
15 years, 8 months