Author: svasilyev
Date: 2007-10-16 10:36:55 -0400 (Tue, 16 Oct 2007)
New Revision: 4234
Modified:
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.ui.palette/about.html
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/PaletteDragSourceListener.java
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/model/PaletteItem.java
Log:
Sync before merge with HEAD
Modified:
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.ui.palette/about.html
===================================================================
---
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.ui.palette/about.html 2007-10-16
14:34:22 UTC (rev 4233)
+++
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.ui.palette/about.html 2007-10-16
14:36:55 UTC (rev 4234)
@@ -1,16 +1,34 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<HTML>
+
<head>
<title>About</title>
<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
</head>
<BODY lang="EN-US">
+
<H3>About This Content</H3>
-<P>May 8, 2007</P>
+
+<P>©2007 Red Hat, Inc. All rights reserved</P>
+
<H3>License</H3>
-<P>TBD: License and link here</P>
+<P>Red Hat Inc., through its JBoss division, makes available all content in this
plug-in
+("Content"). Unless otherwise indicated below, the Content is provided to you
+under the terms and conditions of the Eclipse Public License Version 1.0
+("EPL"). A copy of the EPL is available at
+<A
href="http://www.eclipse.org/org/documents/epl-v10.php">http...;.
+For purposes of the EPL, "Program" will mean the Content.</P>
+<P>If you did not receive this Content directly from Red Hat Inc., the
+Content is being redistributed by another party ("Redistributor") and different
+terms and conditions may apply to your use of any object code in the Content.
+Check the Redistributor's license that was provided with the Content. If no such
+license exists, contact the Redistributor. Unless otherwise indicated below, the
+terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at
+ <A
href="http://www.jboss.org/tools">http://www.jboss.org/tools...
+
</BODY>
</HTML>
\ No newline at end of file
Modified:
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/PaletteDragSourceListener.java
===================================================================
---
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/PaletteDragSourceListener.java 2007-10-16
14:34:22 UTC (rev 4233)
+++
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/PaletteDragSourceListener.java 2007-10-16
14:36:55 UTC (rev 4234)
@@ -20,6 +20,7 @@
import org.jboss.tools.common.meta.action.XActionInvoker;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.plugin.ModelPlugin;
+import org.jboss.tools.common.model.ui.views.palette.PaletteInsertHelper;
import org.jboss.tools.vpe.ui.palette.model.PaletteItem;
public class PaletteDragSourceListener extends DragSourceAdapter {
@@ -52,7 +53,29 @@
}
public void dragSetData(DragSourceEvent event) {
if (TextTransfer.getInstance().isSupportedType(event.dataType)) {
+ List list = ((PaletteViewer)viewer).getSelectedEditParts();
+ XModelObject object = (list.size() == 0) ? null : getObject(list.get(0));
+ if(object != null) {
+ String[] d = new String[2];
+ d[0] = object.getAttributeValue("start text");
+ if(d[0] == null) d[0] = "";
+ d[1] = object.getAttributeValue("end text");
+ if(d[1] == null) d[1] = "";
+
+ String defaultPrefix = object.getAttributeValue("default prefix");
+ String tag = object.getAttributeValue("name");
+ if(defaultPrefix == null) {
+ defaultPrefix = object.getParent().getAttributeValue("default prefix");
+ }
+ if(defaultPrefix != null && tag != null) {
+ PaletteInsertHelper.applyPrefix(d, "", tag, "xxx",
defaultPrefix);
+ }
+ int i = d[0].indexOf('|');
+ if(i >= 0) d[0] = d[0].substring(0, i) + d[0].substring(i + 1);
+ event.data = d[0] + d[1];
+ } else {
event.data = "data"; //$NON-NLS-1$
+ }
} else {
/// event.data = new String[] {"model object"};
event.data = "model object"; //$NON-NLS-1$
Modified:
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/model/PaletteItem.java
===================================================================
---
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/model/PaletteItem.java 2007-10-16
14:34:22 UTC (rev 4233)
+++
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/model/PaletteItem.java 2007-10-16
14:36:55 UTC (rev 4234)
@@ -37,7 +37,7 @@
setLabel("" + xobject.getModelEntity().getRenderer().getTitle(xobject));
//$NON-NLS-1$
XModelObjectImageDescriptor icon = new XModelObjectImageDescriptor(xobject);
setSmallIcon(icon);
- setLargeIcon(icon);
+ setLargeIcon(new LargeImageDescriptor(xobject));
String description = xobject.getAttributeValue("description"); //$NON-NLS-1$
///XModelObjectLoaderUtil.loadFromXMLAttribute(xobject.getAttributeValue("description"));
this.description = (description != null && description.trim().length() > 0)
? description : null;