JBoss Tools SVN: r20914 - in branches/hibernatetools-multiversion/hibernatetools/plugins: org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2010-03-18 15:50:56 -0400 (Thu, 18 Mar 2010)
New Revision: 20914
Added:
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.mapper/
Modified:
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/ReverseEngineeringEditor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-6070 - update
Copied: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.mapper (from rev 20798, trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper)
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/ReverseEngineeringEditor.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/ReverseEngineeringEditor.java 2010-03-12 13:16:53 UTC (rev 20798)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/ReverseEngineeringEditor.java 2010-03-18 19:50:56 UTC (rev 20914)
@@ -37,7 +37,6 @@
import org.eclipse.wst.xml.core.internal.provisional.IXMLPreferenceNames;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
import org.hibernate.HibernateException;
-import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.Settings;
import org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy;
import org.hibernate.cfg.reveng.OverrideRepository;
@@ -199,9 +198,7 @@
}
ITableFilter[] tableFilters = getReverseEngineeringDefinition().getTableFilters();
- Configuration cfg = configuration.buildWith(null, false);
- Settings settings = configuration.getSettings(cfg);
-
+ Settings settings = configuration.getSettings2();
OverrideRepository repository = new OverrideRepository();///*settings.getDefaultCatalogName(),settings.getDefaultSchemaName()*/);
boolean hasIncludes = false;
for (int i = 0; i < tableFilters.length; i++) {
14 years, 6 months
JBoss Tools SVN: r20912 - trunk/documentation/whatsnew/vpe.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2010-03-18 14:20:00 -0400 (Thu, 18 Mar 2010)
New Revision: 20912
Modified:
trunk/documentation/whatsnew/vpe/vpe-news-2.0.0.cr1.html
trunk/documentation/whatsnew/vpe/vpe-news-2.1.0.CR1.html
trunk/documentation/whatsnew/vpe/vpe-news-2.1.0.beta1.html
trunk/documentation/whatsnew/vpe/vpe-news-3.0.0.Alpha1.html
trunk/documentation/whatsnew/vpe/vpe-news-3.0.0.Beta1.html
trunk/documentation/whatsnew/vpe/vpe-news-3.0.0.CR1.html
trunk/documentation/whatsnew/vpe/vpe-news-3.0.0.CR2.html
trunk/documentation/whatsnew/vpe/vpe-news-3.0.0.GA-full.html
trunk/documentation/whatsnew/vpe/vpe-news-3.0.0.GA.html
trunk/documentation/whatsnew/vpe/vpe-news-3.1.0.M1.html
trunk/documentation/whatsnew/vpe/vpe-news-3.1.0.M2.html
trunk/documentation/whatsnew/vpe/vpe-news-3.1.0.M3.html
Log:
text/html property has been added to html files
Property changes on: trunk/documentation/whatsnew/vpe/vpe-news-2.0.0.cr1.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: trunk/documentation/whatsnew/vpe/vpe-news-2.1.0.CR1.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: trunk/documentation/whatsnew/vpe/vpe-news-2.1.0.beta1.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: trunk/documentation/whatsnew/vpe/vpe-news-3.0.0.Alpha1.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: trunk/documentation/whatsnew/vpe/vpe-news-3.0.0.Beta1.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: trunk/documentation/whatsnew/vpe/vpe-news-3.0.0.CR1.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: trunk/documentation/whatsnew/vpe/vpe-news-3.0.0.CR2.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: trunk/documentation/whatsnew/vpe/vpe-news-3.0.0.GA-full.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: trunk/documentation/whatsnew/vpe/vpe-news-3.0.0.GA.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: trunk/documentation/whatsnew/vpe/vpe-news-3.1.0.M1.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: trunk/documentation/whatsnew/vpe/vpe-news-3.1.0.M2.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Property changes on: trunk/documentation/whatsnew/vpe/vpe-news-3.1.0.M3.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
14 years, 6 months
JBoss Tools SVN: r20911 - in trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe: editor and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2010-03-18 13:32:16 -0400 (Thu, 18 Mar 2010)
New Revision: 20911
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/VpeDnD.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/listener/MozillaDndListener.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5042
Enhance DnD support in VPE
VPE Refactoring in progress.
- All methods of VpeDnD.DndVpeController have been moved to VpeDnD.
- VpeController now uses VpeDnD via MozillaDndListener interface.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/VpeDnD.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/VpeDnD.java 2010-03-18 17:24:42 UTC (rev 20910)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/VpeDnD.java 2010-03-18 17:32:16 UTC (rev 20911)
@@ -13,13 +13,11 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.swt.dnd.Clipboard;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.widgets.Display;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.options.PreferenceModelUtilities;
import org.jboss.tools.common.model.ui.dnd.ModelTransfer;
-import org.jboss.tools.common.model.ui.editor.IModelObjectEditorInput;
import org.jboss.tools.common.model.ui.editors.dnd.DropCommandFactory;
import org.jboss.tools.common.model.ui.editors.dnd.DropData;
import org.jboss.tools.common.model.ui.editors.dnd.DropUtils;
@@ -70,42 +68,75 @@
* @author Max Areshkau
* @author Yahor Radtsevich (yradtsevich)
*
- *Class which response for drag and drop functionality
+ * Class responsible for Drag&Drop functionality
*/
-public class VpeDnD {
- /*
- * Default transfer data
- */
+public class VpeDnD implements MozillaDndListener {
+ /*
+ * Default transfer data
+ */
private static final String VPE_ELEMENT = ""; //$NON-NLS-1$
/**
* service manager */
private nsIServiceManager serviceManager;
-
+
/**
* component manager
*/
private nsIComponentManager componentManager;
-
+
/**
* drag service
*/
private nsIDragService dragService;
private VpeController vpeController;
- private DndVpeController dndController;
+ private VpeVisualInnerDragInfo innerDragInfo = null;
- // XXX temp method
- public DndVpeController getDndController() {
- return dndController;
- }
-
public VpeDnD(VpeController vpeController) {
this.vpeController = vpeController;
- this.dndController = new DndVpeController();
}
-
+
+ public void dragGesture(nsIDOMEvent domEvent) {
+ nsIDOMMouseEvent mouseEvent = (nsIDOMMouseEvent) domEvent
+ .queryInterface(nsIDOMMouseEvent.NS_IDOMMOUSEEVENT_IID);
+ boolean canDragFlag = canInnerDrag(mouseEvent);
+ // start drag sessionvpe-element
+ if (canDragFlag) {
+ startDragSession(domEvent);
+ }
+ }
+
/**
+ * Calls when drag over event ocure
+ * @param event
+ */
+ public void dragOver(nsIDOMEvent event) {
+ final nsIDOMMouseEvent mouseEvent =
+ (nsIDOMMouseEvent) event.queryInterface(nsIDOMMouseEvent.NS_IDOMMOUSEEVENT_IID);
+ final XulRunnerEditor editor = vpeController.getXulRunnerEditor();
+ new ScrollingSupport(editor).scroll(mouseEvent);
+ refreshCanDrop(event);
+ vpeController.onRefresh();
+ }
+
+ /**
+ * Drop Event handler
+ * @param domEvent
+ * @param vpeController
+ */
+ public void dragDrop(nsIDOMEvent domEvent) {
+ if(getDragService().getCurrentSession().getSourceDocument()==null) {
+ //in this case it's is external drag
+ externalDrop((nsIDOMMouseEvent)domEvent.queryInterface(nsIDOMMouseEvent.NS_IDOMMOUSEEVENT_IID), VpeController.MODEL_FLAVOR, ""); //$NON-NLS-1$
+ } else {
+ // in this case it's is an internal drag
+ innerDrop((nsIDOMMouseEvent)domEvent.queryInterface(nsIDOMMouseEvent.NS_IDOMMOUSEEVENT_IID));
+ }
+ vpeController.onRefresh();
+ }
+
+ /**
* Starts drag session
* @param dragetElement
*/
@@ -123,7 +154,7 @@
domEvent.preventDefault();
}
-
+
/**
* Creates transferable object to start drag session
*
@@ -151,6 +182,7 @@
return iTransferable;
}
+
/**
* @return the componentManager
*/
@@ -188,17 +220,6 @@
}
return dragService;
}
- /**
- * Calls when drag over event ocure
- * @param event
- */
- public void dragOver(nsIDOMEvent event) {
- final nsIDOMMouseEvent mouseEvent =
- (nsIDOMMouseEvent) event.queryInterface(nsIDOMMouseEvent.NS_IDOMMOUSEEVENT_IID);
- final XulRunnerEditor editor = vpeController.getXulRunnerEditor();
- new ScrollingSupport(editor).scroll(mouseEvent);
- refreshCanDrop(event);
- }
private void refreshCanDrop(nsIDOMEvent event) {
boolean canDrop = true;
@@ -210,10 +231,10 @@
if(getDragService().getCurrentSession().getSourceNode()==null){
//external drag
- info = dndController.canExternalDrop(mouseEvent, VpeController.MODEL_FLAVOR, ""); //$NON-NLS-1$
+ info = canExternalDrop(mouseEvent, VpeController.MODEL_FLAVOR, ""); //$NON-NLS-1$
} else {
//internal drag
- info = dndController.canInnerDrop(mouseEvent);
+ info = canInnerDrop(mouseEvent);
}
if (info != null) {
canDrop = info.canDrop();
@@ -244,203 +265,366 @@
mouseEvent.preventDefault();
mouseEvent.stopPropagation();
}
- /**
- * Drop Event handler
- * @param domEvent
- * @param vpeController
- */
- public void dragDrop(nsIDOMEvent domEvent) {
- if(getDragService().getCurrentSession().getSourceDocument()==null) {
- //in this case it's is external drag
- dndController.externalDrop((nsIDOMMouseEvent)domEvent.queryInterface(nsIDOMMouseEvent.NS_IDOMMOUSEEVENT_IID), VpeController.MODEL_FLAVOR, ""); //$NON-NLS-1$
- } else {
- // in this case it's is an internal drag
- dndController.innerDrop((nsIDOMMouseEvent)domEvent.queryInterface(nsIDOMMouseEvent.NS_IDOMMOUSEEVENT_IID));
+
+ public void externalDropAny(final String flavor, final String data, final Point range,
+ Node container) {
+ if (flavor == null || flavor.length() == 0)
+ return;
+ IDropCommand dropCommand = DropCommandFactory.getInstance()
+ .getDropCommand(flavor, JSPTagProposalFactory.getInstance());
+
+ boolean promptAttributes = JspEditorPlugin.getDefault()
+ .getPreferenceStore().getBoolean(
+ IVpePreferencesPage.ASK_TAG_ATTRIBUTES_ON_TAG_INSERT);
+ dropCommand.getDefaultModel().setPromptForTagAttributesRequired(
+ promptAttributes);
+ DropData dropData = new DropData(flavor, data,
+ vpeController.getSourceEditor().getEditorInput(),
+ (ISourceViewer) vpeController.getSourceEditor().getAdapter(ISourceViewer.class),
+ vpeController.new VpeSelectionProvider(range.x, range.y),
+ container);
+
+ /*
+ * https://jira.jboss.org/jira/browse/JBIDE-4982 Setting the value
+ * provider to create tag insert dialog.
+ */
+ if (vpeController.getSourceEditor() instanceof JSPTextEditor) {
+ dropData.setValueProvider(((JSPTextEditor) vpeController.getSourceEditor())
+ .createAttributeDescriptorValueProvider());
}
+
+ dropCommand.execute(dropData);
}
- /**
- *
- * @author Yahor Radtsevich (yradtsevich): moved methods from the
- * {@link VpeController} here
- */
- public class DndVpeController implements MozillaDndListener {
- private VpeVisualInnerDragInfo innerDragInfo = null;
-
- public void dragGesture(nsIDOMEvent domEvent) {
- nsIDOMMouseEvent mouseEvent = (nsIDOMMouseEvent) domEvent
- .queryInterface(nsIDOMMouseEvent.NS_IDOMMOUSEEVENT_IID);
- boolean canDragFlag = canInnerDrag(mouseEvent);
- // start drag sessionvpe-element
- if (canDragFlag) {
-
- startDragSession(domEvent);
+ public boolean canInnerDrag(nsIDOMMouseEvent event) {
+ vpeController.onHideTooltip();
+
+ if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
+ System.out.print("<<<<<< canInnerDrag"); //$NON-NLS-1$
+ }
+ if (innerDragInfo != null) {
+ innerDragInfo.release();
+ innerDragInfo = null;
+ }
+ boolean canDrag = false;
+ VpeVisualInnerDragInfo dragInfo = vpeController.getSelectionBuilder()
+ .getInnerDragInfo(event);
+ if (dragInfo != null) {
+ nsIDOMNode dragNode = dragInfo.getNode();
+ if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
+ System.out
+ .print(" dragNode: " + dragNode.getNodeName() + "(" + dragNode + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
+ switch (dragNode.getNodeType()) {
+ case nsIDOMNode.ELEMENT_NODE: {
+ canDrag = vpeController.getVisualBuilder().canInnerDrag((nsIDOMElement) dragNode
+ .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID));
+ break;
+ }
+ case nsIDOMNode.TEXT_NODE: {
+ canDrag = vpeController.getVisualBuilder().isTextEditable(dragNode);
+ break;
+ }
+ }
+ if (canDrag) {
+ VpeSourceInnerDragInfo sourceInnerDragInfo = vpeController.getVisualBuilder()
+ .getSourceInnerDragInfo(dragInfo);
+ if (sourceInnerDragInfo.getNode() != null) {
+ innerDragInfo = dragInfo;
+ InnerDragBuffer.object = sourceInnerDragInfo.getNode();
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ InnerDragBuffer.object = null;
+ }
+ });
+ } else {
+ canDrag = false;
+ }
+ }
+ if (!canDrag) {
+ dragInfo.release();
+ }
}
-
- public void dragOver(nsIDOMEvent event) {
- VpeDnD.this.dragOver(event);
- vpeController.onRefresh();
+ if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
+ System.out.println(" canDrag: " + canDrag); //$NON-NLS-1$
}
-
- public void _dragOver(nsIDOMEvent event) {
- if (!vpeController.getSwitcher()
- .startActiveEditor(VpeController.ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL)) {
- return;
+ return canDrag;
+ }
+
+ public MozillaDropInfo canInnerDrop(nsIDOMMouseEvent event) {
+ vpeController.onHideTooltip();
+
+ if (vpeController.getDropWindow().isActive()) {
+ if (!event.getAltKey()) {
+ vpeController.getDropWindow().close();
+ } else {
+ return null;
}
- try {
- if (VpeDebug.PRINT_VISUAL_DRAGDROP_EVENT) {
- System.out.println("<<<<<<<<<<<<<<<<<<<< dragOver"); //$NON-NLS-1$
+ }
+ if (event.getAltKey()) {
+ nsIDOMNode visualNode = VisualDomUtil.getTargetNode(event);
+ Node sourceNode = vpeController.getDomMapping().getNearSourceNode(visualNode);
+ if (sourceNode != null) {
+ vpeController.getDropWindow().setActive(true);
+ vpeController.getDropWindow().setEventPosition(event.getScreenX(), event
+ .getScreenY());
+ vpeController.getDropWindow().setInitialTargetNode(sourceNode);
+ vpeController.getDropWindow().open();
+ event.stopPropagation();
+ event.preventDefault();
+ return null;
+ }
+ }
+ if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
+ System.out.print("<<<<<< canInnerDrop"); //$NON-NLS-1$
+ }
+ boolean canDrop = false;
+
+ nsIDOMNode caretParent = null;
+ long caretOffset = 0;
+ if (innerDragInfo != null) {
+ VpeVisualInnerDropInfo visualDropInfo = vpeController.getSelectionBuilder()
+ .getInnerDropInfo(event);
+ if (visualDropInfo.getDropContainer() != null) {
+ if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
+ System.out.print(" x: " //$NON-NLS-1$
+ + visualDropInfo.getMouseX()
+ + " y: " //$NON-NLS-1$
+ + visualDropInfo.getMouseY()
+ + " container: " //$NON-NLS-1$
+ + visualDropInfo.getDropContainer().getNodeName()
+ + "(" //$NON-NLS-1$
+ + visualDropInfo.getDropContainer()
+ + ") parent: " //$NON-NLS-1$
+ + visualDropInfo.getDropContainer().getParentNode()
+ .getNodeName()
+ + "(" //$NON-NLS-1$
+ + visualDropInfo.getDropContainer().getParentNode()
+ + ") offset: " //$NON-NLS-1$
+ + visualDropInfo.getDropOffset());
}
- // browser.computeDropPosition(event);
- boolean canDrop = !vpeController.getXulRunnerEditor().isMozillaDragFlavor();
+ VpeSourceInnerDragInfo sourceInnerDragInfo = vpeController.getVisualBuilder()
+ .getSourceInnerDragInfo(innerDragInfo);
+ VpeSourceInnerDropInfo sourceDropInfo = vpeController.getVisualBuilder()
+ .getSourceInnerDropInfo(sourceInnerDragInfo.getNode(),
+ visualDropInfo, true);
+ canDrop = sourceDropInfo.canDrop();
if (canDrop) {
- Clipboard clipboard = new Clipboard(Display.getCurrent());
- canDrop = clipboard.getContents(ModelTransfer.getInstance()) != null;
- }
- if (canDrop) {
- canDrop = VpeDndUtil.isDropEnabled((IModelObjectEditorInput)
- vpeController.getSourceEditor().getEditorInput());
- }
- if (canDrop) {
- VpeVisualCaretInfo caretInfo = vpeController.getSelectionBuilder()
- .getVisualCaretInfo(event);
- canDrop = caretInfo.exist();
- if (canDrop) {
- caretInfo.showCaret();
- } else {
- caretInfo.hideCaret();
+ VpeVisualInnerDropInfo newVisualDropInfo = vpeController.getVisualBuilder()
+ .getInnerDropInfo(sourceDropInfo.getContainer(),
+ sourceDropInfo.getOffset());
+ if (newVisualDropInfo != null) {
+ vpeController.getVisualBuilder().correctVisualDropPosition(
+ newVisualDropInfo, visualDropInfo);
+ caretParent = newVisualDropInfo.getDropContainer();
+ caretOffset = newVisualDropInfo.getDropOffset();
}
}
- if (!canDrop) {
- event.stopPropagation();
- event.preventDefault();
- }
- } finally {
- vpeController.getSwitcher().stopActiveEditor();
}
+ visualDropInfo.release();
}
-
- public boolean canInnerDrag(nsIDOMMouseEvent event) {
- vpeController.onHideTooltip();
-
- if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
- System.out.print("<<<<<< canInnerDrag"); //$NON-NLS-1$
- }
- if (innerDragInfo != null) {
- innerDragInfo.release();
- innerDragInfo = null;
- }
- boolean canDrag = false;
- VpeVisualInnerDragInfo dragInfo = vpeController.getSelectionBuilder()
- .getInnerDragInfo(event);
- if (dragInfo != null) {
- nsIDOMNode dragNode = dragInfo.getNode();
+ if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
+ System.out.println(" canDrop: " + canDrop); //$NON-NLS-1$
+ }
+ return new MozillaDropInfo(canDrop, caretParent, caretOffset);
+ }
+
+ public void innerDrop(nsIDOMMouseEvent event) {
+ vpeController.onHideTooltip();
+
+ if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
+ System.out.print("<<<<<< innerDrop"); //$NON-NLS-1$
+ }
+ if (innerDragInfo != null) {
+ VpeVisualInnerDropInfo visualDropInfo = vpeController.getSelectionBuilder()
+ .getInnerDropInfo(event);
+ if (visualDropInfo.getDropContainer() != null) {
if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
System.out
- .print(" dragNode: " + dragNode.getNodeName() + "(" + dragNode + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ .print(" container: " + visualDropInfo.getDropContainer().getNodeName() + //$NON-NLS-1$
+ "(" + visualDropInfo.getDropContainer() //$NON-NLS-1$
+ + ")" + //$NON-NLS-1$
+ " offset: " //$NON-NLS-1$
+ + visualDropInfo.getDropOffset());
}
- switch (dragNode.getNodeType()) {
- case nsIDOMNode.ELEMENT_NODE: {
- canDrag = vpeController.getVisualBuilder().canInnerDrag((nsIDOMElement) dragNode
- .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID));
- break;
- }
- case nsIDOMNode.TEXT_NODE: {
- canDrag = vpeController.getVisualBuilder().isTextEditable(dragNode);
- break;
- }
- }
- if (canDrag) {
- VpeSourceInnerDragInfo sourceInnerDragInfo = vpeController.getVisualBuilder()
- .getSourceInnerDragInfo(dragInfo);
- if (sourceInnerDragInfo.getNode() != null) {
- innerDragInfo = dragInfo;
- InnerDragBuffer.object = sourceInnerDragInfo.getNode();
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- InnerDragBuffer.object = null;
- }
- });
- } else {
- canDrag = false;
+
+ VpeSourceInnerDragInfo sourceInnerDragInfo = vpeController.getVisualBuilder()
+ .getSourceInnerDragInfo(innerDragInfo);
+ VpeSourceInnerDropInfo sourceDropInfo = vpeController.getVisualBuilder()
+ .getSourceInnerDropInfo(sourceInnerDragInfo.getNode(),
+ visualDropInfo, true);
+ if (sourceDropInfo.canDrop()) {
+ VpeVisualInnerDropInfo newVisualDropInfo = vpeController.getVisualBuilder()
+ .getInnerDropInfo(sourceDropInfo.getContainer(),
+ sourceDropInfo.getOffset());
+ if (newVisualDropInfo != null) {
+ vpeController.getVisualBuilder().correctVisualDropPosition(
+ newVisualDropInfo, visualDropInfo);
+ sourceDropInfo.setTop(visualDropInfo.getMouseY());
+ sourceDropInfo.setLeft(visualDropInfo.getMouseX());
+ vpeController.getVisualBuilder().innerDrop(sourceInnerDragInfo,
+ sourceDropInfo);
+ if (innerDragInfo != null) {
+ innerDragInfo.release();
+ innerDragInfo = null;
+ }
}
}
- if (!canDrag) {
- dragInfo.release();
- }
}
+ }
+ if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
+ System.out.println();
+ }
+ }
+
+ public void externalDrop(nsIDOMMouseEvent mouseEvent, String flavor, String data) {
+ vpeController.onHideTooltip();
+
+ VpeVisualInnerDropInfo visualDropInfo = vpeController.getSelectionBuilder()
+ .getInnerDropInfo(mouseEvent);
+ Point range = vpeController.getSelectionBuilder().getSourceSelectionRangeAtVisualNode(
+ visualDropInfo.getDropContainer(), (int) visualDropInfo
+ .getDropOffset());
+
+ // if (MODEL_FLAVOR.equals(flavor)) {
+ // XModelObject object = PreferenceModelUtilities.getPreferenceModel()
+ // .getModelBuffer().source();
+ // if(object == null)
+
+ final DragTransferData dragTransferData = DndUtil.getDragTransferData();
+ final nsISupports aValue = dragTransferData.getValue();
+
+ String aFlavor = ""; //$NON-NLS-1$
+ if (VpeDndUtil.isNsIFileInstance(aValue)) {
+ nsIFile aFile = (nsIFile) aValue
+ .queryInterface(nsIFile.NS_IFILE_IID);
+
+ // because it is external, convert the path to URL
+ final String path = aFile.getPath();
+ data = path != null ? DropUtils.convertPathToUrl(path) : null;
+ aFlavor = DndUtil.kFileMime;
+
+ } else if (VpeDndUtil.isNsICStringInstance(aValue)) {
+ nsISupportsCString aString = (nsISupportsCString) aValue
+ .queryInterface(nsISupportsCString.NS_ISUPPORTSCSTRING_IID);
+ data = aString.getData();
+ aFlavor = DndUtil.kHTMLMime;
+ } else if (VpeDndUtil.isNsIStringInstance(aValue)) {
+ nsISupportsString aString = (nsISupportsString) aValue
+ .queryInterface(nsISupportsString.NS_ISUPPORTSSTRING_IID);
+ data = aString.getData();
+ if (VpeController.MODEL_FLAVOR.equals(dragTransferData.getFlavor())) {
+ aFlavor = dragTransferData.getFlavor();
+ } else {
+ aFlavor = DndUtil.kURLMime;
+ }
+ }
+
+ // if (object.getFileType() == XModelObject.FILE
+ // && !TLDUtil.isTaglib(object)) {
+ // flavor = "application/x-moz-file"; //$NON-NLS-1$
+ // IFile f = (IFile) EclipseResourceUtil.getResource(object);
+ // try {
+ // data = f.getLocation().toFile().toURL().toString();
+ // } catch (Exception e) {
+ // VpePlugin.getPluginLog().logError(e);
+ // }
+ // } else {
+ // String tagname = getTagName(object);
+ // if (tagname.indexOf("taglib") >= 0)tagname = "taglib"; //$NON-NLS-1$ //$NON-NLS-2$
+ // Node sourceDragNode = ((Document) getModel().getAdapter(
+ // Document.class)).createElement(tagname);
+ // if (visualDropInfo.getDropContainer() != null) {
+ // sourceDropInfo = vpeController.getVisualBuilder().getSourceInnerDropInfo(
+ // sourceDragNode, visualDropInfo, true);
+ // range = vpeController.getSelectionBuilder().getSourceSelectionRange(
+ // sourceDropInfo.getContainer(), sourceDropInfo
+ // .getOffset());
+ // }
+ // }
+
+ if (visualDropInfo.getDropContainer() != null && data != null) {
if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
- System.out.println(" canDrag: " + canDrag); //$NON-NLS-1$
+ System.out
+ .println(" drop! container: " + visualDropInfo.getDropContainer().getNodeName()); //$NON-NLS-1$
}
- return canDrag;
+ externalDropAny(aFlavor, data, range, null);
+
+ // TypedEvent tEvent = new TypedEvent(mouseEvent);
+ // tEvent.data = data;
+ // dropContext.setFlavor(aFlavor);
+ // dropContext.setMimeData(data);
+ // DnDUtil.fireDnDEvent(dropContext, textEditor, tEvent);
}
-
- public DndVpeController() {
- super();
+ }
+
+ public MozillaDropInfo canExternalDrop(nsIDOMMouseEvent mouseEvent, String flavor, String data) {
+ InnerDragBuffer.object = null;
+ vpeController.onHideTooltip();
+
+ if (vpeController.getDropWindow().isActive()) {
+ if (!mouseEvent.getAltKey()) {
+ vpeController.getDropWindow().close();
+ } else {
+ return new MozillaDropInfo(false, null, 0);
+ }
}
-
- public MozillaDropInfo canInnerDrop(nsIDOMMouseEvent event) {
- vpeController.onHideTooltip();
-
- if (vpeController.getDropWindow().isActive()) {
- if (!event.getAltKey()) {
- vpeController.getDropWindow().close();
+ if (mouseEvent.getAltKey()) {
+ nsIDOMEvent event = (nsIDOMEvent) mouseEvent
+ .queryInterface(nsIDOMEvent.NS_IDOMEVENT_IID);
+ nsIDOMNode visualNode = (nsIDOMNode) event.getTarget()
+ .queryInterface(nsIDOMNode.NS_IDOMNODE_IID);
+ Node sourceNode = vpeController.getDomMapping().getNearSourceNode(visualNode);
+ if (sourceNode != null) {
+ if (ModelTransfer.MODEL.equals(flavor)) {
+ // XModelObject object =
+ // PreferenceModelUtilities.getPreferenceModel().
+ // getModelBuffer().source();
+ // InnerDragBuffer.object = object;
} else {
- return null;
+ vpeController.getDropWindow().setFlavor(flavor);
}
+ vpeController.getDropWindow().setActive(true);
+ vpeController.getDropWindow().setEventPosition(mouseEvent.getScreenX(), mouseEvent
+ .getScreenY());
+ vpeController.getDropWindow().setInitialTargetNode(sourceNode);
+ vpeController.getDropWindow().open();
+ mouseEvent.stopPropagation();
+ mouseEvent.preventDefault();
+ return new MozillaDropInfo(false, null, 0);
}
- if (event.getAltKey()) {
- nsIDOMNode visualNode = VisualDomUtil.getTargetNode(event);
- Node sourceNode = vpeController.getDomMapping().getNearSourceNode(visualNode);
- if (sourceNode != null) {
- vpeController.getDropWindow().setActive(true);
- vpeController.getDropWindow().setEventPosition(event.getScreenX(), event
- .getScreenY());
- vpeController.getDropWindow().setInitialTargetNode(sourceNode);
- vpeController.getDropWindow().open();
- event.stopPropagation();
- event.preventDefault();
- return null;
- }
- }
- if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
- System.out.print("<<<<<< canInnerDrop"); //$NON-NLS-1$
- }
- boolean canDrop = false;
- ;
- nsIDOMNode caretParent = null;
- long caretOffset = 0;
- if (innerDragInfo != null) {
+ }
+ boolean canDrop = false;
+ nsIDOMNode caretParent = null;
+ long caretOffset = 0;
+
+ if (VpeController.MODEL_FLAVOR.equals(flavor)) {
+ XModelObject object = PreferenceModelUtilities.getPreferenceModel()
+ .getModelBuffer().source();
+ if (object.getFileType() == XModelObject.FILE
+ && !TLDUtil.isTaglib(object)) {
+ IFile f = (IFile) EclipseResourceUtil.getResource(object);
+ canDrop = f != null;
VpeVisualInnerDropInfo visualDropInfo = vpeController.getSelectionBuilder()
- .getInnerDropInfo(event);
+ .getInnerDropInfo(mouseEvent);
+ caretParent = visualDropInfo.getDropContainer();
+ caretOffset = visualDropInfo.getDropOffset();
+ } else {
+ String tagname = vpeController.getTagName(object);
+ if (tagname.indexOf("taglib") >= 0)tagname = "taglib"; //$NON-NLS-1$ //$NON-NLS-2$
+ Node sourceDragNode = ((Document) vpeController.getModel().getAdapter(
+ Document.class)).createElement(tagname);
+ VpeVisualInnerDropInfo visualDropInfo = vpeController.getSelectionBuilder()
+ .getInnerDropInfo(mouseEvent);
if (visualDropInfo.getDropContainer() != null) {
- if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
- System.out.print(" x: " //$NON-NLS-1$
- + visualDropInfo.getMouseX()
- + " y: " //$NON-NLS-1$
- + visualDropInfo.getMouseY()
- + " container: " //$NON-NLS-1$
- + visualDropInfo.getDropContainer().getNodeName()
- + "(" //$NON-NLS-1$
- + visualDropInfo.getDropContainer()
- + ") parent: " //$NON-NLS-1$
- + visualDropInfo.getDropContainer().getParentNode()
- .getNodeName()
- + "(" //$NON-NLS-1$
- + visualDropInfo.getDropContainer().getParentNode()
- + ") offset: " //$NON-NLS-1$
- + visualDropInfo.getDropOffset());
- }
- VpeSourceInnerDragInfo sourceInnerDragInfo = vpeController.getVisualBuilder()
- .getSourceInnerDragInfo(innerDragInfo);
VpeSourceInnerDropInfo sourceDropInfo = vpeController.getVisualBuilder()
- .getSourceInnerDropInfo(sourceInnerDragInfo.getNode(),
+ .getSourceInnerDropInfo(sourceDragNode,
visualDropInfo, true);
canDrop = sourceDropInfo.canDrop();
if (canDrop) {
VpeVisualInnerDropInfo newVisualDropInfo = vpeController.getVisualBuilder()
- .getInnerDropInfo(sourceDropInfo.getContainer(),
+ .getInnerDropInfo(
+ sourceDropInfo.getContainer(),
sourceDropInfo.getOffset());
if (newVisualDropInfo != null) {
vpeController.getVisualBuilder().correctVisualDropPosition(
@@ -452,284 +636,68 @@
}
visualDropInfo.release();
}
- if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
- System.out.println(" canDrop: " + canDrop); //$NON-NLS-1$
- }
- return new MozillaDropInfo(canDrop, caretParent, caretOffset);
- }
-
- public void innerDrop(nsIDOMMouseEvent event) {
- vpeController.onHideTooltip();
-
- if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
- System.out.print("<<<<<< innerDrop"); //$NON-NLS-1$
- }
- if (innerDragInfo != null) {
- VpeVisualInnerDropInfo visualDropInfo = vpeController.getSelectionBuilder()
- .getInnerDropInfo(event);
- if (visualDropInfo.getDropContainer() != null) {
- if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
- System.out
- .print(" container: " + visualDropInfo.getDropContainer().getNodeName() + //$NON-NLS-1$
- "(" + visualDropInfo.getDropContainer() //$NON-NLS-1$
- + ")" + //$NON-NLS-1$
- " offset: " //$NON-NLS-1$
- + visualDropInfo.getDropOffset());
- }
-
- VpeSourceInnerDragInfo sourceInnerDragInfo = vpeController.getVisualBuilder()
- .getSourceInnerDragInfo(innerDragInfo);
- VpeSourceInnerDropInfo sourceDropInfo = vpeController.getVisualBuilder()
- .getSourceInnerDropInfo(sourceInnerDragInfo.getNode(),
- visualDropInfo, true);
- if (sourceDropInfo.canDrop()) {
- VpeVisualInnerDropInfo newVisualDropInfo = vpeController.getVisualBuilder()
- .getInnerDropInfo(sourceDropInfo.getContainer(),
- sourceDropInfo.getOffset());
- if (newVisualDropInfo != null) {
- vpeController.getVisualBuilder().correctVisualDropPosition(
- newVisualDropInfo, visualDropInfo);
- sourceDropInfo.setTop(visualDropInfo.getMouseY());
- sourceDropInfo.setLeft(visualDropInfo.getMouseX());
- vpeController.getVisualBuilder().innerDrop(sourceInnerDragInfo,
- sourceDropInfo);
- if (innerDragInfo != null) {
- innerDragInfo.release();
- innerDragInfo = null;
- }
- }
- }
- }
- }
- if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
- System.out.println();
- }
- }
-
- public MozillaDropInfo canExternalDrop(nsIDOMMouseEvent mouseEvent, String flavor, String data) {
- InnerDragBuffer.object = null;
- vpeController.onHideTooltip();
-
- if (vpeController.getDropWindow().isActive()) {
- if (!mouseEvent.getAltKey()) {
- vpeController.getDropWindow().close();
- } else {
- return new MozillaDropInfo(false, null, 0);
- }
- }
- if (mouseEvent.getAltKey()) {
- nsIDOMEvent event = (nsIDOMEvent) mouseEvent
- .queryInterface(nsIDOMEvent.NS_IDOMEVENT_IID);
- nsIDOMNode visualNode = (nsIDOMNode) event.getTarget()
- .queryInterface(nsIDOMNode.NS_IDOMNODE_IID);
- Node sourceNode = vpeController.getDomMapping().getNearSourceNode(visualNode);
- if (sourceNode != null) {
- if (ModelTransfer.MODEL.equals(flavor)) {
- // XModelObject object =
- // PreferenceModelUtilities.getPreferenceModel().
- // getModelBuffer().source();
- // InnerDragBuffer.object = object;
- } else {
- vpeController.getDropWindow().setFlavor(flavor);
- }
- vpeController.getDropWindow().setActive(true);
- vpeController.getDropWindow().setEventPosition(mouseEvent.getScreenX(), mouseEvent
- .getScreenY());
- vpeController.getDropWindow().setInitialTargetNode(sourceNode);
- vpeController.getDropWindow().open();
- mouseEvent.stopPropagation();
- mouseEvent.preventDefault();
- return new MozillaDropInfo(false, null, 0);
- }
- }
- boolean canDrop = false;
- nsIDOMNode caretParent = null;
- long caretOffset = 0;
-
- if (VpeController.MODEL_FLAVOR.equals(flavor)) {
- XModelObject object = PreferenceModelUtilities.getPreferenceModel()
- .getModelBuffer().source();
- if (object.getFileType() == XModelObject.FILE
- && !TLDUtil.isTaglib(object)) {
- IFile f = (IFile) EclipseResourceUtil.getResource(object);
- canDrop = f != null;
- VpeVisualInnerDropInfo visualDropInfo = vpeController.getSelectionBuilder()
- .getInnerDropInfo(mouseEvent);
- caretParent = visualDropInfo.getDropContainer();
- caretOffset = visualDropInfo.getDropOffset();
- } else {
- String tagname = vpeController.getTagName(object);
- if (tagname.indexOf("taglib") >= 0)tagname = "taglib"; //$NON-NLS-1$ //$NON-NLS-2$
- Node sourceDragNode = ((Document) vpeController.getModel().getAdapter(
- Document.class)).createElement(tagname);
- VpeVisualInnerDropInfo visualDropInfo = vpeController.getSelectionBuilder()
- .getInnerDropInfo(mouseEvent);
- if (visualDropInfo.getDropContainer() != null) {
- VpeSourceInnerDropInfo sourceDropInfo = vpeController.getVisualBuilder()
- .getSourceInnerDropInfo(sourceDragNode,
- visualDropInfo, true);
- canDrop = sourceDropInfo.canDrop();
- if (canDrop) {
- VpeVisualInnerDropInfo newVisualDropInfo = vpeController.getVisualBuilder()
- .getInnerDropInfo(
- sourceDropInfo.getContainer(),
- sourceDropInfo.getOffset());
- if (newVisualDropInfo != null) {
- vpeController.getVisualBuilder().correctVisualDropPosition(
- newVisualDropInfo, visualDropInfo);
- caretParent = newVisualDropInfo.getDropContainer();
- caretOffset = newVisualDropInfo.getDropOffset();
- }
- }
- }
- visualDropInfo.release();
- }
- } else if (XulRunnerEditor.TRANS_FLAVOR_kFileMime.equals(flavor)
- || XulRunnerEditor.TRANS_FLAVOR_kURLMime.equals(flavor)) {
- VpeVisualInnerDropInfo visualDropInfo = vpeController.getSelectionBuilder()
- .getInnerDropInfo(mouseEvent);
- caretParent = visualDropInfo.getDropContainer();
- caretOffset = visualDropInfo.getDropOffset();
- canDrop = true;
-
- }
- if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
- System.out
- .println(" canDrop: " + canDrop + (canDrop ? " container: " + caretParent.getNodeName() + " offset: " + caretOffset : "")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
- return new MozillaDropInfo(canDrop, caretParent, caretOffset);
-
- }
-
- public VpeSourceInnerDropInfo canExternalDropMacro(XModelObject object, Node parentNode, int offset) {
- String tagname = vpeController.getTagName(object);
- Node sourceDragNode = ((Document) vpeController.getModel().getAdapter(Document.class))
- .createElement(tagname);
- return vpeController.getVisualBuilder().getSourceInnerDropInfo(sourceDragNode, parentNode,
- offset, false);
- }
-
- public void externalDropAny(final String flavor, final String data, final Point range,
- Node container) {
- if (flavor == null || flavor.length() == 0)
- return;
- IDropCommand dropCommand = DropCommandFactory.getInstance()
- .getDropCommand(flavor, JSPTagProposalFactory.getInstance());
-
- boolean promptAttributes = JspEditorPlugin.getDefault()
- .getPreferenceStore().getBoolean(
- IVpePreferencesPage.ASK_TAG_ATTRIBUTES_ON_TAG_INSERT);
- dropCommand.getDefaultModel().setPromptForTagAttributesRequired(
- promptAttributes);
- DropData dropData = new DropData(flavor, data,
- vpeController.getSourceEditor().getEditorInput(),
- (ISourceViewer) vpeController.getSourceEditor().getAdapter(ISourceViewer.class),
- vpeController.new VpeSelectionProvider(range.x, range.y),
- container);
-
- /*
- * https://jira.jboss.org/jira/browse/JBIDE-4982 Setting the value
- * provider to create tag insert dialog.
- */
- if (vpeController.getSourceEditor() instanceof JSPTextEditor) {
- dropData.setValueProvider(((JSPTextEditor) vpeController.getSourceEditor())
- .createAttributeDescriptorValueProvider());
- }
-
- dropCommand.execute(dropData);
- }
-
- public void externalDrop(nsIDOMMouseEvent mouseEvent, String flavor, String data) {
- vpeController.onHideTooltip();
-
+ } else if (XulRunnerEditor.TRANS_FLAVOR_kFileMime.equals(flavor)
+ || XulRunnerEditor.TRANS_FLAVOR_kURLMime.equals(flavor)) {
VpeVisualInnerDropInfo visualDropInfo = vpeController.getSelectionBuilder()
.getInnerDropInfo(mouseEvent);
- Point range = vpeController.getSelectionBuilder().getSourceSelectionRangeAtVisualNode(
- visualDropInfo.getDropContainer(), (int) visualDropInfo
- .getDropOffset());
-
- // if (MODEL_FLAVOR.equals(flavor)) {
- // XModelObject object = PreferenceModelUtilities.getPreferenceModel()
- // .getModelBuffer().source();
- // if(object == null)
-
- final DragTransferData dragTransferData = DndUtil.getDragTransferData();
- final nsISupports aValue = dragTransferData.getValue();
-
- String aFlavor = ""; //$NON-NLS-1$
- if (VpeDndUtil.isNsIFileInstance(aValue)) {
- nsIFile aFile = (nsIFile) aValue
- .queryInterface(nsIFile.NS_IFILE_IID);
-
- // because it is external, convert the path to URL
- final String path = aFile.getPath();
- data = path != null ? DropUtils.convertPathToUrl(path) : null;
- aFlavor = DndUtil.kFileMime;
-
- } else if (VpeDndUtil.isNsICStringInstance(aValue)) {
- nsISupportsCString aString = (nsISupportsCString) aValue
- .queryInterface(nsISupportsCString.NS_ISUPPORTSCSTRING_IID);
- data = aString.getData();
- aFlavor = DndUtil.kHTMLMime;
- } else if (VpeDndUtil.isNsIStringInstance(aValue)) {
- nsISupportsString aString = (nsISupportsString) aValue
- .queryInterface(nsISupportsString.NS_ISUPPORTSSTRING_IID);
- data = aString.getData();
- if (VpeController.MODEL_FLAVOR.equals(dragTransferData.getFlavor())) {
- aFlavor = dragTransferData.getFlavor();
- } else {
- aFlavor = DndUtil.kURLMime;
- }
- }
-
- // if (object.getFileType() == XModelObject.FILE
- // && !TLDUtil.isTaglib(object)) {
- // flavor = "application/x-moz-file"; //$NON-NLS-1$
- // IFile f = (IFile) EclipseResourceUtil.getResource(object);
- // try {
- // data = f.getLocation().toFile().toURL().toString();
- // } catch (Exception e) {
- // VpePlugin.getPluginLog().logError(e);
- // }
- // } else {
- // String tagname = getTagName(object);
- // if (tagname.indexOf("taglib") >= 0)tagname = "taglib"; //$NON-NLS-1$ //$NON-NLS-2$
- // Node sourceDragNode = ((Document) getModel().getAdapter(
- // Document.class)).createElement(tagname);
- // if (visualDropInfo.getDropContainer() != null) {
- // sourceDropInfo = vpeController.getVisualBuilder().getSourceInnerDropInfo(
- // sourceDragNode, visualDropInfo, true);
- // range = vpeController.getSelectionBuilder().getSourceSelectionRange(
- // sourceDropInfo.getContainer(), sourceDropInfo
- // .getOffset());
- // }
- // }
-
- if (visualDropInfo.getDropContainer() != null && data != null) {
- if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
- System.out
- .println(" drop! container: " + visualDropInfo.getDropContainer().getNodeName()); //$NON-NLS-1$
- }
- externalDropAny(aFlavor, data, range, null);
-
- // TypedEvent tEvent = new TypedEvent(mouseEvent);
- // tEvent.data = data;
- // dropContext.setFlavor(aFlavor);
- // dropContext.setMimeData(data);
- // DnDUtil.fireDnDEvent(dropContext, textEditor, tEvent);
- }
+ caretParent = visualDropInfo.getDropContainer();
+ caretOffset = visualDropInfo.getDropOffset();
+ canDrop = true;
+
}
-
- /**
- * Start drag session
- */
- public void startDragSession(nsIDOMEvent domEvent) {
- VpeDnD.this.startDragSession(domEvent);
+ if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
+ System.out
+ .println(" canDrop: " + canDrop + (canDrop ? " container: " + caretParent.getNodeName() + " offset: " + caretOffset : "")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
}
-
- public void dragDrop(nsIDOMEvent domEvent) {
- VpeDnD.this.dragDrop(domEvent);
- vpeController.onRefresh();
- }
+ return new MozillaDropInfo(canDrop, caretParent, caretOffset);
+
}
+
+// this method is never used
+// public VpeSourceInnerDropInfo canExternalDropMacro(XModelObject object, Node parentNode, int offset) {
+// String tagname = vpeController.getTagName(object);
+// Node sourceDragNode = ((Document) vpeController.getModel().getAdapter(Document.class))
+// .createElement(tagname);
+// return vpeController.getVisualBuilder().getSourceInnerDropInfo(sourceDragNode, parentNode,
+// offset, false);
+// }
+
+// this method is never used
+// public void _dragOver(nsIDOMEvent event) {
+// if (!vpeController.getSwitcher()
+// .startActiveEditor(VpeController.ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL)) {
+// return;
+// }
+// try {
+// if (VpeDebug.PRINT_VISUAL_DRAGDROP_EVENT) {
+// System.out.println("<<<<<<<<<<<<<<<<<<<< dragOver"); //$NON-NLS-1$
+// }
+// // browser.computeDropPosition(event);
+// boolean canDrop = !vpeController.getXulRunnerEditor().isMozillaDragFlavor();
+// if (canDrop) {
+// Clipboard clipboard = new Clipboard(Display.getCurrent());
+// canDrop = clipboard.getContents(ModelTransfer.getInstance()) != null;
+// }
+// if (canDrop) {
+// canDrop = VpeDndUtil.isDropEnabled((IModelObjectEditorInput)
+// vpeController.getSourceEditor().getEditorInput());
+// }
+// if (canDrop) {
+// VpeVisualCaretInfo caretInfo = vpeController.getSelectionBuilder()
+// .getVisualCaretInfo(event);
+// canDrop = caretInfo.exist();
+// if (canDrop) {
+// caretInfo.showCaret();
+// } else {
+// caretInfo.hideCaret();
+// }
+// }
+// if (!canDrop) {
+// event.stopPropagation();
+// event.preventDefault();
+// }
+// } finally {
+// vpeController.getSwitcher().stopActiveEditor();
+// }
+// }
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2010-03-18 17:24:42 UTC (rev 20910)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2010-03-18 17:32:16 UTC (rev 20911)
@@ -162,7 +162,7 @@
VpeDomMapping domMapping;
private VpeSourceDomBuilder sourceBuilder;
private VpeVisualDomBuilder visualBuilder;
- private VpeDnD dnd;
+ private MozillaDndListener dndListener;
/** @deprecated */
private VpeSelectionBuilder selectionBuilder;
// private VpeVisualKeyHandler visualKeyHandler;
@@ -242,7 +242,7 @@
VpeTemplateManager.getInstance(), sourceEditor, pageContext);
visualBuilder = new VpeVisualDomBuilder(domMapping, this, visualEditor,
pageContext);
- dnd = new VpeDnD(this);
+ dndListener = new VpeDnD(this);
pageContext.setSourceDomBuilder(sourceBuilder);
pageContext.setVisualDomBuilder(visualBuilder);
IDOMModel sourceModel = (IDOMModel) getModel();
@@ -455,7 +455,7 @@
= visualEditor.getMozillaEventAdapter();
if (mozillaEventAdapter != null) {
mozillaEventAdapter.addContextMenuListener(this);
- mozillaEventAdapter.addDndListener(dnd.getDndController());
+ mozillaEventAdapter.addDndListener(dndListener);
mozillaEventAdapter.addKeyListener(this);
mozillaEventAdapter.addMouseListener(this);
mozillaEventAdapter.addSelectionListener(this);
@@ -472,7 +472,7 @@
= visualEditor.getMozillaEventAdapter();
if (mozillaEventAdapter != null) {
mozillaEventAdapter.removeContextMenuListener(this);
- mozillaEventAdapter.removeDndListener(dnd.getDndController());
+ mozillaEventAdapter.removeDndListener(dndListener);
mozillaEventAdapter.removeKeyListener(this);
mozillaEventAdapter.removeMouseListener(this);
mozillaEventAdapter.removeSelectionListener(this);
@@ -1202,7 +1202,7 @@
XulRunnerVpeUtils.getElementBounds(
selectedElement),
VisualDomUtil.getMousePoint(mouseEvent))) {
- dnd.getDndController().dragGesture(mouseEvent);
+ dndListener.dragGesture(mouseEvent);
} else {
selectionManager.setSelection(mouseEvent);
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/listener/MozillaDndListener.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/listener/MozillaDndListener.java 2010-03-18 17:24:42 UTC (rev 20910)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/listener/MozillaDndListener.java 2010-03-18 17:32:16 UTC (rev 20911)
@@ -12,9 +12,7 @@
import java.util.EventListener;
-import org.jboss.tools.vpe.editor.mozilla.MozillaDropInfo;
import org.mozilla.interfaces.nsIDOMEvent;
-import org.mozilla.interfaces.nsIDOMMouseEvent;
/**
* Listener for Drag&Drop events.
@@ -29,22 +27,12 @@
* @param event xulrunner drag event
*/
void dragGesture(nsIDOMEvent event);
- boolean canInnerDrag(nsIDOMMouseEvent mouseEvent);
- MozillaDropInfo canInnerDrop(nsIDOMMouseEvent mouseEvent);
- void innerDrop(nsIDOMMouseEvent mouseEvent);
- void externalDrop(nsIDOMMouseEvent mouseEvent, String flavor, String data);
- void startDragSession(nsIDOMEvent domEvent);
/**
* Calls when drop event occurs
* @param domEvent
*/
void dragDrop(nsIDOMEvent domEvent);
-
- MozillaDropInfo canExternalDrop(nsIDOMMouseEvent mouseEvent,
- String flavor, String data);
-
-
// these methods are never used
// void dragEnter(nsIDOMEvent event);
// void dragExit(nsIDOMEvent event);
14 years, 6 months
JBoss Tools SVN: r20910 - trunk/smooks/docs/reference/en-US/images/reference.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2010-03-18 13:24:42 -0400 (Thu, 18 Mar 2010)
New Revision: 20910
Added:
trunk/smooks/docs/reference/en-US/images/reference/reference_14.png
trunk/smooks/docs/reference/en-US/images/reference/reference_15.png
Log:
<html><head><meta name="qrichtext" content="1" /></head><body style="font-size:9pt;font-family:Sans Serif">
<p>https://jira.jboss.org/jira/browse/JBDS-821 -added Decode Configuration section to Smooks-doc.</p>
</body></html>
Added: trunk/smooks/docs/reference/en-US/images/reference/reference_14.png
===================================================================
(Binary files differ)
Property changes on: trunk/smooks/docs/reference/en-US/images/reference/reference_14.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/smooks/docs/reference/en-US/images/reference/reference_15.png
===================================================================
(Binary files differ)
Property changes on: trunk/smooks/docs/reference/en-US/images/reference/reference_15.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
14 years, 6 months
JBoss Tools SVN: r20909 - in trunk/drools/docs/reference/en-US: images/create_new_project and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: smukhina
Date: 2010-03-18 13:23:19 -0400 (Thu, 18 Mar 2010)
New Revision: 20909
Modified:
trunk/drools/docs/reference/en-US/editors.xml
trunk/drools/docs/reference/en-US/images/create_new_project/create_new_project8.png
Log:
https://jira.jboss.org/jira/browse/JBDS-1162 Documentation issues in Drools Tools Reference Guide - fixed
Modified: trunk/drools/docs/reference/en-US/editors.xml
===================================================================
--- trunk/drools/docs/reference/en-US/editors.xml 2010-03-18 17:22:34 UTC (rev 20908)
+++ trunk/drools/docs/reference/en-US/editors.xml 2010-03-18 17:23:19 UTC (rev 20909)
@@ -1,537 +1,537 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<chapter id="editors" xreflabel="editors">
- <chapterinfo>
- <keywordset>
- <keyword>JBoss Tools</keyword>
- <keyword>Drools Tools</keyword>
- </keywordset>
- </chapterinfo>
-
- <title>Editors</title>
- <section id="dsl_editor">
- <title>DSL Editor</title>
- <para>A domain-specific language is a set of custom rules,
- that is created specifically to solve problems in a particular domain
- and is not intended to be able to solve problems outside it.
- A DSL's configuration is stored in plain text.
- </para>
- <para>In Drools this configuration is presented by <property>.dsl</property>
- files that can be created by <emphasis>right click on the project->New->Other->Drools->Domain Specific Language</emphasis>.</para>
- <para>DSL Editor is a default editor for <property>.dsl</property> files:</para>
- <figure>
- <title>DSL Editor</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/editors/editors1a.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>In the table below all the components of the DSL Editor page are described:</para>
- <table>
- <title>DSL Editor Components.</title>
- <tgroup cols="2">
- <colspec colnum="1" align="left" colwidth="1*"/>
- <colspec colnum="2" align="left" colwidth="3*"/>
-
- <thead>
- <row>
- <entry>Components</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>Description</entry>
- <entry>User's comments on a certain language message mapping</entry>
- </row>
- <row>
- <entry>Table of language message mappings</entry>
- <entry>The table is divided into 4 rows:
- <itemizedlist id="rows">
- <listitem><para><emphasis>Language Expression</emphasis> :expression you want to use as a rule</para></listitem>
- <listitem><para><emphasis>Rule Language Mapping</emphasis> :the implementation of the rules.This means that to this language expression the rule will be compiled
- by the rule engine compiler.</para></listitem>
- <listitem><para><emphasis>Object</emphasis> :name of the object</para></listitem>
- <listitem><para><emphasis>Scope</emphasis> :indicates where the expression is
- targeted: is it for the "condition" part of the rule ,"consequence" part, etc.</para></listitem>
- </itemizedlist>
- By clicking on some row's header you can sort the lines in the table according to the clicked row.
- By double clicking on the line <link linkend="edit_wizard">Edit language mapping Wizard</link> will be open.
- </entry>
- </row>
- <row>
- <entry>Expression</entry>
- <entry>Shows the language expression of the selected table line(language message mapping).</entry>
- </row>
-
- <row>
- <entry>Mapping</entry>
- <entry>Shows the rule of language mapping for the selected table line(language message mapping).</entry>
- </row>
- <row>
- <entry>Object</entry>
- <entry>Shows the object for the selected table line(language message mapping)</entry>
- </row>
-
- <row>
- <entry id="sort">Sort By</entry>
- <entry>Using this option you can change the type of lines sorting
- in the table of language message mappings.To do this select from the drop down lins the method
- of sorting you want and click <emphasis>Sort</emphasis> button.</entry>
- </row>
- <row>
- <entry>Buttons</entry>
- <entry><itemizedlist>
- <listitem><para><emphasis>Edit</emphasis> :by clicking the button users can edit
- selected in the table of language message mappings lines.For more information look
- <link linkend="edit_wizard">Edit language mapping Wizard</link>section.</para></listitem>
- <listitem><para><emphasis>Remove</emphasis> :if you click the button the selected mapping line will be deleted. </para></listitem>
- <listitem><para><emphasis>Add</emphasis> :with this button you can add new mapping lines to the table.For more information look
- <link linkend="add_wizard">Add language mapping Wizard</link>section. </para></listitem>
- <listitem><para><emphasis>Sort</emphasis> : please, for more information go <link linkend="sort">here</link></para></listitem>
- <listitem><para><emphasis>Copy</emphasis> :with this button you can add new mapping lines to the table
- in which all the information will be copied from the selected mapping line.</para></listitem>
- </itemizedlist>
- </entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- <section id="edit_wizard">
- <title>Edit language mapping Wizard</title>
- <para>This wizard can be opened by double clicking some line
- in the table of language message mappings or by clicking the <emphasis>Edit</emphasis>button.</para>
- <para>On the picture below you can see all the options,Edit language mapping Wizard allow to change.</para>
- <para>Their names as well as the meaning of the options are correspond to the <link linkend="rows">rows</link> of the table.</para>
- <figure>
- <title>Edit language mapping Wizard</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/editors/editors1c.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>To change the mapping a user should edit the otions he want and finally click <emphasis>Ok</emphasis>.</para>
- </section>
- <section id="add_wizard">
- <title>Add language mapping Wizard</title>
- <para>This wizard is equal to <link linkend="edit_wizard">Edit language mapping Wizard</link>.
- It can be opened by clicking the <emphasis>Add</emphasis> button.
- </para>
- <para>The only difference is that instead of editing the information you should enter new one.</para>
- <figure>
- <title>Add language mapping Wizard</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/editors/editors1b.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- </section>
- </section>
- <section id="ruleflow_editor">
- <title>Flow Editor</title>
- <para>Drools tools also provide some functionality to define the order in
- which rules should be executed.Ruleflow file allows you to specify
- the order in which rule sets should be evaluated using a flow chart.
- So you can define which rule sets should be evaluated in sequence or in parallel as well as
- specify conditions under which rule sets should be evaluated.</para>
- <para>Ruleflows can be set only by using the graphical flow editor which is part of the Drools plugin for Eclipse.
- Once you have set up a Drools project,you can start adding ruleflows.
- Add a ruleflow file(.rf) by clicking on the project and selecting "<emphasis>New -> Other...->Flow File</emphasis>":</para>
- <figure>
- <title>RuleFlow file creation</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/editors/editors1f.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>By default these ruleflow files (.rf) are opened in the graphical Flow editor.
- You can see it on the picture below.</para>
- <figure>
- <title>Flow Editor</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/editors/editors1g.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>The Flow editor consists of a <emphasis>palette</emphasis>, a <emphasis>canvas</emphasis>
- and an <emphasis>outline</emphasis> view. To add new elements to the canvas, select the
- element you would like to create in the palette and then add it to the canvas by clicking on the preferred location.
- </para>
- <figure>
- <title>Adding an element to the canvas</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/editors/editors1e.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>Clicking on the Select option in the palette and
- then on the element in your ruleflow allows you to
- view and set the properties of that element in the properies view.</para>
- <figure>
- <title>Properties view</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/editors/editors1d.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>Outline View is useful for big complex schemata where not all nodes are seen at one time.
- So using your Outline view you can easly navigate between parts of a schema. </para>
- <figure>
- <title>Outline view usage</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/editors/editors9.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <section>
- <title>Different types of control elements in Flow Palette</title>
- <para>Flow editor supports three types of control elements.
- They are:</para>
- <table> <title>Flow Palette Components.Part 1</title>
- <tgroup cols="3">
- <colspec colnum="1" align="left" colwidth="1*"/>
- <colspec colnum="2" align="left" colwidth="1*"/>
- <colspec colnum="3" align="left" colwidth="3*"/>
-
- <thead>
- <row>
- <entry>Component Picture</entry>
- <entry>Component Name</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry><inlinemediaobject>
- <imageobject>
- <imagedata fileref="images/editors/icon7.png"/>
- </imageobject></inlinemediaobject></entry>
- <entry>Select</entry>
- <entry>Select a node on the canvas</entry>
- </row>
- <row>
- <entry><inlinemediaobject>
- <imageobject>
- <imagedata fileref="images/editors/icon8.png"/>
- </imageobject></inlinemediaobject></entry>
- <entry>Marquee</entry>
- <entry>Is used for selecting a group of elements</entry>
- </row>
- <row>
- <entry><inlinemediaobject>
- <imageobject>
- <imagedata fileref="images/editors/icon9.png"/>
- </imageobject></inlinemediaobject></entry>
- <entry>Sequence Flow</entry>
- <entry>Use this element to join two elements on the canvas</entry>
- </row>
- </tbody>
-
- </tgroup>
- </table>
- </section>
-
- <section>
- <title>Different types of nodes in Flow Palette</title>
-
- <para>Currently, ruleflow supports seven types of nodes.
- In the table below you can find information about them:</para>
- <table> <title>Flow Palette Components.Part 2.</title>
- <tgroup cols="3">
- <colspec colnum="1" align="left" colwidth="1*"/>
- <colspec colnum="2" align="left" colwidth="1*"/>
- <colspec colnum="3" align="left" colwidth="3*"/>
-
- <thead>
- <row>
- <entry>Component Picture</entry>
- <entry>Component Name</entry>
- <entry>Description</entry>
- </row>
-
- </thead>
- <tbody>
- <row>
- <entry><inlinemediaobject>
- <imageobject>
- <imagedata fileref="images/editors/icon1.png"/>
- </imageobject></inlinemediaobject></entry>
- <entry>Start Event</entry>
- <entry>The start of the ruleflow. A ruleflow should have exactly
- one start node. The <property>Start Event</property> can not have incoming
- connections and should have one outgoing connection. Whenever the ruleflow process is started,
- the executing is started here and is automatically proceeded to the first node
- linked to this <property>Start Event</property></entry>
- </row>
- <row>
- <entry><inlinemediaobject>
- <imageobject>
- <imagedata fileref="images/editors/icon2.png"/>
- </imageobject></inlinemediaobject></entry>
- <entry>End Event</entry>
- <entry>A ruleflow file can have one or more <property>End Events</property>.
- The <property>End Event</property> node should have one incoming connection
- and can not have outgoing connections. When an end node is reached in the ruleflow,
- the ruleflow is terminated (including other remaining active nodes when parallelism
- is used).</entry>
- </row>
- <row>
- <entry><inlinemediaobject>
- <imageobject>
- <imagedata fileref="images/editors/icon3.png"/>
- </imageobject></inlinemediaobject></entry>
- <entry>Rule Task</entry>
- <entry>represents a set of rules. A <emphasis>Rule Task</emphasis> node should have one
- incoming connection and one outgoing connection.
- The <property>RuleFlowGroup</property> property which is used to specify the name of the
- ruleflow-group that represents the set of rules of this <emphasis>Rule Task</emphasis> node.
- When a <emphasis>Rule Task</emphasis> node is reached in the ruleflow, the engine will start
- executing rules that are a part of the corresponding ruleflow-group.
- Execution automatically continues to the next node when there are no
- more active rules in this ruleflow-group.
- </entry>
- </row>
- <row>
- <entry><inlinemediaobject>
- <imageobject>
- <imagedata fileref="images/editors/icon4.png"/>
- </imageobject></inlinemediaobject></entry>
- <entry>Gateway[diverge]</entry>
- <entry>allows you to create branches in your ruleflow.
- A <property>Gateway[diverge]</property> node should have one incoming connection and two or more
- outgoing connections.</entry>
- </row>
- <row>
- <entry><inlinemediaobject>
- <imageobject>
- <imagedata fileref="images/editors/icon4.png"/>
- </imageobject></inlinemediaobject></entry>
- <entry>Gateway[converge]</entry>
- <entry>allows you to synchronize multiple branches.
- A <property>Gateway[diverge]</property>node should have two or more incoming connections and one
- outgoing connection.</entry>
- </row>
- <row>
- <entry><inlinemediaobject>
- <imageobject>
- <imagedata fileref="images/editors/icon5.png"/>
- </imageobject></inlinemediaobject></entry>
- <entry>Reusable Sup-Process</entry>
- <entry>represents the invocation of another ruleflow from this ruleflow.
- A subflow node should have one incoming connection and one outgoing connection.
- It contains the property "processId" which specifies the id of the process that should be executed.
- When a <property>Reusable Sup-Process</property> node is reached in the ruleflow, the engine will start the process with the given id.
- The subflow node will only continue if that subflow process has terminated its execution.
- Note that the subflow process is started as an independent process,
- which means that the subflow process will not be terminated if this process reaches an end node.</entry>
- </row>
- <row>
- <entry><inlinemediaobject>
- <imageobject>
- <imagedata fileref="images/editors/icon6.png"/>
- </imageobject></inlinemediaobject></entry>
- <entry>Script Task</entry>
- <entry>represents an action that should be executed in this ruleflow.
- An <property>Script Task</property> node should have one incoming connection and one outgoing
- connection. It contains the property "action" which specifies the action that should be executed.
- When a <property>Script Task</property> node is reached in the ruleflow, it will execute the action and
- continue with the next node. An action should be specified as a piece of (valid)
- MVEL code. </entry>
- </row>
-
- </tbody>
- </tgroup>
- </table>
- </section>
- </section>
-
- <section id="textual_rule_editor">
- <title>The Rule Editor</title>
-
- <para>The <property>Rule editor</property> works on files that have a <emphasis>
- <property>.drl</property>
- </emphasis> (or <emphasis>
- <property>.rule</property>
- </emphasis> in the case of spreading rules across multiple rule files) extension.</para>
-
- <figure>
- <title>New Rule</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/editors/editors1.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>The editor follows the pattern of a normal text editor in eclipse, with all the normal
- features of a text editor:</para>
-
- <itemizedlist>
- <listitem>
- <para>
- <link linkend="rules_editor_content_assist">Content Assist</link>
- </para>
- </listitem>
-
- <listitem>
- <para>
- <link linkend="rules_editor_code_folding">Code Folding</link>
- </para>
- </listitem>
-
- <!-- <listitem>
- <para>
- <link linkend="rules_editor_error_reporting">Error Reporting</link>
- </para>
- </listitem>-->
-
- <listitem>
- <para>
- <link linkend="rules_editor_sync_with_outline">Synchronization with Outline
- View</link>
- </para>
- </listitem>
- </itemizedlist>
-
- <section id="rules_editor_content_assist">
- <title>Content Assist</title>
-
- <para>While working in the <property>Rule editor</property> you can get a content
- assistance the usual way by pressing <emphasis>
- <property>Ctrl + Space</property>.</emphasis></para>
-
- <para>Content Assist shows all possible keywords for the current cursor position.</para>
-
- <figure>
- <title>Content Assist Demonstration</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/editors/editors2.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>Content Assist inside of the <emphasis>
- <property>Message</property>
- </emphasis> suggests all available fields.</para>
-
- <figure>
- <title>Content Assist Demonstration</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/editors/editors3.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- </section>
-
- <section id="rules_editor_code_folding">
- <title>Code Folding</title>
-
- <para>Code folding is also available in the <property>Rule editor</property>. To
- hide/show sections of the file use the icons with minus/plus on the left vertical
- line of the editor.</para>
-
- <figure>
- <title>Code Folding</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/editors/editors4.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- </section>
-
- <!--section id="rules_editor_error_reporting">
- <title>Error Reporting</title>
-
- </section-->
-
- <section id="rules_editor_sync_with_outline">
- <title>Synchronization with Outline View</title>
-
- <para>The <property>Rule editor</property> works in synchronization with the
- <property>Outline view</property> which shows the structure of the rules,
- imports in the file and also globals and functions if the file has them.</para>
-
- <figure>
- <title>Synchronization with Outline View</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/editors/editors5.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>The view is updated on save. It provides a quick way of navigating around rules by
- names in a file which may have hundreds of rules. The items are sorted
- alphabetically by default.</para>
- </section>
-
- <section id="rete_view">
- <title>The Rete Tree View</title>
-
- <para>The <property>Rete Tree view</property> shows you the current Rete Network for
- your <emphasis>
- <property>.drl</property>
- </emphasis> file. Just click on the <emphasis>
- <property>Rete Tree tab</property>
- </emphasis> at the bottom of the <property>Rule editor</property>.</para>
-
- <figure>
- <title>Rete Tree</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/editors/editors6.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>Afterwards you can generate the current Rete Network visualization. You can push
- and pull the nodes to arrange your optimal network overview.</para>
- <para>If you got hundreds of nodes, select some of them with a frame. Then you can pull
- groups of them.</para>
-
- <figure>
- <title>Selecting the nodes in the Rete Tree with Frame</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/editors/editors7.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>You can zoom in and out the Rete tree in case not all nodes are shown in the
- current view. For this use the combo box or "+" and "-" icons on the toolbar.</para>
-
- <figure>
- <title>Rete Tree Zooming</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/editors/editors8.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <note>
- <title>Note:</title>
-
- <para>The <property>Rete Tree view</property> works only in Drools Rule Projects,
- where the Drools Builder is set in the project properties.</para>
- </note>
- <para>We hope, this guide helped you to get started with the JBoss BPMN Convert module. Besides, for additional information you are welcome on <ulink
- url="http://www.jboss.com/index.html?module=bb&op=viewforum&f=201">JBoss forum</ulink>.</para>
- </section>
-
- </section>
-
-</chapter>
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter id="editors" xreflabel="editors">
+ <chapterinfo>
+ <keywordset>
+ <keyword>JBoss Tools</keyword>
+ <keyword>Drools Tools</keyword>
+ </keywordset>
+ </chapterinfo>
+
+ <title>Editors</title>
+ <section id="dsl_editor">
+ <title>DSL Editor</title>
+ <para>A domain-specific language is a set of custom rules,
+ that is created specifically to solve problems in a particular domain
+ and is not intended to be able to solve problems outside it.
+ A DSL's configuration is stored in plain text.
+ </para>
+ <para>In Drools this configuration is presented by <property>.dsl</property>
+ files that can be created by <emphasis>right click on the project->New->Other->Drools->Domain Specific Language</emphasis>.</para>
+ <para>DSL Editor is a default editor for <property>.dsl</property> files:</para>
+ <figure>
+ <title>DSL Editor</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/editors/editors1a.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>In the table below all the components of the DSL Editor page are described:</para>
+ <table>
+ <title>DSL Editor Components.</title>
+ <tgroup cols="2">
+ <colspec colnum="1" align="left" colwidth="1*"/>
+ <colspec colnum="2" align="left" colwidth="3*"/>
+
+ <thead>
+ <row>
+ <entry>Components</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>Description</entry>
+ <entry>User's comments on a certain language message mapping</entry>
+ </row>
+ <row>
+ <entry>Table of language message mappings</entry>
+ <entry>The table is divided into 4 rows:
+ <itemizedlist id="rows">
+ <listitem><para><emphasis>Language Expression</emphasis> :expression you want to use as a rule</para></listitem>
+ <listitem><para><emphasis>Rule Language Mapping</emphasis> :the implementation of the rules.This means that to this language expression the rule will be compiled
+ by the rule engine compiler.</para></listitem>
+ <listitem><para><emphasis>Object</emphasis> :name of the object</para></listitem>
+ <listitem><para><emphasis>Scope</emphasis> :indicates where the expression is
+ targeted: is it for the "condition" part of the rule ,"consequence" part, etc.</para></listitem>
+ </itemizedlist>
+ By clicking on some row's header you can sort the lines in the table according to the clicked row.
+ By double clicking on the line <link linkend="edit_wizard">Edit language mapping Wizard</link> will be open.
+ </entry>
+ </row>
+ <row>
+ <entry>Expression</entry>
+ <entry>Shows the language expression of the selected table line(language message mapping).</entry>
+ </row>
+
+ <row>
+ <entry>Mapping</entry>
+ <entry>Shows the rule of language mapping for the selected table line(language message mapping).</entry>
+ </row>
+ <row>
+ <entry>Object</entry>
+ <entry>Shows the object for the selected table line(language message mapping)</entry>
+ </row>
+
+ <row>
+ <entry id="sort">Sort By</entry>
+ <entry>Using this option you can change the type of lines sorting
+ in the table of language message mappings. To do this select from the drop down list the method
+ of sorting you want and click <emphasis>Sort</emphasis> button.</entry>
+ </row>
+ <row>
+ <entry>Buttons</entry>
+ <entry><itemizedlist>
+ <listitem><para><emphasis>Edit</emphasis> :by clicking the button users can edit
+ selected in the table of language message mappings lines.For more information look
+ <link linkend="edit_wizard">Edit language mapping Wizard</link>section.</para></listitem>
+ <listitem><para><emphasis>Remove</emphasis> :if you click the button the selected mapping line will be deleted. </para></listitem>
+ <listitem><para><emphasis>Add</emphasis> :with this button you can add new mapping lines to the table.For more information look
+ <link linkend="add_wizard">Add language mapping Wizard</link>section. </para></listitem>
+ <listitem><para><emphasis>Sort</emphasis> : please, for more information go <link linkend="sort">here</link></para></listitem>
+ <listitem><para><emphasis>Copy</emphasis> :with this button you can add new mapping lines to the table
+ in which all the information will be copied from the selected mapping line.</para></listitem>
+ </itemizedlist>
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <section id="edit_wizard">
+ <title>Edit language mapping Wizard</title>
+ <para>This wizard can be opened by double clicking some line
+ in the table of language message mappings or by clicking the <emphasis>Edit</emphasis> button.</para>
+ <para>On the picture below you can see all the options,Edit language mapping Wizard allow to change.</para>
+ <para>Their names as well as the meaning of the options are correspond to the <link linkend="rows">rows</link> of the table.</para>
+ <figure>
+ <title>Edit language mapping Wizard</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/editors/editors1c.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>To change the mapping a user should edit the otions he want and finally click <emphasis>Ok</emphasis>.</para>
+ </section>
+ <section id="add_wizard">
+ <title>Add language mapping Wizard</title>
+ <para>This wizard is equal to <link linkend="edit_wizard">Edit language mapping Wizard</link>.
+ It can be opened by clicking the <emphasis>Add</emphasis> button.
+ </para>
+ <para>The only difference is that instead of editing the information you should enter new one.</para>
+ <figure>
+ <title>Add language mapping Wizard</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/editors/editors1b.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
+ </section>
+ <section id="ruleflow_editor">
+ <title>Flow Editor</title>
+ <para>Drools tools also provide some functionality to define the order in
+ which rules should be executed.Ruleflow file allows you to specify
+ the order in which rule sets should be evaluated using a flow chart.
+ So you can define which rule sets should be evaluated in sequence or in parallel as well as
+ specify conditions under which rule sets should be evaluated.</para>
+ <para>Ruleflows can be set only by using the graphical flow editor which is part of the Drools plugin for Eclipse.
+ Once you have set up a Drools project,you can start adding ruleflows.
+ Add a ruleflow file(.rf) by clicking on the project and selecting "<emphasis>New -> Other...->Flow File</emphasis>":</para>
+ <figure>
+ <title>RuleFlow file creation</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/editors/editors1f.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>By default these ruleflow files (.rf) are opened in the graphical Flow editor.
+ You can see it on the picture below.</para>
+ <figure>
+ <title>Flow Editor</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/editors/editors1g.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>The Flow editor consists of a <emphasis>palette</emphasis>, a <emphasis>canvas</emphasis>
+ and an <emphasis>outline</emphasis> view. To add new elements to the canvas, select the
+ element you would like to create in the palette and then add it to the canvas by clicking on the preferred location.
+ </para>
+ <figure>
+ <title>Adding an element to the canvas</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/editors/editors1e.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Clicking on the Select option in the palette and
+ then on the element in your ruleflow allows you to
+ view and set the properties of that element in the properies view.</para>
+ <figure>
+ <title>Properties view</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/editors/editors1d.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Outline View is useful for big complex schemata where not all nodes are seen at one time.
+ So using your Outline view you can easily navigate between parts of a schema. </para>
+ <figure>
+ <title>Outline view usage</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/editors/editors9.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <section>
+ <title>Different types of control elements in Flow Palette</title>
+ <para>Flow editor supports three types of control elements.
+ They are:</para>
+ <table> <title>Flow Palette Components.Part 1</title>
+ <tgroup cols="3">
+ <colspec colnum="1" align="left" colwidth="1*"/>
+ <colspec colnum="2" align="left" colwidth="1*"/>
+ <colspec colnum="3" align="left" colwidth="3*"/>
+
+ <thead>
+ <row>
+ <entry>Component Picture</entry>
+ <entry>Component Name</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><inlinemediaobject>
+ <imageobject>
+ <imagedata fileref="images/editors/icon7.png"/>
+ </imageobject></inlinemediaobject></entry>
+ <entry>Select</entry>
+ <entry>Select a node on the canvas</entry>
+ </row>
+ <row>
+ <entry><inlinemediaobject>
+ <imageobject>
+ <imagedata fileref="images/editors/icon8.png"/>
+ </imageobject></inlinemediaobject></entry>
+ <entry>Marquee</entry>
+ <entry>Is used for selecting a group of elements</entry>
+ </row>
+ <row>
+ <entry><inlinemediaobject>
+ <imageobject>
+ <imagedata fileref="images/editors/icon9.png"/>
+ </imageobject></inlinemediaobject></entry>
+ <entry>Sequence Flow</entry>
+ <entry>Use this element to join two elements on the canvas</entry>
+ </row>
+ </tbody>
+
+ </tgroup>
+ </table>
+ </section>
+
+ <section>
+ <title>Different types of nodes in Flow Palette</title>
+
+ <para>Currently, ruleflow supports seven types of nodes.
+ In the table below you can find information about them:</para>
+ <table> <title>Flow Palette Components.Part 2.</title>
+ <tgroup cols="3">
+ <colspec colnum="1" align="left" colwidth="1*"/>
+ <colspec colnum="2" align="left" colwidth="1*"/>
+ <colspec colnum="3" align="left" colwidth="3*"/>
+
+ <thead>
+ <row>
+ <entry>Component Picture</entry>
+ <entry>Component Name</entry>
+ <entry>Description</entry>
+ </row>
+
+ </thead>
+ <tbody>
+ <row>
+ <entry><inlinemediaobject>
+ <imageobject>
+ <imagedata fileref="images/editors/icon1.png"/>
+ </imageobject></inlinemediaobject></entry>
+ <entry>Start Event</entry>
+ <entry>The start of the ruleflow. A ruleflow should have exactly
+ one start node. The <property>Start Event</property> can not have incoming
+ connections and should have one outgoing connection. Whenever the ruleflow process is started,
+ the executing is started here and is automatically proceeded to the first node
+ linked to this <property>Start Event</property></entry>
+ </row>
+ <row>
+ <entry><inlinemediaobject>
+ <imageobject>
+ <imagedata fileref="images/editors/icon2.png"/>
+ </imageobject></inlinemediaobject></entry>
+ <entry>End Event</entry>
+ <entry>A ruleflow file can have one or more <property>End Events</property>.
+ The <property>End Event</property> node should have one incoming connection
+ and can not have outgoing connections. When an end node is reached in the ruleflow,
+ the ruleflow is terminated (including other remaining active nodes when parallelism
+ is used).</entry>
+ </row>
+ <row>
+ <entry><inlinemediaobject>
+ <imageobject>
+ <imagedata fileref="images/editors/icon3.png"/>
+ </imageobject></inlinemediaobject></entry>
+ <entry>Rule Task</entry>
+ <entry>represents a set of rules. A <emphasis>Rule Task</emphasis> node should have one
+ incoming connection and one outgoing connection.
+ The <property>RuleFlowGroup</property> property which is used to specify the name of the
+ ruleflow-group that represents the set of rules of this <emphasis>Rule Task</emphasis> node.
+ When a <emphasis>Rule Task</emphasis> node is reached in the ruleflow, the engine will start
+ executing rules that are a part of the corresponding ruleflow-group.
+ Execution automatically continues to the next node when there are no
+ more active rules in this ruleflow-group.
+ </entry>
+ </row>
+ <row>
+ <entry><inlinemediaobject>
+ <imageobject>
+ <imagedata fileref="images/editors/icon4.png"/>
+ </imageobject></inlinemediaobject></entry>
+ <entry>Gateway[diverge]</entry>
+ <entry>allows you to create branches in your ruleflow.
+ A <property>Gateway[diverge]</property> node should have one incoming connection and two or more
+ outgoing connections.</entry>
+ </row>
+ <row>
+ <entry><inlinemediaobject>
+ <imageobject>
+ <imagedata fileref="images/editors/icon4.png"/>
+ </imageobject></inlinemediaobject></entry>
+ <entry>Gateway[converge]</entry>
+ <entry>allows you to synchronize multiple branches.
+ A <property>Gateway[diverge]</property> node should have two or more incoming connections and one
+ outgoing connection.</entry>
+ </row>
+ <row>
+ <entry><inlinemediaobject>
+ <imageobject>
+ <imagedata fileref="images/editors/icon5.png"/>
+ </imageobject></inlinemediaobject></entry>
+ <entry>Reusable Sup-Process</entry>
+ <entry>represents the invocation of another ruleflow from this ruleflow.
+ A subflow node should have one incoming connection and one outgoing connection.
+ It contains the property "processId" which specifies the id of the process that should be executed.
+ When a <property>Reusable Sup-Process</property> node is reached in the ruleflow, the engine will start the process with the given id.
+ The subflow node will only continue if that subflow process has terminated its execution.
+ Note that the subflow process is started as an independent process,
+ which means that the subflow process will not be terminated if this process reaches an end node.</entry>
+ </row>
+ <row>
+ <entry><inlinemediaobject>
+ <imageobject>
+ <imagedata fileref="images/editors/icon6.png"/>
+ </imageobject></inlinemediaobject></entry>
+ <entry>Script Task</entry>
+ <entry>represents an action that should be executed in this ruleflow.
+ An <property>Script Task</property> node should have one incoming connection and one outgoing
+ connection. It contains the property "action" which specifies the action that should be executed.
+ When a <property>Script Task</property> node is reached in the ruleflow, it will execute the action and
+ continue with the next node. An action should be specified as a piece of (valid)
+ MVEL code. </entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+ </section>
+ </section>
+
+ <section id="textual_rule_editor">
+ <title>The Rule Editor</title>
+
+ <para>The <property>Rule editor</property> works on files that have a <emphasis>
+ <property>.drl</property>
+ </emphasis> (or <emphasis>
+ <property>.rule</property>
+ </emphasis> in the case of spreading rules across multiple rule files) extension.</para>
+
+ <figure>
+ <title>New Rule</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/editors/editors1.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>The editor follows the pattern of a normal text editor in eclipse, with all the normal
+ features of a text editor:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>
+ <link linkend="rules_editor_content_assist">Content Assist</link>
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <link linkend="rules_editor_code_folding">Code Folding</link>
+ </para>
+ </listitem>
+
+ <!-- <listitem>
+ <para>
+ <link linkend="rules_editor_error_reporting">Error Reporting</link>
+ </para>
+ </listitem>-->
+
+ <listitem>
+ <para>
+ <link linkend="rules_editor_sync_with_outline">Synchronization with Outline
+ View</link>
+ </para>
+ </listitem>
+ </itemizedlist>
+
+ <section id="rules_editor_content_assist">
+ <title>Content Assist</title>
+
+ <para>While working in the <property>Rule editor</property> you can get a content
+ assistance the usual way by pressing <emphasis>
+ <property>Ctrl + Space</property>.</emphasis></para>
+
+ <para>Content Assist shows all possible keywords for the current cursor position.</para>
+
+ <figure>
+ <title>Content Assist Demonstration</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/editors/editors2.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>Content Assist inside of the <emphasis>
+ <property>Message</property>
+ </emphasis> suggests all available fields.</para>
+
+ <figure>
+ <title>Content Assist Demonstration</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/editors/editors3.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ </section>
+
+ <section id="rules_editor_code_folding">
+ <title>Code Folding</title>
+
+ <para>Code folding is also available in the <property>Rule editor</property>. To
+ hide/show sections of the file use the icons with minus/plus on the left vertical
+ line of the editor.</para>
+
+ <figure>
+ <title>Code Folding</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/editors/editors4.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ </section>
+
+ <!--section id="rules_editor_error_reporting">
+ <title>Error Reporting</title>
+
+ </section-->
+
+ <section id="rules_editor_sync_with_outline">
+ <title>Synchronization with Outline View</title>
+
+ <para>The <property>Rule editor</property> works in synchronization with the
+ <property>Outline view</property> which shows the structure of the rules,
+ imports in the file and also globals and functions if the file has them.</para>
+
+ <figure>
+ <title>Synchronization with Outline View</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/editors/editors5.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>The view is updated on save. It provides a quick way of navigating around rules by
+ names in a file which may have hundreds of rules. The items are sorted
+ alphabetically by default.</para>
+ </section>
+
+ <section id="rete_view">
+ <title>The Rete Tree View</title>
+
+ <para>The <property>Rete Tree view</property> shows you the current Rete Network for
+ your <emphasis>
+ <property>.drl</property>
+ </emphasis> file. Just click on the <emphasis>
+ <property>Rete Tree tab</property>
+ </emphasis> at the bottom of the <property>Rule editor</property>.</para>
+
+ <figure>
+ <title>Rete Tree</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/editors/editors6.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>Afterwards you can generate the current Rete Network visualization. You can push
+ and pull the nodes to arrange your optimal network overview.</para>
+ <para>If you got hundreds of nodes, select some of them with a frame. Then you can pull
+ groups of them.</para>
+
+ <figure>
+ <title>Selecting the nodes in the Rete Tree with Frame</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/editors/editors7.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>You can zoom in and out the Rete tree in case not all nodes are shown in the
+ current view. For this use the combo box or "+" and "-" icons on the toolbar.</para>
+
+ <figure>
+ <title>Rete Tree Zooming</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/editors/editors8.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <note>
+ <title>Note:</title>
+
+ <para>The <property>Rete Tree view</property> works only in Drools Rule Projects,
+ where the Drools Builder is set in the project properties.</para>
+ </note>
+ <para>We hope, this guide helped you to get started with the JBoss BPMN Convert module. Besides, for additional information you are welcome on <ulink
+ url="http://www.jboss.com/index.html?module=bb&op=viewforum&f=201">JBoss forum</ulink>.</para>
+ </section>
+
+ </section>
+
+</chapter>
\ No newline at end of file
Modified: trunk/drools/docs/reference/en-US/images/create_new_project/create_new_project8.png
===================================================================
(Binary files differ)
14 years, 6 months
JBoss Tools SVN: r20908 - trunk/smooks/docs/reference/en-US.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2010-03-18 13:22:34 -0400 (Thu, 18 Mar 2010)
New Revision: 20908
Modified:
trunk/smooks/docs/reference/en-US/references.xml
Log:
<html><head><meta name="qrichtext" content="1" /></head><body style="font-size:9pt;font-family:Sans Serif">
<p>https://jira.jboss.org/jira/browse/JBDS-821 -added Decode Configuration section to Smooks-doc.</p>
</body></html>
Modified: trunk/smooks/docs/reference/en-US/references.xml
===================================================================
--- trunk/smooks/docs/reference/en-US/references.xml 2010-03-18 17:19:35 UTC (rev 20907)
+++ trunk/smooks/docs/reference/en-US/references.xml 2010-03-18 17:22:34 UTC (rev 20908)
@@ -637,7 +637,7 @@
</figure>
<para>
This view is fully syncronized with the canvas of <emphasis><property>Smooks Configuration Editor</property></emphasis>.
- This means that when you change selected element by click,the properties of a new element are immmediatly displayed in it.
+ This means that when you change selected element by click,the properties of a new element are immediatly displayed in it.
Using <emphasis><property>Properties View</property></emphasis> you can edit all the properties of the selected item.
</para>
<figure>
@@ -648,6 +648,82 @@
</imageobject>
</mediaobject>
</figure>
+ <section>
+ <title>Decode Configuration</title>
+ <para>Smooks tools support decode parameter configuration through the Decode tab in <emphasis>
+ <property>Properties View</property></emphasis>
+ activated by clicking the connection between input model and bean items. </para>
+ <para>On the picture below you can see an example of decode configurations
+ for mapping some Input Model Item to Date format:</para>
+ <figure>
+ <title>Decode Configuration tab in Properties View</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/reference/reference_14.png" scale="90"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <table>
+ <title>Decode Configuration tab in Properties View</title>
+ <tgroup cols="3">
+ <colspec colnum="1" align="left" colwidth="1*"/>
+ <colspec colnum="2" align="left" colwidth="3*"/>
+ <colspec colnum="3" align="left" colwidth="1*"/>
+
+ <thead>
+ <row>
+ <entry>Option</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>Decoder</entry>
+ <entry>Select from the dropdown list the type of decoder you need.
+ </entry>
+ </row>
+
+ <row>
+ <entry>Decoder Parameters</entry>
+ <entry>For most decoders <emphasis><property>Decoder Parametres table</property></emphasis> is empty.
+ But some of the decoders require configuration
+ (like Data decoder on the picture above),so you should configure them
+ by editing corresponding line in the <property>Value</property> row.
+ For example for data decoder:
+ <itemizedlist>
+ <listitem><para><property>format</property> - Date format string</para></listitem>
+ <listitem><para><property>locale country</property> - ISO Country Code.
+ Upper case two-letter code defined by ISO-3166. </para></listitem>
+ <listitem><para><property>locale language</property> - ISO Language Code.
+ Lower case two-letter code defined by ISO-639. </para></listitem>
+ </itemizedlist>
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <para>The Decoder Parameters section for EnumDecoder quite differs from other types of decoders.
+ See the picture below:</para>
+ <figure>
+ <title>EnumDecoder in Properties View</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/reference/reference_15.png" scale="90"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>The Decoder Parameters section in Properties View consists of 2 rows:</para>
+ <itemizedlist>
+ <listitem><para><property>From Data Value</property> - The lines in this row are editable.
+ You can change them according to the names of enum types you used in input file.
+ </para></listitem>
+ <listitem><para><property>To Enum Value</property> - The lines in this row are not editable.
+ Here the set of all the constants declared in mapped Enum type is listed.</para></listitem>
+ </itemizedlist>
+
+ <para>For more information about different decoder parametres read <ulink url="http://www.smooks.org/mediawiki/index.php?title=Main_Page">
+ Smooks Technology Documentation</ulink>.</para>
+ </section>
</section>
14 years, 6 months
JBoss Tools SVN: r20907 - trunk/esb/docs/esb_ref_guide/en-US.
by jbosstools-commits@lists.jboss.org
Author: smukhina
Date: 2010-03-18 13:19:35 -0400 (Thu, 18 Mar 2010)
New Revision: 20907
Modified:
trunk/esb/docs/esb_ref_guide/en-US/esb_editor.xml
trunk/esb/docs/esb_ref_guide/en-US/esb_support.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-1164
Documentation issues in ESB Tools Reference Guide - fixed
Modified: trunk/esb/docs/esb_ref_guide/en-US/esb_editor.xml
===================================================================
--- trunk/esb/docs/esb_ref_guide/en-US/esb_editor.xml 2010-03-18 15:59:15 UTC (rev 20906)
+++ trunk/esb/docs/esb_ref_guide/en-US/esb_editor.xml 2010-03-18 17:19:35 UTC (rev 20907)
@@ -12,7 +12,7 @@
<title>ESB Editor</title>
<para> ESB editor has lots of useful features, they are described in details in this chapter. In
- addition you'll get to know with how <property>ESB Editor</property> uses combined
+ addition you'll get to know how <property>ESB Editor</property> uses combined
visual and source editing of esb files.</para>
<section id="esb_file" role="updated">
@@ -195,7 +195,7 @@
</mediaobject>
</figure>
- <para>As you can see on the bath figures above, the context menu will also prompt you to
+ <para>As you can see on the both figures above, the context menu will also prompt you to
insert one of the Actions that are supplied out-of-the-box with <property>JBoss
ESB</property>. After choosing one an appeared <property>New Pre-Packed Action </property>wizard
will ask you to fill out a name field and other fields specific for each Action
Modified: trunk/esb/docs/esb_ref_guide/en-US/esb_support.xml
===================================================================
--- trunk/esb/docs/esb_ref_guide/en-US/esb_support.xml 2010-03-18 15:59:15 UTC (rev 20906)
+++ trunk/esb/docs/esb_ref_guide/en-US/esb_support.xml 2010-03-18 17:19:35 UTC (rev 20907)
@@ -1,535 +1,535 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<chapter id="esb_support" role="updated">
- <?dbhtml filename="esb_support.html"?>
- <chapterinfo>
- <keywordset>
- <keyword>JBoss Developer Studio</keyword>
- <keyword>Eclipse</keyword>
- <keyword>ESB</keyword>
- <keyword>Java</keyword>
- <keyword>JBoss</keyword>
- </keywordset>
- </chapterinfo>
-
- <title>ESB Support</title>
-
- <para>In this section we will focus on all concepts that <property>JBoss Tools</property>
- integrate for working with JBoss ESB.</para>
-
- <section>
- <title>ESB Tools Installation</title>
-
- <para>This chapter will provide you with the information on how to install
- JBoss ESB plugin into Eclipse.</para>
-
- <para>ESB Tools come as one module of JBoss Tools project. Since ESB Tools have a
- dependence on other JBoss Tools modules we recommend you to install a bundle
- of all <ulink url="http://labs.jboss.com/tools/download.html">JBoss
- Tools plug-ins</ulink>. You can find all necessary installation instructions on JBoss Wiki in the <ulink url="http://labs.jboss.com/wiki/InstallingJBossTools"
- >InstallingJBossTools</ulink> section.</para>
- </section>
-
- <section>
- <title>Creating a ESB Project</title>
- <para>In this chapter we suggest a step-by-step walk-through of creating a new
- ESB project. Let's try to create a new JBoss ESB project.</para>
-
- <para>We will show you how to use the ESB Project Creation wizard for creating a new ESB project and setting basic ESB classpath.</para>
-
- <para>Select <emphasis>
- <property>File >New > Project...</property>
- </emphasis> in the main menu bar or context menu for selected project and
- then <emphasis>
- <property>ESB > ESB Project</property>
- </emphasis> in the dialog opened:</para>
-
- <figure>
- <title>Select a Wizard dialog</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/esb_project/01_create_esb_project.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para> Clicking <emphasis>
- <property>Next</property>
- </emphasis> brings you to the JBoss ESB Project wizard page where a project name, ESB version and target JBoss Runtime are to be specified. Specify, for example, <emphasis>
- <property>helloworld</property>
- </emphasis> as a Project name and accept the default ESB version.</para>
- <figure>
- <title>JBoss ESB Project wizard</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/esb_project/02_create_esb_project.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>By clicking <emphasis>Modify</emphasis> button you can open <emphasis>Project Facets Wizard</emphasis> page,where you can select
- facets that should be enabled for this project.
- On the <emphasis>Project Facets Wizard</emphasis> page you can also configure runtime for the application</para>
- <figure>
- <title>Project Facets Wizard</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/esb_project/02a_create_esb_project.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>Next step provides you an opportunity to configure your project for building a java application</para>
-
- <para> Clicking <emphasis>
- <property>Next</property> on this form
- </emphasis> brings you to the ESB facet installation page where you can
- specify Java Source Directory and ESB Content Directory. ESB Content Directory is a folder that contains the most of
- artifacts that an ESB archive needs. You also can configure ESB libraries to the project by selecting a ESB runtime using one of the options:
- </para>
- <para>1. Use <emphasis>
- <property>Server Supplied ESB Runtime</property>
- </emphasis>
-
- </para>
- <para> 2. Select a ESB runtime from the JBoss ESB runtime list predefined in the preferences. If you choose the first option, make sure that the project has the Target JBoss Runtime set and this runtime has a ESB runtime installed.
- </para>
- <para>3. Choose ESB Config Vertion. From the version 3.1.0 JBoss ESB Tools supports three different jboss-esb.xsd versions: jbossesb-1.0.1.xsd, jbossesb-1.1.0.xsd and jbossesb-1.2.0.xsd.</para>
- <note><title>Note:</title>
- <para>If you use ESB 4.7 you should select jbossesb-1.2.0.xsd.</para></note>
- <figure>
- <title>Install ESB facet step</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/esb_project/03_create_esb_project.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>Click <emphasis>
- <property>Finish</property>
- </emphasis> and a ESB project with the default <emphasis><property>jboss-esb.xml</property></emphasis>
- will be created. </para>
-
- <figure>
- <title>The generated ESB project structure</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/esb_project/04_create_esb_project.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- </section>
-
- <section id="ESB_project_wizard" xreflabel="here">
- <title>Creating ESB Project using JBoss Tools Project Examples Wizard</title>
- <para>JBoss Tools provides a Project Example wizard that is an easy way for users to create some kinds of projects to be used as examples with some predefined structure. Let's start
- creating a ESB project using this wizard.</para>
-
- <para>Before creating a ESB project example create JBoss Runtime with name <emphasis><property>
- JBoss 4.2 Runtime</property></emphasis>, it will be used by your ESB project example. </para>
-
- <para>Select <emphasis>
- <property>File >New > Others </property>
- </emphasis> , in the main menu bar or context menu for selected project and
- then <emphasis>
- <property>JBoss Tools > Project Examples</property>
- </emphasis> in the New dialog:</para>
-
- <figure>
- <title>Select a wizard - Project Examples</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/esb_project/05_esb_project_example.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para> Clicking <emphasis>
- <property>Next</property>
- </emphasis> brings you to the wizard page where you can select a ESB project example from the example list.
- Every ESB example has two projects, one is a ESB project and another is a Java project used to test the ESB project.</para>
- <para>Here is a list of ready examples available:</para>
-
- <itemizedlist>
-
- <listitem><para><emphasis role="bold">JBoss ESB HelloWorld Example</emphasis> - demonstrates the minimal files necessary to make a basic ESB component execute as well as to prove that the ESB os properly configured.</para></listitem>
- <listitem><para><emphasis role="bold">JBoss ESB HelloWorld Action Example</emphasis> - demonstrates the use of multiple action invocations from a single configuration. You can use a single Action class and make multiple method calls or use multiple Action classes. </para></listitem>
- <listitem><para><emphasis role="bold">JBoss ESB HelloWorld File Action Example</emphasis> - demonstrates using the File gateway feature of the JBoss ESB. Files that are found in a particular directory with a particular extension are sent to a JMS queue with actions for processing.</para></listitem>
- <listitem><para><emphasis role="bold">JBoss ESB Web Service consumer1 Example</emphasis> - demonstrates how to consume a 181 Web Service in an ESB action.</para></listitem>
- <listitem><para><emphasis role="bold">JBoss ESB Web Service producer Example</emphasis> - demonstrates how to deploy a JSR181 Webservice endpoint on JBossESB using the SOAPProcessor action.</para></listitem>
- <listitem><para><emphasis role="bold">JBoss ESB Smooks CSV -> XML Example</emphasis> - demonstrates how to transform a comma separated value (CSV) file to an XML.</para></listitem>
- <listitem><para><emphasis role="bold">JBoss ESB Smooks XML -> POJO Example</emphasis> - demonstrates the use of Smooks performing a simple transformation by converting an XML file into Java POJOs.</para></listitem>
- <listitem><para><emphasis role="bold">JBoss ESB Smooks XML -> XML date-manipulation Example</emphasis> - demonstrates how to manually define and apply a Message Transformation within JBoss ESB.</para></listitem>
- <listitem><para><emphasis role="bold">JBoss ESB Smooks XML -> XML Example</emphasis> - a very basic example of how to manually define and apply a Message Transformation within JBoss ESB. It applies a very simple XSLT to a SampleOrder.xml message and prints the before and after XML to the console. </para></listitem>
-
- </itemizedlist>
-
-
-
- <para>We will take as our example <emphasis><property>JBoss ESB HelloWorld Example</property> </emphasis> ESB and Client project:</para>
-
-
- <figure>
- <title>JBoss Tools ESB Project Examples</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/esb_project/06_esb_project_example.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
-
- <para>Choose them using the Ctrl button and then click
- <emphasis><property>Finish</property></emphasis>. As a result you will get two projects created:</para>
- <figure>
- <title>JBoss ESB Project Examples: helloworld and helloworld_testclient</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/esb_project/07_esb_project_example.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para> Deploy the HelloWorld ESB project and run a test class in the client Java project to see the test result in the Console view.</para>
- </section>
-
- <section>
- <title>Deploying a ESB Project</title>
- <para>In this chapter you will see how to deploy a ESB project using the WTP deployment framework.</para>
-
- <para>Before deploying the project, open the Servers view by selecting <emphasis><property>Window > Show View > Other >
- Server > Servers</property></emphasis>,
- create a JBoss Server in the Servers view and start it, and then right click the created JBoss server,
- select <emphasis><property> </property> Add and Remove Projects</emphasis>,
- and add the ESB projects you want to deploy from the left side to the right side in the opened dialog. </para>
-
- <figure>
- <title>Add and Remove Projects</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/esb_project/08_esb_project_deploy.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>Click <emphasis><property>Finish</property> </emphasis> to add the project to the server.
- You also can drag the ESB project from the Project View to the server.</para>
-
- <figure>
- <title>Servers view</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/esb_project/09_esb_runtime_new.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>Thus, you have just added the ESB project to the JBoss server module list. Right click the JBoss Server and select <emphasis><property>Publish</property></emphasis> to publish the project on the server.
- You can check the deploying result in the Console view.</para>
- <para>The <emphasis><property>Run</property></emphasis> and <emphasis><property>Debug</property></emphasis> options work on ESB projects causing a (re)deploy for a user designated server.</para>
- <para>You can also use the "Finger touch" for a quick restart of the project without restarting the server:</para>
- <figure>
- <title>Finger Touch button</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/esb_project/23_finger_touch.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>The "Finger" touches descriptors dependent on project (i.e. web.xml for WAR, application.xml for EAR) and now it is also available for jboss-esb.xml in ESB projects.</para>
- <para>You can also deploy your ESB project as an .esb archive. Right-click on the project, choose <emphasis><property>Export</property></emphasis>:</para>
-
- <figure>
- <title>Export of ESB project</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/esb_project/24_export_button.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>Choose <emphasis><property>ESB</property></emphasis> > <emphasis><property>ESB File</property></emphasis> and click <emphasis><property>Next</property></emphasis>:</para>
-
- <figure><title>Choosing ESB File</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/esb_project/25_esb_file.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>And finally export the ESB project to the file system: choose the destination, choose the target runtime if need a specific one and make the appropriate settings for the archive. Then click <emphasis><property>Finish</property></emphasis>.</para>
-
- <figure><title>ESB Export</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/esb_project/26_esb_export.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>Your project is deployed as an .esb archive.</para>
- <para>An ESB archive can be created for ESB projects only. It is also possible to deploy an .esb archive to a JBoss AS based server with JBoss ESB installed.</para>
-
-
- </section>
-
- <section id="creating_esb_file">
- <title>Creating a ESB File</title>
- <para>In this chapter we suggest a step-by-step walk-through of creating your own
- simple file. Let's try to organize a new ESB file.</para>
-
- <para>We will show you how to use the Creation wizard for creating a new ESB file.</para>
-
- <para>At first you should open any project. Select <emphasis>
- <property>File >New > Other...</property>
- </emphasis> in the main menu bar or context menu for selected project and
- then <emphasis>
- <property>ESB > ESB File</property>
- </emphasis> in the New dialog:</para>
-
- <figure>
- <title>Select a wizard - ESB File</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/esb_support/01_create_esb.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para> Clicking <emphasis>
- <property>Next</property>
- </emphasis> brings you to the wizard page where a folder, a name and a version for the file should be specified. Choose, for example, <emphasis>
- <property>jboss-esb.xml</property>
- </emphasis> as the name and accept the selected projects folder and the default
- version.</para>
-
- <note><title>Note:</title>
- <para>From the version 3.1.0 JBoss ESB Tools supports three different jboss-esb.xsd versions: jbossesb-1.0.1.xsd, jbossesb-1.1.0.xsd and jbossesb-1.2.0.xsd.
- If you use ESB 4.7 you should select jbossesb-1.2.0.xsd.
- </para>
- </note>
- <figure>
- <title>Folder, Name and Version for ESB file</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/esb_support/02_create_esb.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>Thus, your file will be created in the selected projects folder by default. If
- you want to change the folder for your future file click <emphasis>
- <property>Browse...</property>
- </emphasis> button to set needed folder or simply type it.</para>
-
- <para>Clicking on <emphasis>
- <property>Finish</property>
- </emphasis> results in the file being generated. The wizard creates one xml
- file.</para>
-
- </section>
- <section id="creating_esb_action">
- <title>Creating a ESB Action</title>
- <para>From this chapter you will find out how to create a <emphasis><property>ESB Action Java File</property></emphasis>.</para>
- <para>At first you need to open a <property>ESB</property> or simple <property>Java</property> project. Then you should select <emphasis><property>File > New>Other</property></emphasis> in the main menu or from the context project menu. Then click <emphasis><property>ESB > ESB Action</property></emphasis> in the <emphasis><property>New </property></emphasis> dialog.</para>
- <figure>
- <title>Select a wizard - ESB Action</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/esb_support/03_create_esb.png"/>
- </imageobject>
-
- </mediaobject>
- </figure>
- <para>After that click <emphasis><property>Next</property></emphasis> and you will be brought to the <emphasis><property>New ESB Action</property></emphasis> wizard. In this wizard the class name should be specified, also you can set a package or add a interface as for any Java class.</para>
- <figure>
- <title>New ESB Action wizard</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/esb_support/04_create_esb.png"/>
- </imageobject>
-
- </mediaobject>
- </figure>
- <para>As a result, the <property>ESB Action Java File</property> will be created in the selected package and it will have <property>org.jboss.soa.esb.actions.AbstractActionPipelineProcessor </property>as superclass. </para>
- <para>Clicking on <emphasis><property>Finish</property></emphasis> will generate the <property>ESB Action</property> class. Also this class will become available in <property>ESB Editor</property> wizards.</para>
- </section>
-
- <section role="updated">
- <title>Configuring ESB Runtime in Preferences</title>
- <para>In this chapter you will know how to predefine a JBoss ESB runtime on the Preferences page.</para>
-
- <para>You may already know, there are two ways to set JBoss ESB runtime when creating a ESB project,
- one is to use the project target JBoss runtime, and another is to select a JBoss ESB runtime predefined in JBoss Tools preferences.
- Let's configure it.</para>
-
- <para>Select <emphasis>
- <property>Window >Preferences > JBoss Tools > JBoss ESB Runtime</property>
- </emphasis>, to open the JBoss ESB Runtime Preferences page where you can add, remove and Edit a JBoss ESB runtime.</para>
-
- <figure>
- <title>JBoss ESB Runtimes</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/esb_project/10_esb_runtime.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para> Select <emphasis><property>Add</property></emphasis> to open a dialog where you can specify the JBoss ESB runtime location, name and version number. It's also possible to define configuration if you point the home location to a Jboss AS or SOA-p, in case you select a standalone ESB runtime location, the configuration combo will be empty and should be ignored.
- You can also customize the libraries of the runtime by checking the <emphasis><property>Customize JBoss ESB Runtime jars</property> </emphasis> checkbox. </para>
-
- <figure>
- <title>Configure new JBoss ESB Runtime</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/esb_project/11_esb_runtime_new.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>The new JBoss ESB Runtime will be configured. Click <emphasis> <property>OK</property> </emphasis> to finish and save the preferences.
- You can use the configuration when creating a JBoss ESB project. </para>
- <para>When a ESB runtime is configured for your ESB project you are able to change it to any other using the classpath container page for ESB runtime. To do that, turn to the Package Explorer view and right-click the "JBoss ESB Runtime" library. Select <emphasis><property>Properties</property></emphasis> and a table listing all available JBoss ESB runtimes will appear:</para>
-
- <figure>
- <title>Classpath Container Page to change ESB runtime</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/esb_project/20_classpath_container.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
-
-
- <para>Choose one of them to set to the ESB project and click <emphasis><property>Ok</property></emphasis>.</para>
- <para>ESB container allows Source and JavaDoc locations to be set via the Properties dialog on each contained .jar: right-click on any .jar file, select <emphasis><property>Properties</property></emphasis>. Choose <emphasis><property>Java Source Attachment</property></emphasis> and select location (folder, JAR or zip) containing new source for the chosen .jar using one of the suggested options (workspace, external folder or file) or enter the path manually:</para>
-
- <figure>
- <title>Classpath Container: Java Source Attachment</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/esb_project/21_source.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>Click on <emphasis><property>Apply</property></emphasis> and then on <emphasis><property>Ok</property></emphasis>.</para>
- <para>To change Javadoc Location choose <emphasis><property>Javadoc Location</property></emphasis> and specify URL to the documentation generated by Javadoc. The Javadoc location will contain a file called <emphasis><property>package-list</property></emphasis>:</para>
-
- <figure>
- <title>Classpath Container: Javadoc Location</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/esb_project/22_Javadoc.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>Click on <emphasis><property>Apply</property></emphasis> and then on <emphasis><property>Ok</property></emphasis>.</para>
-
- </section>
-
-
- <section id="using_SOA">
- <title>Using and Configuring SOA Platform</title>
-
- <para>In this chapter you will know what is JBoss Enterprise SOA Platform and how you can configure it to use for your ESB projects. </para>
-
- <para>JBoss Enterprise SOA Platform delivers a flexible, standards-based platform to integrate applications, SOA services, business events and automate business processes. The SOA Platform integrates specific versions of JBoss ESB, jBPM, Drools and the JBoss Enterprise Application Platform that are certified to work together in a single supported enterprise distribution.</para>
- <para>Having configured JBoss Enterprise SOA Platform for your ESB project you don't need to install and configure ESB server and runtime as they are already included.</para>
-
- <para>Check here to find more details on the platform: <ulink url="http://www.jboss.com/products/platforms/soa">JBoss Enterprise SOA Platform</ulink> and <ulink url="http://www.jboss.com/products/platforms/soa/components">JBoss Enterprise SOA Platform Component Details</ulink>.</para>
- <para>You can find out what is SOA here: <ulink url="http://www.jboss.org/jbossesb/resources/SOABasics.html">Basics of SOA</ulink> and <ulink url="http://www.jboss.org/jbossesb/resources/SOAEOA.html">SOA and EOA</ulink>.</para>
-
- <para>To configure the JBoss Enterprise SOA platform select <emphasis>
- <property>Window > Preferences > Server > Runtime Environments</property></emphasis>, that will open the Server Runtime Environments Preferences page where you can add, remove and edit a Server Runtime Environment.</para>
-
- <figure>
- <title>Configure new Server Runtime Environment</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/esb_project/13NewServerRuntimeEnv.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>Select <emphasis><property>Add</property></emphasis>, choose <emphasis><property>JBoss 4.2 Runtime</property></emphasis> as a type of runtime environment, check the <emphasis><property>Create a new local server</property></emphasis> checkbox and click <emphasis><property>Next</property></emphasis>:</para>
- <figure>
- <title>Type of Server Runtime Environment</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/esb_project/14typeOfRuntime.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>On the next step you can specify a name of the server runtime environment and browse to its location. Click <emphasis><property>Finish</property></emphasis> to add the server runtime environment.</para>
-
-
- <figure>
- <title>New Server Runtime Environment Details</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/esb_project/15AddNew.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>Now you have your SOA platform configured. To check the configuration create a ESB Project using instructions described <xref linkend="ESB_project_wizard"/>. As a result you will have two projects created:</para>
-
- <figure>
- <title>Helloworld Projects Created</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/esb_project/16HelloworldProjects.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>Then you will need to add JBoss ESB libraries to your projects to configure the SOA server runtime exactly for your projects. Right-click on your project, select <emphasis><property>Build Path > Add Libraries</property></emphasis>:</para>
-
- <figure>
- <title>Add Libraries</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/esb_project/17_Add_new_libraries.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>Choose <emphasis><property>JBoss ESB Libraries</property></emphasis> and click <emphasis><property>Next</property></emphasis>:</para>
-
- <figure>
- <title>ESB Libraries</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/esb_project/18_select_libraries.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>Select the necessary runtime to add to the project classpath:</para>
-
-
- <figure>
- <title>Select a ESB runtime</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/esb_project/19_select_runtime.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>Click <emphasis><property>Finish</property></emphasis>.</para>
- <para>Now you can deploy your Helloworld project to the server and run a test class in the client Java project to see the test result in the Console view.</para>
-
-
-
-</section>
-
-
-
-
-
-
-
-
-
-
-</chapter>
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter id="esb_support" role="updated">
+ <?dbhtml filename="esb_support.html"?>
+ <chapterinfo>
+ <keywordset>
+ <keyword>JBoss Developer Studio</keyword>
+ <keyword>Eclipse</keyword>
+ <keyword>ESB</keyword>
+ <keyword>Java</keyword>
+ <keyword>JBoss</keyword>
+ </keywordset>
+ </chapterinfo>
+
+ <title>ESB Support</title>
+
+ <para>In this section we will focus on all concepts that <property>JBoss Tools</property>
+ integrate for working with JBoss ESB.</para>
+
+ <section>
+ <title>ESB Tools Installation</title>
+
+ <para>This chapter will provide you with the information on how to install
+ JBoss ESB plugin into Eclipse.</para>
+
+ <para>ESB Tools come as one module of JBoss Tools project. Since ESB Tools have a
+ dependence on other JBoss Tools modules we recommend you to install a bundle
+ of all <ulink url="http://labs.jboss.com/tools/download.html">JBoss
+ Tools plug-ins</ulink>. You can find all necessary installation instructions on JBoss Wiki in the <ulink url="http://labs.jboss.com/wiki/InstallingJBossTools"
+ >InstallingJBossTools</ulink> section.</para>
+ </section>
+
+ <section>
+ <title>Creating a ESB Project</title>
+ <para>In this chapter we suggest a step-by-step walk-through of creating a new
+ ESB project. Let's try to create a new JBoss ESB project.</para>
+
+ <para>We will show you how to use the ESB Project Creation wizard for creating a new ESB project and setting basic ESB classpath.</para>
+
+ <para>Select <emphasis>
+ <property>File >New > Project...</property>
+ </emphasis> in the main menu bar or context menu for selected project and
+ then <emphasis>
+ <property>ESB > ESB Project</property>
+ </emphasis> in the dialog opened:</para>
+
+ <figure>
+ <title>Select a Wizard dialog</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/esb_project/01_create_esb_project.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para> Clicking <emphasis>
+ <property>Next</property>
+ </emphasis> brings you to the JBoss ESB Project wizard page where a project name, ESB version and target JBoss Runtime are to be specified. Specify, for example, <emphasis>
+ <property>helloworld</property>
+ </emphasis> as a Project name and accept the default ESB version.</para>
+ <figure>
+ <title>JBoss ESB Project wizard</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/esb_project/02_create_esb_project.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>By clicking <emphasis>Modify</emphasis> button you can open <emphasis>Project Facets Wizard</emphasis> page,where you can select
+ facets that should be enabled for this project.
+ On the <emphasis>Project Facets Wizard</emphasis> page you can also configure runtime for the application</para>
+ <figure>
+ <title>Project Facets Wizard</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/esb_project/02a_create_esb_project.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Next step provides you an opportunity to configure your project for building a java application</para>
+
+ <para> Clicking <emphasis>
+ <property>Next</property> on this form
+ </emphasis> brings you to the ESB facet installation page where you can
+ specify Java Source Directory and ESB Content Directory. ESB Content Directory is a folder that contains the most of
+ artifacts that an ESB archive needs. You also can configure ESB libraries to the project by selecting a ESB runtime using one of the options:
+ </para>
+ <para>1. Use <emphasis>
+ <property>Server Supplied ESB Runtime</property>
+ </emphasis>
+
+ </para>
+ <para> 2. Select a ESB runtime from the JBoss ESB runtime list predefined in the preferences. If you choose the first option, make sure that the project has the Target JBoss Runtime set and this runtime has a ESB runtime installed.
+ </para>
+ <para>3. Choose ESB Config Vertion. From the version 3.1.0 JBoss ESB Tools supports three different jboss-esb.xsd versions: jbossesb-1.0.1.xsd, jbossesb-1.1.0.xsd and jbossesb-1.2.0.xsd.</para>
+ <note><title>Note:</title>
+ <para>If you use ESB 4.7 you should select jbossesb-1.2.0.xsd.</para></note>
+ <figure>
+ <title>Install ESB facet step</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/esb_project/03_create_esb_project.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Click <emphasis>
+ <property>Finish</property>
+ </emphasis> and a ESB project with the default <emphasis><property>jboss-esb.xml</property></emphasis>
+ will be created. </para>
+
+ <figure>
+ <title>The generated ESB project structure</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/esb_project/04_create_esb_project.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ </section>
+
+ <section id="ESB_project_wizard" xreflabel="here">
+ <title>Creating ESB Project using JBoss Tools Project Examples Wizard</title>
+ <para>JBoss Tools provides a Project Example wizard that is an easy way for users to create some kinds of projects to be used as examples with some predefined structure. Let's start
+ creating a ESB project using this wizard.</para>
+
+ <para>Before creating a ESB project example create JBoss Runtime with name <emphasis><property>
+ JBoss 4.2 Runtime</property></emphasis>, it will be used by your ESB project example. </para>
+
+ <para>Select <emphasis>
+ <property>File >New > Others </property>
+ </emphasis> , in the main menu bar or context menu for selected project and
+ then <emphasis>
+ <property>JBoss Tools > Project Examples</property>
+ </emphasis> in the New dialog:</para>
+
+ <figure>
+ <title>Select a wizard - Project Examples</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/esb_project/05_esb_project_example.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para> Clicking <emphasis>
+ <property>Next</property>
+ </emphasis> brings you to the wizard page where you can select a ESB project example from the example list.
+ Every ESB example has two projects, one is a ESB project and another is a Java project used to test the ESB project.</para>
+ <para>Here is a list of ready examples available:</para>
+
+ <itemizedlist>
+
+ <listitem><para><emphasis role="bold">JBoss ESB HelloWorld Example</emphasis> - demonstrates the minimal files necessary to make a basic ESB component execute as well as to prove that the ESB is properly configured.</para></listitem>
+ <listitem><para><emphasis role="bold">JBoss ESB HelloWorld Action Example</emphasis> - demonstrates the use of multiple action invocations from a single configuration. You can use a single Action class and make multiple method calls or use multiple Action classes. </para></listitem>
+ <listitem><para><emphasis role="bold">JBoss ESB HelloWorld File Action Example</emphasis> - demonstrates using the File gateway feature of the JBoss ESB. Files that are found in a particular directory with a particular extension are sent to a JMS queue with actions for processing.</para></listitem>
+ <listitem><para><emphasis role="bold">JBoss ESB Web Service consumer1 Example</emphasis> - demonstrates how to consume a 181 Web Service in an ESB action.</para></listitem>
+ <listitem><para><emphasis role="bold">JBoss ESB Web Service producer Example</emphasis> - demonstrates how to deploy a JSR181 Webservice endpoint on JBossESB using the SOAPProcessor action.</para></listitem>
+ <listitem><para><emphasis role="bold">JBoss ESB Smooks CSV -> XML Example</emphasis> - demonstrates how to transform a comma separated value (CSV) file to an XML.</para></listitem>
+ <listitem><para><emphasis role="bold">JBoss ESB Smooks XML -> POJO Example</emphasis> - demonstrates the use of Smooks performing a simple transformation by converting an XML file into Java POJOs.</para></listitem>
+ <listitem><para><emphasis role="bold">JBoss ESB Smooks XML -> XML date-manipulation Example</emphasis> - demonstrates how to manually define and apply a Message Transformation within JBoss ESB.</para></listitem>
+ <listitem><para><emphasis role="bold">JBoss ESB Smooks XML -> XML Example</emphasis> - a very basic example of how to manually define and apply a Message Transformation within JBoss ESB. It applies a very simple XSLT to a SampleOrder.xml message and prints the before and after XML to the console. </para></listitem>
+
+ </itemizedlist>
+
+
+
+ <para>We will take as our example <emphasis><property>JBoss ESB HelloWorld Example</property> </emphasis> ESB and Client project:</para>
+
+
+ <figure>
+ <title>JBoss Tools ESB Project Examples</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/esb_project/06_esb_project_example.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+
+ <para>Choose them using the Ctrl button and then click
+ <emphasis><property>Finish</property></emphasis>. As a result you will get two projects created:</para>
+ <figure>
+ <title>JBoss ESB Project Examples: helloworld and helloworld_testclient</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/esb_project/07_esb_project_example.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para> Deploy the HelloWorld ESB project and run a test class in the client Java project to see the test result in the Console view.</para>
+ </section>
+
+ <section>
+ <title>Deploying a ESB Project</title>
+ <para>In this chapter you will see how to deploy a ESB project using the WTP deployment framework.</para>
+
+ <para>Before deploying the project, open the JBoss Server View by selecting <emphasis><property>Window > Show View > Other >
+ Server > JBoss Server View</property></emphasis>,
+ create a JBoss Server in the Server view and start it, and then right click the created JBoss server,
+ select <emphasis><property> </property> Add and Remove Projects</emphasis>,
+ and add the ESB projects you want to deploy from the left side to the right side in the opened dialog. </para>
+
+ <figure>
+ <title>Add and Remove Projects</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/esb_project/08_esb_project_deploy.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>Click <emphasis><property>Finish</property> </emphasis> to add the project to the server.
+ You also can drag the ESB project from the Project View to the server.</para>
+
+ <figure>
+ <title>JBoss Server View</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/esb_project/09_esb_runtime_new.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>Thus, you have just added the ESB project to the JBoss server module list. Right click the JBoss Server and select <emphasis><property>Publish</property></emphasis> to publish the project on the server.
+ You can check the deploying result in the Console view.</para>
+ <para>The <emphasis><property>Run</property></emphasis> and <emphasis><property>Debug</property></emphasis> options work on ESB projects causing a (re)deploy for a user designated server.</para>
+ <para>You can also use the "Finger touch" for a quick restart of the project without restarting the server:</para>
+ <figure>
+ <title>Finger Touch button</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/esb_project/23_finger_touch.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>The "Finger" touches descriptors dependent on project (i.e. web.xml for WAR, application.xml for EAR) and now it is also available for jboss-esb.xml in ESB projects.</para>
+ <para>You can also deploy your ESB project as an .esb archive. Right-click on the project, choose <emphasis><property>Export</property></emphasis>:</para>
+
+ <figure>
+ <title>Export of ESB project</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/esb_project/24_export_button.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>Choose <emphasis><property>ESB</property></emphasis> > <emphasis><property>ESB File</property></emphasis> and click <emphasis><property>Next</property></emphasis>:</para>
+
+ <figure><title>Choosing ESB File</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/esb_project/25_esb_file.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>And finally export the ESB project to the file system: choose the destination, choose the target runtime if need a specific one and make the appropriate settings for the archive. Then click <emphasis><property>Finish</property></emphasis>.</para>
+
+ <figure><title>ESB Export</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/esb_project/26_esb_export.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>Your project is deployed as an .esb archive.</para>
+ <para>An ESB archive can be created for ESB projects only. It is also possible to deploy an .esb archive to a JBoss AS based server with JBoss ESB installed.</para>
+
+
+ </section>
+
+ <section id="creating_esb_file">
+ <title>Creating a ESB File</title>
+ <para>In this chapter we suggest a step-by-step walk-through of creating your own
+ simple file. Let's try to organize a new ESB file.</para>
+
+ <para>We will show you how to use the Creation wizard for creating a new ESB file.</para>
+
+ <para>At first you should open any project. Select <emphasis>
+ <property>File >New > Other...</property>
+ </emphasis> in the main menu bar or context menu for selected project and
+ then <emphasis>
+ <property>ESB > ESB File</property>
+ </emphasis> in the New dialog:</para>
+
+ <figure>
+ <title>Select a wizard - ESB File</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/esb_support/01_create_esb.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para> Clicking <emphasis>
+ <property>Next</property>
+ </emphasis> brings you to the wizard page where a folder, a name and a version for the file should be specified. Choose, for example, <emphasis>
+ <property>jboss-esb.xml</property>
+ </emphasis> as the name and accept the selected projects folder and the default
+ version.</para>
+
+ <note><title>Note:</title>
+ <para>From the version 3.1.0 JBoss ESB Tools supports three different jboss-esb.xsd versions: jbossesb-1.0.1.xsd, jbossesb-1.1.0.xsd and jbossesb-1.2.0.xsd.
+ If you use ESB 4.7 you should select jbossesb-1.2.0.xsd.
+ </para>
+ </note>
+ <figure>
+ <title>Folder, Name and Version for ESB file</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/esb_support/02_create_esb.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>Thus, your file will be created in the selected projects folder by default. If
+ you want to change the folder for your future file click <emphasis>
+ <property>Browse...</property>
+ </emphasis> button to set needed folder or simply type it.</para>
+
+ <para>Clicking on <emphasis>
+ <property>Finish</property>
+ </emphasis> results in the file being generated. The wizard creates one xml
+ file.</para>
+
+ </section>
+ <section id="creating_esb_action">
+ <title>Creating a ESB Action</title>
+ <para>From this chapter you will find out how to create a <emphasis><property>ESB Action Java File</property></emphasis>.</para>
+ <para>At first you need to open a <property>ESB</property> or simple <property>Java</property> project. Then you should select <emphasis><property>File > New>Other</property></emphasis> in the main menu or from the context project menu. Then click <emphasis><property>ESB > ESB Action</property></emphasis> in the <emphasis><property>New </property></emphasis> dialog.</para>
+ <figure>
+ <title>Select a wizard - ESB Action</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/esb_support/03_create_esb.png"/>
+ </imageobject>
+
+ </mediaobject>
+ </figure>
+ <para>After that click <emphasis><property>Next</property></emphasis> and you will be brought to the <emphasis><property>New ESB Action</property></emphasis> wizard. In this wizard the class name should be specified, also you can set a package or add a interface as for any Java class.</para>
+ <figure>
+ <title>New ESB Action wizard</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/esb_support/04_create_esb.png"/>
+ </imageobject>
+
+ </mediaobject>
+ </figure>
+ <para>As a result, the <property>ESB Action Java File</property> will be created in the selected package and it will have <property>org.jboss.soa.esb.actions.AbstractActionPipelineProcessor </property>as superclass. </para>
+ <para>Clicking on <emphasis><property>Finish</property></emphasis> will generate the <property>ESB Action</property> class. Also this class will become available in <property>ESB Editor</property> wizards.</para>
+ </section>
+
+ <section role="updated">
+ <title>Configuring ESB Runtime in Preferences</title>
+ <para>In this chapter you will know how to predefine a JBoss ESB runtime on the Preferences page.</para>
+
+ <para>You may already know, there are two ways to set JBoss ESB runtime when creating a ESB project,
+ one is to use the project target JBoss runtime, and another is to select a JBoss ESB runtime predefined in JBoss Tools preferences.
+ Let's configure it.</para>
+
+ <para>Select <emphasis>
+ <property>Window >Preferences > JBoss Tools > JBoss ESB Runtime</property>
+ </emphasis>, to open the JBoss ESB Runtime Preferences page where you can add, remove and Edit a JBoss ESB runtime.</para>
+
+ <figure>
+ <title>JBoss ESB Runtimes</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/esb_project/10_esb_runtime.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para> Select <emphasis><property>Add</property></emphasis> to open a dialog where you can specify the JBoss ESB runtime location, name and version number. It's also possible to define configuration if you point the home location to a Jboss AS or SOA-p, in case you select a standalone ESB runtime location, the configuration combo will be empty and should be ignored.
+ You can also customize the libraries of the runtime by checking the <emphasis><property>Customize JBoss ESB Runtime jars</property> </emphasis> checkbox. </para>
+
+ <figure>
+ <title>Configure new JBoss ESB Runtime</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/esb_project/11_esb_runtime_new.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>The new JBoss ESB Runtime will be configured. Click <emphasis> <property>OK</property> </emphasis> to finish and save the preferences.
+ You can use the configuration when creating a JBoss ESB project. </para>
+ <para>When a ESB runtime is configured for your ESB project you are able to change it to any other using the classpath container page for ESB runtime. To do that, turn to the Package Explorer view and right-click the "JBoss ESB Runtime" library. Select <emphasis><property>Properties</property></emphasis> and a table listing all available JBoss ESB runtimes will appear:</para>
+
+ <figure>
+ <title>Classpath Container Page to change ESB runtime</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/esb_project/20_classpath_container.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+
+
+ <para>Choose one of them to set to the ESB project and click <emphasis><property>Ok</property></emphasis>.</para>
+ <para>ESB container allows Source and JavaDoc locations to be set via the Properties dialog on each contained .jar: right-click on any .jar file, select <emphasis><property>Properties</property></emphasis>. Choose <emphasis><property>Java Source Attachment</property></emphasis> and select location (folder, JAR or zip) containing new source for the chosen .jar using one of the suggested options (workspace, external folder or file) or enter the path manually:</para>
+
+ <figure>
+ <title>Classpath Container: Java Source Attachment</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/esb_project/21_source.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Click on <emphasis><property>Apply</property></emphasis> and then on <emphasis><property>Ok</property></emphasis>.</para>
+ <para>To change Javadoc Location choose <emphasis><property>Javadoc Location</property></emphasis> and specify URL to the documentation generated by Javadoc. The Javadoc location will contain a file called <emphasis><property>package-list</property></emphasis>:</para>
+
+ <figure>
+ <title>Classpath Container: Javadoc Location</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/esb_project/22_Javadoc.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Click on <emphasis><property>Apply</property></emphasis> and then on <emphasis><property>Ok</property></emphasis>.</para>
+
+ </section>
+
+
+ <section id="using_SOA">
+ <title>Using and Configuring SOA Platform</title>
+
+ <para>In this chapter you will know what is JBoss Enterprise SOA Platform and how you can configure it to use for your ESB projects. </para>
+
+ <para>JBoss Enterprise SOA Platform delivers a flexible, standards-based platform to integrate applications, SOA services, business events and automate business processes. The SOA Platform integrates specific versions of JBoss ESB, jBPM, Drools and the JBoss Enterprise Application Platform that are certified to work together in a single supported enterprise distribution.</para>
+ <para>Having configured JBoss Enterprise SOA Platform for your ESB project you don't need to install and configure ESB server and runtime as they are already included.</para>
+
+ <para>Check here to find more details on the platform: <ulink url="http://www.jboss.com/products/platforms/soa">JBoss Enterprise SOA Platform</ulink> and <ulink url="http://www.jboss.com/products/platforms/soa/components">JBoss Enterprise SOA Platform Component Details</ulink>.</para>
+ <para>You can find out what is SOA here: <ulink url="http://www.jboss.org/jbossesb/resources/SOABasics.html">Basics of SOA</ulink> and <ulink url="http://www.jboss.org/jbossesb/resources/SOAEOA.html">SOA and EOA</ulink>.</para>
+
+ <para>To configure the JBoss Enterprise SOA platform select <emphasis>
+ <property>Window > Preferences > Server > Runtime Environments</property></emphasis>, that will open the Server Runtime Environments Preferences page where you can add, remove and edit a Server Runtime Environment.</para>
+
+ <figure>
+ <title>Configure new Server Runtime Environment</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/esb_project/13NewServerRuntimeEnv.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>Select <emphasis><property>Add</property></emphasis>, choose <emphasis><property>JBoss 4.2 Runtime</property></emphasis> as a type of runtime environment, check the <emphasis><property>Create a new local server</property></emphasis> checkbox and click <emphasis><property>Next</property></emphasis>:</para>
+ <figure>
+ <title>Type of Server Runtime Environment</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/esb_project/14typeOfRuntime.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>On the next step you can specify a name of the server runtime environment and browse to its location. Click <emphasis><property>Finish</property></emphasis> to add the server runtime environment.</para>
+
+
+ <figure>
+ <title>New Server Runtime Environment Details</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/esb_project/15AddNew.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Now you have your SOA platform configured. To check the configuration create a ESB Project using instructions described <xref linkend="ESB_project_wizard"/>. As a result you will have two projects created:</para>
+
+ <figure>
+ <title>Helloworld Projects Created</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/esb_project/16HelloworldProjects.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Then you will need to add JBoss ESB libraries to your projects to configure the SOA server runtime exactly for your projects. Right-click on your project, select <emphasis><property>Build Path > Add Libraries</property></emphasis>:</para>
+
+ <figure>
+ <title>Add Libraries</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/esb_project/17_Add_new_libraries.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>Choose <emphasis><property>JBoss ESB Libraries</property></emphasis> and click <emphasis><property>Next</property></emphasis>:</para>
+
+ <figure>
+ <title>ESB Libraries</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/esb_project/18_select_libraries.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>Select the necessary runtime to add to the project classpath:</para>
+
+
+ <figure>
+ <title>Select a ESB runtime</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/esb_project/19_select_runtime.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Click <emphasis><property>Finish</property></emphasis>.</para>
+ <para>Now you can deploy your Helloworld project to the server and run a test class in the client Java project to see the test result in the Console view.</para>
+
+
+
+</section>
+
+
+
+
+
+
+
+
+
+
+</chapter>
\ No newline at end of file
14 years, 6 months
JBoss Tools SVN: r20906 - in trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe: editor and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2010-03-18 11:59:15 -0400 (Thu, 18 Mar 2010)
New Revision: 20906
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/VpeDnD.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeDropWindow.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSelectionBuilder.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5042
Enhance DnD support in VPE
VPE Refactoring in progress.
- Most of Drag&Drop-related methods and field have been moved from VpeController to VpeDnD.DndVpeController.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/VpeDnD.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/VpeDnD.java 2010-03-18 13:42:33 UTC (rev 20905)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/VpeDnD.java 2010-03-18 15:59:15 UTC (rev 20906)
@@ -11,28 +11,64 @@
******************************************************************************/
package org.jboss.tools.vpe.dnd;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.swt.dnd.Clipboard;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Display;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.options.PreferenceModelUtilities;
+import org.jboss.tools.common.model.ui.dnd.ModelTransfer;
+import org.jboss.tools.common.model.ui.editor.IModelObjectEditorInput;
+import org.jboss.tools.common.model.ui.editors.dnd.DropCommandFactory;
+import org.jboss.tools.common.model.ui.editors.dnd.DropData;
+import org.jboss.tools.common.model.ui.editors.dnd.DropUtils;
+import org.jboss.tools.common.model.ui.editors.dnd.IDropCommand;
+import org.jboss.tools.common.model.ui.editors.dnd.context.InnerDragBuffer;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.jst.jsp.JspEditorPlugin;
+import org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor;
+import org.jboss.tools.jst.jsp.jspeditor.dnd.JSPTagProposalFactory;
+import org.jboss.tools.jst.jsp.preferences.IVpePreferencesPage;
+import org.jboss.tools.jst.web.tld.model.TLDUtil;
+import org.jboss.tools.vpe.VpeDebug;
+import org.jboss.tools.vpe.dnd.DndUtil.DragTransferData;
import org.jboss.tools.vpe.editor.VpeController;
+import org.jboss.tools.vpe.editor.VpeSourceInnerDragInfo;
+import org.jboss.tools.vpe.editor.VpeSourceInnerDropInfo;
import org.jboss.tools.vpe.editor.VpeVisualCaretInfo;
+import org.jboss.tools.vpe.editor.VpeVisualInnerDragInfo;
+import org.jboss.tools.vpe.editor.VpeVisualInnerDropInfo;
import org.jboss.tools.vpe.editor.mozilla.MozillaDropInfo;
+import org.jboss.tools.vpe.editor.mozilla.listener.MozillaDndListener;
import org.jboss.tools.vpe.editor.selection.VpeSelectionController;
+import org.jboss.tools.vpe.editor.util.VisualDomUtil;
+import org.jboss.tools.vpe.editor.util.VpeDndUtil;
import org.jboss.tools.vpe.xulrunner.XPCOM;
import org.jboss.tools.vpe.xulrunner.editor.XulRunnerEditor;
import org.mozilla.interfaces.nsIComponentManager;
+import org.mozilla.interfaces.nsIDOMElement;
import org.mozilla.interfaces.nsIDOMEvent;
import org.mozilla.interfaces.nsIDOMEventTarget;
import org.mozilla.interfaces.nsIDOMMouseEvent;
import org.mozilla.interfaces.nsIDOMNode;
import org.mozilla.interfaces.nsIDragService;
+import org.mozilla.interfaces.nsIFile;
import org.mozilla.interfaces.nsISelectionController;
import org.mozilla.interfaces.nsIServiceManager;
+import org.mozilla.interfaces.nsISupports;
import org.mozilla.interfaces.nsISupportsArray;
+import org.mozilla.interfaces.nsISupportsCString;
import org.mozilla.interfaces.nsISupportsString;
import org.mozilla.interfaces.nsITransferable;
import org.mozilla.xpcom.Mozilla;
import org.mozilla.xpcom.XPCOMException;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
/**
* @author Max Areshkau
+ * @author Yahor Radtsevich (yradtsevich)
*
*Class which response for drag and drop functionality
*/
@@ -57,10 +93,16 @@
private nsIDragService dragService;
private VpeController vpeController;
+ private DndVpeController dndController;
+ // XXX temp method
+ public DndVpeController getDndController() {
+ return dndController;
+ }
public VpeDnD(VpeController vpeController) {
this.vpeController = vpeController;
+ this.dndController = new DndVpeController();
}
/**
@@ -168,10 +210,10 @@
if(getDragService().getCurrentSession().getSourceNode()==null){
//external drag
- info = vpeController.canExternalDrop(mouseEvent, VpeController.MODEL_FLAVOR, ""); //$NON-NLS-1$
+ info = dndController.canExternalDrop(mouseEvent, VpeController.MODEL_FLAVOR, ""); //$NON-NLS-1$
} else {
//internal drag
- info = vpeController.canInnerDrop(mouseEvent);
+ info = dndController.canInnerDrop(mouseEvent);
}
if (info != null) {
canDrop = info.canDrop();
@@ -210,10 +252,484 @@
public void dragDrop(nsIDOMEvent domEvent) {
if(getDragService().getCurrentSession().getSourceDocument()==null) {
//in this case it's is external drag
- vpeController.externalDrop((nsIDOMMouseEvent)domEvent.queryInterface(nsIDOMMouseEvent.NS_IDOMMOUSEEVENT_IID), VpeController.MODEL_FLAVOR, ""); //$NON-NLS-1$
+ dndController.externalDrop((nsIDOMMouseEvent)domEvent.queryInterface(nsIDOMMouseEvent.NS_IDOMMOUSEEVENT_IID), VpeController.MODEL_FLAVOR, ""); //$NON-NLS-1$
} else {
// in this case it's is an internal drag
- vpeController.innerDrop((nsIDOMMouseEvent)domEvent.queryInterface(nsIDOMMouseEvent.NS_IDOMMOUSEEVENT_IID));
+ dndController.innerDrop((nsIDOMMouseEvent)domEvent.queryInterface(nsIDOMMouseEvent.NS_IDOMMOUSEEVENT_IID));
}
}
+
+ /**
+ *
+ * @author Yahor Radtsevich (yradtsevich): moved methods from the
+ * {@link VpeController} here
+ */
+ public class DndVpeController implements MozillaDndListener {
+ private VpeVisualInnerDragInfo innerDragInfo = null;
+
+ public void dragGesture(nsIDOMEvent domEvent) {
+ nsIDOMMouseEvent mouseEvent = (nsIDOMMouseEvent) domEvent
+ .queryInterface(nsIDOMMouseEvent.NS_IDOMMOUSEEVENT_IID);
+ boolean canDragFlag = canInnerDrag(mouseEvent);
+ // start drag sessionvpe-element
+ if (canDragFlag) {
+
+ startDragSession(domEvent);
+ }
+ }
+
+ public void dragOver(nsIDOMEvent event) {
+ VpeDnD.this.dragOver(event);
+ vpeController.onRefresh();
+ }
+
+ public void _dragOver(nsIDOMEvent event) {
+ if (!vpeController.getSwitcher()
+ .startActiveEditor(VpeController.ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL)) {
+ return;
+ }
+ try {
+ if (VpeDebug.PRINT_VISUAL_DRAGDROP_EVENT) {
+ System.out.println("<<<<<<<<<<<<<<<<<<<< dragOver"); //$NON-NLS-1$
+ }
+ // browser.computeDropPosition(event);
+ boolean canDrop = !vpeController.getXulRunnerEditor().isMozillaDragFlavor();
+ if (canDrop) {
+ Clipboard clipboard = new Clipboard(Display.getCurrent());
+ canDrop = clipboard.getContents(ModelTransfer.getInstance()) != null;
+ }
+ if (canDrop) {
+ canDrop = VpeDndUtil.isDropEnabled((IModelObjectEditorInput)
+ vpeController.getSourceEditor().getEditorInput());
+ }
+ if (canDrop) {
+ VpeVisualCaretInfo caretInfo = vpeController.getSelectionBuilder()
+ .getVisualCaretInfo(event);
+ canDrop = caretInfo.exist();
+ if (canDrop) {
+ caretInfo.showCaret();
+ } else {
+ caretInfo.hideCaret();
+ }
+ }
+ if (!canDrop) {
+ event.stopPropagation();
+ event.preventDefault();
+ }
+ } finally {
+ vpeController.getSwitcher().stopActiveEditor();
+ }
+ }
+
+ public boolean canInnerDrag(nsIDOMMouseEvent event) {
+ vpeController.onHideTooltip();
+
+ if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
+ System.out.print("<<<<<< canInnerDrag"); //$NON-NLS-1$
+ }
+ if (innerDragInfo != null) {
+ innerDragInfo.release();
+ innerDragInfo = null;
+ }
+ boolean canDrag = false;
+ VpeVisualInnerDragInfo dragInfo = vpeController.getSelectionBuilder()
+ .getInnerDragInfo(event);
+ if (dragInfo != null) {
+ nsIDOMNode dragNode = dragInfo.getNode();
+ if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
+ System.out
+ .print(" dragNode: " + dragNode.getNodeName() + "(" + dragNode + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
+ switch (dragNode.getNodeType()) {
+ case nsIDOMNode.ELEMENT_NODE: {
+ canDrag = vpeController.getVisualBuilder().canInnerDrag((nsIDOMElement) dragNode
+ .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID));
+ break;
+ }
+ case nsIDOMNode.TEXT_NODE: {
+ canDrag = vpeController.getVisualBuilder().isTextEditable(dragNode);
+ break;
+ }
+ }
+ if (canDrag) {
+ VpeSourceInnerDragInfo sourceInnerDragInfo = vpeController.getVisualBuilder()
+ .getSourceInnerDragInfo(dragInfo);
+ if (sourceInnerDragInfo.getNode() != null) {
+ innerDragInfo = dragInfo;
+ InnerDragBuffer.object = sourceInnerDragInfo.getNode();
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ InnerDragBuffer.object = null;
+ }
+ });
+ } else {
+ canDrag = false;
+ }
+ }
+ if (!canDrag) {
+ dragInfo.release();
+ }
+ }
+ if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
+ System.out.println(" canDrag: " + canDrag); //$NON-NLS-1$
+ }
+ return canDrag;
+ }
+
+ public DndVpeController() {
+ super();
+ }
+
+ public MozillaDropInfo canInnerDrop(nsIDOMMouseEvent event) {
+ vpeController.onHideTooltip();
+
+ if (vpeController.getDropWindow().isActive()) {
+ if (!event.getAltKey()) {
+ vpeController.getDropWindow().close();
+ } else {
+ return null;
+ }
+ }
+ if (event.getAltKey()) {
+ nsIDOMNode visualNode = VisualDomUtil.getTargetNode(event);
+ Node sourceNode = vpeController.getDomMapping().getNearSourceNode(visualNode);
+ if (sourceNode != null) {
+ vpeController.getDropWindow().setActive(true);
+ vpeController.getDropWindow().setEventPosition(event.getScreenX(), event
+ .getScreenY());
+ vpeController.getDropWindow().setInitialTargetNode(sourceNode);
+ vpeController.getDropWindow().open();
+ event.stopPropagation();
+ event.preventDefault();
+ return null;
+ }
+ }
+ if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
+ System.out.print("<<<<<< canInnerDrop"); //$NON-NLS-1$
+ }
+ boolean canDrop = false;
+ ;
+ nsIDOMNode caretParent = null;
+ long caretOffset = 0;
+ if (innerDragInfo != null) {
+ VpeVisualInnerDropInfo visualDropInfo = vpeController.getSelectionBuilder()
+ .getInnerDropInfo(event);
+ if (visualDropInfo.getDropContainer() != null) {
+ if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
+ System.out.print(" x: " //$NON-NLS-1$
+ + visualDropInfo.getMouseX()
+ + " y: " //$NON-NLS-1$
+ + visualDropInfo.getMouseY()
+ + " container: " //$NON-NLS-1$
+ + visualDropInfo.getDropContainer().getNodeName()
+ + "(" //$NON-NLS-1$
+ + visualDropInfo.getDropContainer()
+ + ") parent: " //$NON-NLS-1$
+ + visualDropInfo.getDropContainer().getParentNode()
+ .getNodeName()
+ + "(" //$NON-NLS-1$
+ + visualDropInfo.getDropContainer().getParentNode()
+ + ") offset: " //$NON-NLS-1$
+ + visualDropInfo.getDropOffset());
+ }
+ VpeSourceInnerDragInfo sourceInnerDragInfo = vpeController.getVisualBuilder()
+ .getSourceInnerDragInfo(innerDragInfo);
+ VpeSourceInnerDropInfo sourceDropInfo = vpeController.getVisualBuilder()
+ .getSourceInnerDropInfo(sourceInnerDragInfo.getNode(),
+ visualDropInfo, true);
+ canDrop = sourceDropInfo.canDrop();
+ if (canDrop) {
+ VpeVisualInnerDropInfo newVisualDropInfo = vpeController.getVisualBuilder()
+ .getInnerDropInfo(sourceDropInfo.getContainer(),
+ sourceDropInfo.getOffset());
+ if (newVisualDropInfo != null) {
+ vpeController.getVisualBuilder().correctVisualDropPosition(
+ newVisualDropInfo, visualDropInfo);
+ caretParent = newVisualDropInfo.getDropContainer();
+ caretOffset = newVisualDropInfo.getDropOffset();
+ }
+ }
+ }
+ visualDropInfo.release();
+ }
+ if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
+ System.out.println(" canDrop: " + canDrop); //$NON-NLS-1$
+ }
+ return new MozillaDropInfo(canDrop, caretParent, caretOffset);
+ }
+
+ public void innerDrop(nsIDOMMouseEvent event) {
+ vpeController.onHideTooltip();
+
+ if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
+ System.out.print("<<<<<< innerDrop"); //$NON-NLS-1$
+ }
+ if (innerDragInfo != null) {
+ VpeVisualInnerDropInfo visualDropInfo = vpeController.getSelectionBuilder()
+ .getInnerDropInfo(event);
+ if (visualDropInfo.getDropContainer() != null) {
+ if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
+ System.out
+ .print(" container: " + visualDropInfo.getDropContainer().getNodeName() + //$NON-NLS-1$
+ "(" + visualDropInfo.getDropContainer() //$NON-NLS-1$
+ + ")" + //$NON-NLS-1$
+ " offset: " //$NON-NLS-1$
+ + visualDropInfo.getDropOffset());
+ }
+
+ VpeSourceInnerDragInfo sourceInnerDragInfo = vpeController.getVisualBuilder()
+ .getSourceInnerDragInfo(innerDragInfo);
+ VpeSourceInnerDropInfo sourceDropInfo = vpeController.getVisualBuilder()
+ .getSourceInnerDropInfo(sourceInnerDragInfo.getNode(),
+ visualDropInfo, true);
+ if (sourceDropInfo.canDrop()) {
+ VpeVisualInnerDropInfo newVisualDropInfo = vpeController.getVisualBuilder()
+ .getInnerDropInfo(sourceDropInfo.getContainer(),
+ sourceDropInfo.getOffset());
+ if (newVisualDropInfo != null) {
+ vpeController.getVisualBuilder().correctVisualDropPosition(
+ newVisualDropInfo, visualDropInfo);
+ sourceDropInfo.setTop(visualDropInfo.getMouseY());
+ sourceDropInfo.setLeft(visualDropInfo.getMouseX());
+ vpeController.getVisualBuilder().innerDrop(sourceInnerDragInfo,
+ sourceDropInfo);
+ if (innerDragInfo != null) {
+ innerDragInfo.release();
+ innerDragInfo = null;
+ }
+ }
+ }
+ }
+ }
+ if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
+ System.out.println();
+ }
+ }
+
+ public MozillaDropInfo canExternalDrop(nsIDOMMouseEvent mouseEvent, String flavor, String data) {
+ InnerDragBuffer.object = null;
+ vpeController.onHideTooltip();
+
+ if (vpeController.getDropWindow().isActive()) {
+ if (!mouseEvent.getAltKey()) {
+ vpeController.getDropWindow().close();
+ } else {
+ return new MozillaDropInfo(false, null, 0);
+ }
+ }
+ if (mouseEvent.getAltKey()) {
+ nsIDOMEvent event = (nsIDOMEvent) mouseEvent
+ .queryInterface(nsIDOMEvent.NS_IDOMEVENT_IID);
+ nsIDOMNode visualNode = (nsIDOMNode) event.getTarget()
+ .queryInterface(nsIDOMNode.NS_IDOMNODE_IID);
+ Node sourceNode = vpeController.getDomMapping().getNearSourceNode(visualNode);
+ if (sourceNode != null) {
+ if (ModelTransfer.MODEL.equals(flavor)) {
+ // XModelObject object =
+ // PreferenceModelUtilities.getPreferenceModel().
+ // getModelBuffer().source();
+ // InnerDragBuffer.object = object;
+ } else {
+ vpeController.getDropWindow().setFlavor(flavor);
+ }
+ vpeController.getDropWindow().setActive(true);
+ vpeController.getDropWindow().setEventPosition(mouseEvent.getScreenX(), mouseEvent
+ .getScreenY());
+ vpeController.getDropWindow().setInitialTargetNode(sourceNode);
+ vpeController.getDropWindow().open();
+ mouseEvent.stopPropagation();
+ mouseEvent.preventDefault();
+ return new MozillaDropInfo(false, null, 0);
+ }
+ }
+ boolean canDrop = false;
+ nsIDOMNode caretParent = null;
+ long caretOffset = 0;
+
+ if (VpeController.MODEL_FLAVOR.equals(flavor)) {
+ XModelObject object = PreferenceModelUtilities.getPreferenceModel()
+ .getModelBuffer().source();
+ if (object.getFileType() == XModelObject.FILE
+ && !TLDUtil.isTaglib(object)) {
+ IFile f = (IFile) EclipseResourceUtil.getResource(object);
+ canDrop = f != null;
+ VpeVisualInnerDropInfo visualDropInfo = vpeController.getSelectionBuilder()
+ .getInnerDropInfo(mouseEvent);
+ caretParent = visualDropInfo.getDropContainer();
+ caretOffset = visualDropInfo.getDropOffset();
+ } else {
+ String tagname = vpeController.getTagName(object);
+ if (tagname.indexOf("taglib") >= 0)tagname = "taglib"; //$NON-NLS-1$ //$NON-NLS-2$
+ Node sourceDragNode = ((Document) vpeController.getModel().getAdapter(
+ Document.class)).createElement(tagname);
+ VpeVisualInnerDropInfo visualDropInfo = vpeController.getSelectionBuilder()
+ .getInnerDropInfo(mouseEvent);
+ if (visualDropInfo.getDropContainer() != null) {
+ VpeSourceInnerDropInfo sourceDropInfo = vpeController.getVisualBuilder()
+ .getSourceInnerDropInfo(sourceDragNode,
+ visualDropInfo, true);
+ canDrop = sourceDropInfo.canDrop();
+ if (canDrop) {
+ VpeVisualInnerDropInfo newVisualDropInfo = vpeController.getVisualBuilder()
+ .getInnerDropInfo(
+ sourceDropInfo.getContainer(),
+ sourceDropInfo.getOffset());
+ if (newVisualDropInfo != null) {
+ vpeController.getVisualBuilder().correctVisualDropPosition(
+ newVisualDropInfo, visualDropInfo);
+ caretParent = newVisualDropInfo.getDropContainer();
+ caretOffset = newVisualDropInfo.getDropOffset();
+ }
+ }
+ }
+ visualDropInfo.release();
+ }
+ } else if (XulRunnerEditor.TRANS_FLAVOR_kFileMime.equals(flavor)
+ || XulRunnerEditor.TRANS_FLAVOR_kURLMime.equals(flavor)) {
+ VpeVisualInnerDropInfo visualDropInfo = vpeController.getSelectionBuilder()
+ .getInnerDropInfo(mouseEvent);
+ caretParent = visualDropInfo.getDropContainer();
+ caretOffset = visualDropInfo.getDropOffset();
+ canDrop = true;
+
+ }
+ if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
+ System.out
+ .println(" canDrop: " + canDrop + (canDrop ? " container: " + caretParent.getNodeName() + " offset: " + caretOffset : "")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ }
+ return new MozillaDropInfo(canDrop, caretParent, caretOffset);
+
+ }
+
+ public VpeSourceInnerDropInfo canExternalDropMacro(XModelObject object, Node parentNode, int offset) {
+ String tagname = vpeController.getTagName(object);
+ Node sourceDragNode = ((Document) vpeController.getModel().getAdapter(Document.class))
+ .createElement(tagname);
+ return vpeController.getVisualBuilder().getSourceInnerDropInfo(sourceDragNode, parentNode,
+ offset, false);
+ }
+
+ public void externalDropAny(final String flavor, final String data, final Point range,
+ Node container) {
+ if (flavor == null || flavor.length() == 0)
+ return;
+ IDropCommand dropCommand = DropCommandFactory.getInstance()
+ .getDropCommand(flavor, JSPTagProposalFactory.getInstance());
+
+ boolean promptAttributes = JspEditorPlugin.getDefault()
+ .getPreferenceStore().getBoolean(
+ IVpePreferencesPage.ASK_TAG_ATTRIBUTES_ON_TAG_INSERT);
+ dropCommand.getDefaultModel().setPromptForTagAttributesRequired(
+ promptAttributes);
+ DropData dropData = new DropData(flavor, data,
+ vpeController.getSourceEditor().getEditorInput(),
+ (ISourceViewer) vpeController.getSourceEditor().getAdapter(ISourceViewer.class),
+ vpeController.new VpeSelectionProvider(range.x, range.y),
+ container);
+
+ /*
+ * https://jira.jboss.org/jira/browse/JBIDE-4982 Setting the value
+ * provider to create tag insert dialog.
+ */
+ if (vpeController.getSourceEditor() instanceof JSPTextEditor) {
+ dropData.setValueProvider(((JSPTextEditor) vpeController.getSourceEditor())
+ .createAttributeDescriptorValueProvider());
+ }
+
+ dropCommand.execute(dropData);
+ }
+
+ public void externalDrop(nsIDOMMouseEvent mouseEvent, String flavor, String data) {
+ vpeController.onHideTooltip();
+
+ VpeVisualInnerDropInfo visualDropInfo = vpeController.getSelectionBuilder()
+ .getInnerDropInfo(mouseEvent);
+ Point range = vpeController.getSelectionBuilder().getSourceSelectionRangeAtVisualNode(
+ visualDropInfo.getDropContainer(), (int) visualDropInfo
+ .getDropOffset());
+
+ // if (MODEL_FLAVOR.equals(flavor)) {
+ // XModelObject object = PreferenceModelUtilities.getPreferenceModel()
+ // .getModelBuffer().source();
+ // if(object == null)
+
+ final DragTransferData dragTransferData = DndUtil.getDragTransferData();
+ final nsISupports aValue = dragTransferData.getValue();
+
+ String aFlavor = ""; //$NON-NLS-1$
+ if (VpeDndUtil.isNsIFileInstance(aValue)) {
+ nsIFile aFile = (nsIFile) aValue
+ .queryInterface(nsIFile.NS_IFILE_IID);
+
+ // because it is external, convert the path to URL
+ final String path = aFile.getPath();
+ data = path != null ? DropUtils.convertPathToUrl(path) : null;
+ aFlavor = DndUtil.kFileMime;
+
+ } else if (VpeDndUtil.isNsICStringInstance(aValue)) {
+ nsISupportsCString aString = (nsISupportsCString) aValue
+ .queryInterface(nsISupportsCString.NS_ISUPPORTSCSTRING_IID);
+ data = aString.getData();
+ aFlavor = DndUtil.kHTMLMime;
+ } else if (VpeDndUtil.isNsIStringInstance(aValue)) {
+ nsISupportsString aString = (nsISupportsString) aValue
+ .queryInterface(nsISupportsString.NS_ISUPPORTSSTRING_IID);
+ data = aString.getData();
+ if (VpeController.MODEL_FLAVOR.equals(dragTransferData.getFlavor())) {
+ aFlavor = dragTransferData.getFlavor();
+ } else {
+ aFlavor = DndUtil.kURLMime;
+ }
+ }
+
+ // if (object.getFileType() == XModelObject.FILE
+ // && !TLDUtil.isTaglib(object)) {
+ // flavor = "application/x-moz-file"; //$NON-NLS-1$
+ // IFile f = (IFile) EclipseResourceUtil.getResource(object);
+ // try {
+ // data = f.getLocation().toFile().toURL().toString();
+ // } catch (Exception e) {
+ // VpePlugin.getPluginLog().logError(e);
+ // }
+ // } else {
+ // String tagname = getTagName(object);
+ // if (tagname.indexOf("taglib") >= 0)tagname = "taglib"; //$NON-NLS-1$ //$NON-NLS-2$
+ // Node sourceDragNode = ((Document) getModel().getAdapter(
+ // Document.class)).createElement(tagname);
+ // if (visualDropInfo.getDropContainer() != null) {
+ // sourceDropInfo = vpeController.getVisualBuilder().getSourceInnerDropInfo(
+ // sourceDragNode, visualDropInfo, true);
+ // range = vpeController.getSelectionBuilder().getSourceSelectionRange(
+ // sourceDropInfo.getContainer(), sourceDropInfo
+ // .getOffset());
+ // }
+ // }
+
+ if (visualDropInfo.getDropContainer() != null && data != null) {
+ if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
+ System.out
+ .println(" drop! container: " + visualDropInfo.getDropContainer().getNodeName()); //$NON-NLS-1$
+ }
+ externalDropAny(aFlavor, data, range, null);
+
+ // TypedEvent tEvent = new TypedEvent(mouseEvent);
+ // tEvent.data = data;
+ // dropContext.setFlavor(aFlavor);
+ // dropContext.setMimeData(data);
+ // DnDUtil.fireDnDEvent(dropContext, textEditor, tEvent);
+ }
+ }
+
+ /**
+ * Start drag session
+ */
+ public void startDragSession(nsIDOMEvent domEvent) {
+ VpeDnD.this.startDragSession(domEvent);
+ }
+
+ public void dragDrop(nsIDOMEvent domEvent) {
+ VpeDnD.this.dragDrop(domEvent);
+ vpeController.onRefresh();
+ }
+ }
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2010-03-18 13:42:33 UTC (rev 20905)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2010-03-18 15:59:15 UTC (rev 20906)
@@ -14,7 +14,6 @@
import java.util.LinkedList;
import java.util.List;
-import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -27,7 +26,6 @@
import org.eclipse.jface.bindings.keys.KeyStroke;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.ISelectionProvider;
@@ -37,7 +35,6 @@
import org.eclipse.swt.custom.LineStyleListener;
import org.eclipse.swt.custom.StyleRange;
import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.dnd.Clipboard;
import org.eclipse.swt.events.MenuEvent;
import org.eclipse.swt.events.MenuListener;
import org.eclipse.swt.events.SelectionEvent;
@@ -77,42 +74,27 @@
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.event.XModelTreeEvent;
import org.jboss.tools.common.model.event.XModelTreeListener;
-import org.jboss.tools.common.model.options.PreferenceModelUtilities;
import org.jboss.tools.common.model.project.IModelNature;
import org.jboss.tools.common.model.ui.dnd.ModelTransfer;
-import org.jboss.tools.common.model.ui.editor.IModelObjectEditorInput;
-import org.jboss.tools.common.model.ui.editors.dnd.DropCommandFactory;
-import org.jboss.tools.common.model.ui.editors.dnd.DropData;
-import org.jboss.tools.common.model.ui.editors.dnd.DropUtils;
-import org.jboss.tools.common.model.ui.editors.dnd.IDropCommand;
-import org.jboss.tools.common.model.ui.editors.dnd.context.InnerDragBuffer;
import org.jboss.tools.common.model.ui.util.ModelUtilities;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.model.util.XModelTreeListenerSWTSync;
import org.jboss.tools.common.resref.core.ResourceReferenceListListener;
-import org.jboss.tools.jst.jsp.JspEditorPlugin;
import org.jboss.tools.jst.jsp.editor.IJSPTextEditor;
import org.jboss.tools.jst.jsp.editor.IVisualController;
-import org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor;
import org.jboss.tools.jst.jsp.jspeditor.dnd.JSPPaletteInsertHelper;
-import org.jboss.tools.jst.jsp.jspeditor.dnd.JSPTagProposalFactory;
-import org.jboss.tools.jst.jsp.preferences.IVpePreferencesPage;
import org.jboss.tools.jst.jsp.preferences.VpePreference;
import org.jboss.tools.jst.web.model.helpers.WebAppHelper;
import org.jboss.tools.jst.web.project.WebProject;
import org.jboss.tools.jst.web.tld.URIConstants;
-import org.jboss.tools.jst.web.tld.model.TLDUtil;
import org.jboss.tools.vpe.VpeDebug;
import org.jboss.tools.vpe.VpePlugin;
-import org.jboss.tools.vpe.dnd.DndUtil;
import org.jboss.tools.vpe.dnd.VpeDnD;
-import org.jboss.tools.vpe.dnd.DndUtil.DragTransferData;
import org.jboss.tools.vpe.editor.bundle.BundleMap;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.mapping.VpeDomMapping;
import org.jboss.tools.vpe.editor.mapping.VpeNodeMapping;
import org.jboss.tools.vpe.editor.menu.VpeMenuCreator;
-import org.jboss.tools.vpe.editor.mozilla.MozillaDropInfo;
import org.jboss.tools.vpe.editor.mozilla.MozillaEditor;
import org.jboss.tools.vpe.editor.mozilla.MozillaEventAdapter;
import org.jboss.tools.vpe.editor.mozilla.listener.MozillaContextMenuListener;
@@ -138,7 +120,6 @@
import org.jboss.tools.vpe.editor.util.DocTypeUtil;
import org.jboss.tools.vpe.editor.util.SelectionUtil;
import org.jboss.tools.vpe.editor.util.VisualDomUtil;
-import org.jboss.tools.vpe.editor.util.VpeDndUtil;
import org.jboss.tools.vpe.messages.VpeUIMessages;
import org.jboss.tools.vpe.resref.core.AbsoluteFolderReferenceList;
import org.jboss.tools.vpe.resref.core.CSSReferenceList;
@@ -154,23 +135,18 @@
import org.mozilla.interfaces.nsIDOMMouseEvent;
import org.mozilla.interfaces.nsIDOMMutationEvent;
import org.mozilla.interfaces.nsIDOMNode;
-import org.mozilla.interfaces.nsIFile;
import org.mozilla.interfaces.nsISelection;
import org.mozilla.interfaces.nsISelectionListener;
-import org.mozilla.interfaces.nsISupports;
-import org.mozilla.interfaces.nsISupportsCString;
-import org.mozilla.interfaces.nsISupportsString;
import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
-public class VpeController implements INodeAdapter, IModelLifecycleListener,
- INodeSelectionListener, ITextSelectionListener, SelectionListener,
+public class VpeController implements INodeAdapter,
+ IModelLifecycleListener, INodeSelectionListener,
+ ITextSelectionListener, SelectionListener,
VpeTemplateListener, XModelTreeListener,
ResourceReferenceListListener, ISelectionChangedListener,
- IVisualController, MozillaDndListener,
- MozillaMouseListener, MozillaKeyListener,
+ IVisualController, MozillaMouseListener, MozillaKeyListener,
MozillaTooltipListener, MozillaSelectionListener,
MozillaContextMenuListener, MozillaResizeListener {
@@ -210,7 +186,6 @@
private AbsoluteFolderReferenceList absoluteFolderReferenceListListener;
private RelativeFolderReferenceList relativeFolderReferenceListListener;
private VpeIncludeList includeList = new VpeIncludeList();
- private VpeVisualInnerDragInfo innerDragInfo = null;
private FormatControllerManager toolbarFormatControllerManager = null;
private SelectionBar selectionBar = null;
private XModelTreeListenerSWTSync optionsListener;
@@ -221,6 +196,7 @@
private UIJob visualRefreshJob;
private UIJob reinitJob;
private IZoomEventManager zoomEventManager;
+ private VpeDropWindow dropWindow = null;
/**
* Added by Max Areshkau JBIDE-675, stores information about modification
@@ -479,7 +455,7 @@
= visualEditor.getMozillaEventAdapter();
if (mozillaEventAdapter != null) {
mozillaEventAdapter.addContextMenuListener(this);
- mozillaEventAdapter.addDndListener(this);
+ mozillaEventAdapter.addDndListener(dnd.getDndController());
mozillaEventAdapter.addKeyListener(this);
mozillaEventAdapter.addMouseListener(this);
mozillaEventAdapter.addSelectionListener(this);
@@ -496,7 +472,7 @@
= visualEditor.getMozillaEventAdapter();
if (mozillaEventAdapter != null) {
mozillaEventAdapter.removeContextMenuListener(this);
- mozillaEventAdapter.removeDndListener(this);
+ mozillaEventAdapter.removeDndListener(dnd.getDndController());
mozillaEventAdapter.removeKeyListener(this);
mozillaEventAdapter.removeMouseListener(this);
mozillaEventAdapter.removeSelectionListener(this);
@@ -1226,7 +1202,7 @@
XulRunnerVpeUtils.getElementBounds(
selectedElement),
VisualDomUtil.getMousePoint(mouseEvent))) {
- dragGesture(mouseEvent);
+ dnd.getDndController().dragGesture(mouseEvent);
} else {
selectionManager.setSelection(mouseEvent);
}
@@ -1473,17 +1449,6 @@
sourceSelectionChanged();
}
- public void dragGesture(nsIDOMEvent domEvent) {
- nsIDOMMouseEvent mouseEvent = (nsIDOMMouseEvent) domEvent
- .queryInterface(nsIDOMMouseEvent.NS_IDOMMOUSEEVENT_IID);
- boolean canDragFlag = canInnerDrag(mouseEvent);
- // start drag sessionvpe-element
- if (canDragFlag) {
-
- startDragSession(domEvent);
- }
- }
-
/**
* Calls when on when browser receive context menu event.
*
@@ -1694,11 +1659,11 @@
System.out.println();
}
- private class ActiveEditorSwitcher {
- private static final int ACTIVE_EDITOR_CANNOT = 0;
- private static final int ACTIVE_EDITOR_NONE = 1;
- private static final int ACTIVE_EDITOR_SOURCE = 2;
- private static final int ACTIVE_EDITOR_VISUAL = 3;
+ public class ActiveEditorSwitcher {
+ public static final int ACTIVE_EDITOR_CANNOT = 0;
+ public static final int ACTIVE_EDITOR_NONE = 1;
+ public static final int ACTIVE_EDITOR_SOURCE = 2;
+ public static final int ACTIVE_EDITOR_VISUAL = 3;
private int type = ACTIVE_EDITOR_CANNOT;
@@ -1710,7 +1675,7 @@
type = ACTIVE_EDITOR_CANNOT;
}
- private boolean startActiveEditor(int newType) {
+ public boolean startActiveEditor(int newType) {
if (type == ACTIVE_EDITOR_NONE) {
if (newType == ACTIVE_EDITOR_SOURCE
&& editPart.getVisualMode() == VpeEditorPart.SOURCE_MODE) {
@@ -1723,7 +1688,7 @@
}
}
- private void stopActiveEditor() {
+ public void stopActiveEditor() {
onRefresh();
type = ACTIVE_EDITOR_NONE;
}
@@ -1936,7 +1901,7 @@
// }
// }
- class VpeSelectionProvider implements ISelectionProvider {
+ public class VpeSelectionProvider implements ISelectionProvider {
VpeSelection selection;
public VpeSelectionProvider(IndexedRegion region) {
@@ -2068,375 +2033,7 @@
// // xulRunnerEditor.hideDragCaret();
// }
- public void dragOver(nsIDOMEvent event) {
- dnd.dragOver(event);
- onRefresh();
- }
-
- public void _dragOver(nsIDOMEvent event) {
- if (!switcher
- .startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL)) {
- return;
- }
- try {
- if (VpeDebug.PRINT_VISUAL_DRAGDROP_EVENT) {
- System.out.println("<<<<<<<<<<<<<<<<<<<< dragOver"); //$NON-NLS-1$
- }
- // browser.computeDropPosition(event);
- boolean canDrop = !xulRunnerEditor.isMozillaDragFlavor();
- if (canDrop) {
- Clipboard clipboard = new Clipboard(Display.getCurrent());
- canDrop = clipboard.getContents(ModelTransfer.getInstance()) != null;
- }
- if (canDrop) {
- canDrop = VpeDndUtil
- .isDropEnabled((IModelObjectEditorInput) sourceEditor
- .getEditorInput());
- }
- if (canDrop) {
- VpeVisualCaretInfo caretInfo = selectionBuilder
- .getVisualCaretInfo(event);
- canDrop = caretInfo.exist();
- if (canDrop) {
- caretInfo.showCaret();
- } else {
- caretInfo.hideCaret();
- }
- }
- if (!canDrop) {
- event.stopPropagation();
- event.preventDefault();
- }
- } finally {
- switcher.stopActiveEditor();
- }
- }
-
-// this method is never used
-// public void drop(nsIDOMEvent event) {
-// if (VpeDebug.PRINT_VISUAL_DRAGDROP_EVENT) {
-// System.out.println("<<< outerDrop"); //$NON-NLS-1$
-// }
-// event.preventDefault();
-// }
-
- public boolean canInnerDrag(nsIDOMMouseEvent event) {
- onHideTooltip();
-
- if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
- System.out.print("<<<<<< canInnerDrag"); //$NON-NLS-1$
- }
- if (innerDragInfo != null) {
- innerDragInfo.release();
- innerDragInfo = null;
- }
- boolean canDrag = false;
- VpeVisualInnerDragInfo dragInfo = selectionBuilder
- .getInnerDragInfo(event);
- if (dragInfo != null) {
- nsIDOMNode dragNode = dragInfo.getNode();
- if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
- System.out
- .print(" dragNode: " + dragNode.getNodeName() + "(" + dragNode + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- switch (dragNode.getNodeType()) {
- case nsIDOMNode.ELEMENT_NODE: {
- canDrag = visualBuilder.canInnerDrag((nsIDOMElement) dragNode
- .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID));
- break;
- }
- case nsIDOMNode.TEXT_NODE: {
- canDrag = visualBuilder.isTextEditable(dragNode);
- break;
- }
- }
- if (canDrag) {
- VpeSourceInnerDragInfo sourceInnerDragInfo = visualBuilder
- .getSourceInnerDragInfo(dragInfo);
- if (sourceInnerDragInfo.getNode() != null) {
- innerDragInfo = dragInfo;
- InnerDragBuffer.object = sourceInnerDragInfo.getNode();
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- InnerDragBuffer.object = null;
- }
- });
- } else {
- canDrag = false;
- }
- }
- if (!canDrag) {
- dragInfo.release();
- }
- }
- if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
- System.out.println(" canDrag: " + canDrag); //$NON-NLS-1$
- }
- return canDrag;
- }
-
- VpeDropWindow dropWindow = null;
-
- public MozillaDropInfo canInnerDrop(nsIDOMMouseEvent event) {
- onHideTooltip();
-
- if (dropWindow.active) {
- if (!event.getAltKey()) {
- dropWindow.close();
- } else {
- return null;
- }
- }
- if (event.getAltKey()) {
- nsIDOMNode visualNode = VisualDomUtil.getTargetNode(event);
- Node sourceNode = domMapping.getNearSourceNode(visualNode);
- if (sourceNode != null) {
- dropWindow.active = true;
- dropWindow.setEventPosition(event.getScreenX(), event
- .getScreenY());
- dropWindow.setInitialTargetNode(sourceNode);
- dropWindow.open();
- event.stopPropagation();
- event.preventDefault();
- return null;
- }
- }
- if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
- System.out.print("<<<<<< canInnerDrop"); //$NON-NLS-1$
- }
- boolean canDrop = false;
- ;
- nsIDOMNode caretParent = null;
- long caretOffset = 0;
- if (innerDragInfo != null) {
- VpeVisualInnerDropInfo visualDropInfo = selectionBuilder
- .getInnerDropInfo(event);
- if (visualDropInfo.getDropContainer() != null) {
- if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
- System.out.print(" x: " //$NON-NLS-1$
- + visualDropInfo.getMouseX()
- + " y: " //$NON-NLS-1$
- + visualDropInfo.getMouseY()
- + " container: " //$NON-NLS-1$
- + visualDropInfo.getDropContainer().getNodeName()
- + "(" //$NON-NLS-1$
- + visualDropInfo.getDropContainer()
- + ") parent: " //$NON-NLS-1$
- + visualDropInfo.getDropContainer().getParentNode()
- .getNodeName()
- + "(" //$NON-NLS-1$
- + visualDropInfo.getDropContainer().getParentNode()
- + ") offset: " //$NON-NLS-1$
- + visualDropInfo.getDropOffset());
- }
- VpeSourceInnerDragInfo sourceInnerDragInfo = visualBuilder
- .getSourceInnerDragInfo(innerDragInfo);
- VpeSourceInnerDropInfo sourceDropInfo = visualBuilder
- .getSourceInnerDropInfo(sourceInnerDragInfo.getNode(),
- visualDropInfo, true);
- canDrop = sourceDropInfo.canDrop();
- if (canDrop) {
- VpeVisualInnerDropInfo newVisualDropInfo = visualBuilder
- .getInnerDropInfo(sourceDropInfo.getContainer(),
- sourceDropInfo.getOffset());
- if (newVisualDropInfo != null) {
- visualBuilder.correctVisualDropPosition(
- newVisualDropInfo, visualDropInfo);
- caretParent = newVisualDropInfo.getDropContainer();
- caretOffset = newVisualDropInfo.getDropOffset();
- }
- }
- }
- visualDropInfo.release();
- }
- if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
- System.out.println(" canDrop: " + canDrop); //$NON-NLS-1$
- }
- return new MozillaDropInfo(canDrop, caretParent, caretOffset);
- }
-
- public void innerDrop(nsIDOMMouseEvent event) {
- onHideTooltip();
-
- if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
- System.out.print("<<<<<< innerDrop"); //$NON-NLS-1$
- }
- if (innerDragInfo != null) {
- VpeVisualInnerDropInfo visualDropInfo = selectionBuilder
- .getInnerDropInfo(event);
- if (visualDropInfo.getDropContainer() != null) {
- if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
- System.out
- .print(" container: " + visualDropInfo.getDropContainer().getNodeName() + //$NON-NLS-1$
- "(" + visualDropInfo.getDropContainer() //$NON-NLS-1$
- + ")" + //$NON-NLS-1$
- " offset: " //$NON-NLS-1$
- + visualDropInfo.getDropOffset());
- }
-
- VpeSourceInnerDragInfo sourceInnerDragInfo = visualBuilder
- .getSourceInnerDragInfo(innerDragInfo);
- VpeSourceInnerDropInfo sourceDropInfo = visualBuilder
- .getSourceInnerDropInfo(sourceInnerDragInfo.getNode(),
- visualDropInfo, true);
- if (sourceDropInfo.canDrop()) {
- VpeVisualInnerDropInfo newVisualDropInfo = visualBuilder
- .getInnerDropInfo(sourceDropInfo.getContainer(),
- sourceDropInfo.getOffset());
- if (newVisualDropInfo != null) {
- visualBuilder.correctVisualDropPosition(
- newVisualDropInfo, visualDropInfo);
- sourceDropInfo.setTop(visualDropInfo.getMouseY());
- sourceDropInfo.setLeft(visualDropInfo.getMouseX());
- visualBuilder.innerDrop(sourceInnerDragInfo,
- sourceDropInfo);
- if (innerDragInfo != null) {
- innerDragInfo.release();
- innerDragInfo = null;
- }
- }
- }
- }
- }
- if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
- System.out.println();
- }
- }
-
- public MozillaDropInfo canExternalDrop(nsIDOMMouseEvent mouseEvent,
- String flavor, String data) {
- InnerDragBuffer.object = null;
- onHideTooltip();
-
- if (dropWindow.active) {
- if (!mouseEvent.getAltKey()) {
- dropWindow.close();
- } else {
- return new MozillaDropInfo(false, null, 0);
- }
- }
- if (mouseEvent.getAltKey()) {
- nsIDOMEvent event = (nsIDOMEvent) mouseEvent
- .queryInterface(nsIDOMEvent.NS_IDOMEVENT_IID);
- nsIDOMNode visualNode = (nsIDOMNode) event.getTarget()
- .queryInterface(nsIDOMNode.NS_IDOMNODE_IID);
- Node sourceNode = domMapping.getNearSourceNode(visualNode);
- if (sourceNode != null) {
- if (ModelTransfer.MODEL.equals(flavor)) {
- // XModelObject object =
- // PreferenceModelUtilities.getPreferenceModel().
- // getModelBuffer().source();
- // InnerDragBuffer.object = object;
- } else {
- dropWindow.flavor = flavor;
- }
- dropWindow.active = true;
- dropWindow.setEventPosition(mouseEvent.getScreenX(), mouseEvent
- .getScreenY());
- dropWindow.setInitialTargetNode(sourceNode);
- dropWindow.open();
- mouseEvent.stopPropagation();
- mouseEvent.preventDefault();
- return new MozillaDropInfo(false, null, 0);
- }
- }
- boolean canDrop = false;
- nsIDOMNode caretParent = null;
- long caretOffset = 0;
-
- if (MODEL_FLAVOR.equals(flavor)) {
- XModelObject object = PreferenceModelUtilities.getPreferenceModel()
- .getModelBuffer().source();
- if (object.getFileType() == XModelObject.FILE
- && !TLDUtil.isTaglib(object)) {
- IFile f = (IFile) EclipseResourceUtil.getResource(object);
- canDrop = f != null;
- VpeVisualInnerDropInfo visualDropInfo = selectionBuilder
- .getInnerDropInfo(mouseEvent);
- caretParent = visualDropInfo.getDropContainer();
- caretOffset = visualDropInfo.getDropOffset();
- } else {
- String tagname = getTagName(object);
- if (tagname.indexOf("taglib") >= 0)tagname = "taglib"; //$NON-NLS-1$ //$NON-NLS-2$
- Node sourceDragNode = ((Document) getModel().getAdapter(
- Document.class)).createElement(tagname);
- VpeVisualInnerDropInfo visualDropInfo = selectionBuilder
- .getInnerDropInfo(mouseEvent);
- if (visualDropInfo.getDropContainer() != null) {
- VpeSourceInnerDropInfo sourceDropInfo = visualBuilder
- .getSourceInnerDropInfo(sourceDragNode,
- visualDropInfo, true);
- canDrop = sourceDropInfo.canDrop();
- if (canDrop) {
- VpeVisualInnerDropInfo newVisualDropInfo = visualBuilder
- .getInnerDropInfo(
- sourceDropInfo.getContainer(),
- sourceDropInfo.getOffset());
- if (newVisualDropInfo != null) {
- visualBuilder.correctVisualDropPosition(
- newVisualDropInfo, visualDropInfo);
- caretParent = newVisualDropInfo.getDropContainer();
- caretOffset = newVisualDropInfo.getDropOffset();
- }
- }
- }
- visualDropInfo.release();
- }
- } else if (XulRunnerEditor.TRANS_FLAVOR_kFileMime.equals(flavor)
- || XulRunnerEditor.TRANS_FLAVOR_kURLMime.equals(flavor)) {
- VpeVisualInnerDropInfo visualDropInfo = selectionBuilder
- .getInnerDropInfo(mouseEvent);
- caretParent = visualDropInfo.getDropContainer();
- caretOffset = visualDropInfo.getDropOffset();
- canDrop = true;
-
- }
- if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
- System.out
- .println(" canDrop: " + canDrop + (canDrop ? " container: " + caretParent.getNodeName() + " offset: " + caretOffset : "")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
- return new MozillaDropInfo(canDrop, caretParent, caretOffset);
-
- }
-
- public VpeSourceInnerDropInfo canExternalDropMacro(XModelObject object,
- Node parentNode, int offset) {
- String tagname = getTagName(object);
- Node sourceDragNode = ((Document) getModel().getAdapter(Document.class))
- .createElement(tagname);
- return visualBuilder.getSourceInnerDropInfo(sourceDragNode, parentNode,
- offset, false);
- }
-
- public void externalDropAny(final String flavor, final String data,
- final Point range, Node container) {
- if (flavor == null || flavor.length() == 0)
- return;
- IDropCommand dropCommand = DropCommandFactory.getInstance()
- .getDropCommand(flavor, JSPTagProposalFactory.getInstance());
-
- boolean promptAttributes = JspEditorPlugin.getDefault()
- .getPreferenceStore().getBoolean(
- IVpePreferencesPage.ASK_TAG_ATTRIBUTES_ON_TAG_INSERT);
- dropCommand.getDefaultModel().setPromptForTagAttributesRequired(
- promptAttributes);
- DropData dropData = new DropData(flavor, data, sourceEditor
- .getEditorInput(), (ISourceViewer) sourceEditor
- .getAdapter(ISourceViewer.class), new VpeSelectionProvider(
- range.x, range.y), container);
- /*
- * https://jira.jboss.org/jira/browse/JBIDE-4982 Setting the value
- * provider to create tag insert dialog.
- */
- if (sourceEditor instanceof JSPTextEditor) {
- dropData.setValueProvider(((JSPTextEditor) sourceEditor)
- .createAttributeDescriptorValueProvider());
- }
-
- dropCommand.execute(dropData);
- }
-
- private String getTagName(XModelObject object) {
+ public String getTagName(XModelObject object) {
String tagname = object.getAttributeValue("name"); //$NON-NLS-1$
XModelObject parent = object.getParent();
@@ -2451,88 +2048,6 @@
return tagname;
}
- public void externalDrop(nsIDOMMouseEvent mouseEvent, String flavor,
- String data) {
- onHideTooltip();
-
- VpeVisualInnerDropInfo visualDropInfo = selectionBuilder
- .getInnerDropInfo(mouseEvent);
- Point range = selectionBuilder.getSourceSelectionRangeAtVisualNode(
- visualDropInfo.getDropContainer(), (int) visualDropInfo
- .getDropOffset());
-
- // if (MODEL_FLAVOR.equals(flavor)) {
- // XModelObject object = PreferenceModelUtilities.getPreferenceModel()
- // .getModelBuffer().source();
- // if(object == null)
-
- final DragTransferData dragTransferData = DndUtil.getDragTransferData();
- final nsISupports aValue = dragTransferData.getValue();
-
- String aFlavor = ""; //$NON-NLS-1$
- if (VpeDndUtil.isNsIFileInstance(aValue)) {
- nsIFile aFile = (nsIFile) aValue
- .queryInterface(nsIFile.NS_IFILE_IID);
-
- // because it is external, convert the path to URL
- final String path = aFile.getPath();
- data = path != null ? DropUtils.convertPathToUrl(path) : null;
- aFlavor = DndUtil.kFileMime;
-
- } else if (VpeDndUtil.isNsICStringInstance(aValue)) {
- nsISupportsCString aString = (nsISupportsCString) aValue
- .queryInterface(nsISupportsCString.NS_ISUPPORTSCSTRING_IID);
- data = aString.getData();
- aFlavor = DndUtil.kHTMLMime;
- } else if (VpeDndUtil.isNsIStringInstance(aValue)) {
- nsISupportsString aString = (nsISupportsString) aValue
- .queryInterface(nsISupportsString.NS_ISUPPORTSSTRING_IID);
- data = aString.getData();
- if (MODEL_FLAVOR.equals(dragTransferData.getFlavor())) {
- aFlavor = dragTransferData.getFlavor();
- } else {
- aFlavor = DndUtil.kURLMime;
- }
- }
-
- // if (object.getFileType() == XModelObject.FILE
- // && !TLDUtil.isTaglib(object)) {
- // flavor = "application/x-moz-file"; //$NON-NLS-1$
- // IFile f = (IFile) EclipseResourceUtil.getResource(object);
- // try {
- // data = f.getLocation().toFile().toURL().toString();
- // } catch (Exception e) {
- // VpePlugin.getPluginLog().logError(e);
- // }
- // } else {
- // String tagname = getTagName(object);
- // if (tagname.indexOf("taglib") >= 0)tagname = "taglib"; //$NON-NLS-1$ //$NON-NLS-2$
- // Node sourceDragNode = ((Document) getModel().getAdapter(
- // Document.class)).createElement(tagname);
- // if (visualDropInfo.getDropContainer() != null) {
- // sourceDropInfo = visualBuilder.getSourceInnerDropInfo(
- // sourceDragNode, visualDropInfo, true);
- // range = selectionBuilder.getSourceSelectionRange(
- // sourceDropInfo.getContainer(), sourceDropInfo
- // .getOffset());
- // }
- // }
-
- if (visualDropInfo.getDropContainer() != null && data != null) {
- if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
- System.out
- .println(" drop! container: " + visualDropInfo.getDropContainer().getNodeName()); //$NON-NLS-1$
- }
- externalDropAny(aFlavor, data, range, null);
-
- // TypedEvent tEvent = new TypedEvent(mouseEvent);
- // tEvent.data = data;
- // dropContext.setFlavor(aFlavor);
- // dropContext.setMimeData(data);
- // DnDUtil.fireDnDEvent(dropContext, textEditor, tEvent);
- }
- }
-
public void onShowTooltip(int x, int y, final String text) {
if (tip != null && !tip.isDisposed())
@@ -2808,11 +2323,10 @@
// return Mozilla.getInstance().queryInterface(this, arg0);
// }
-
/**
* Calls when editor content changed, and we should highlight selected element.
*/
- private void onRefresh() {
+ public void onRefresh() {
// when we using separate thread to display selection rectangle
// it's working better than without
/*
@@ -2845,18 +2359,6 @@
}
/**
- * Start drag session
- */
- public void startDragSession(nsIDOMEvent domEvent) {
- dnd.startDragSession(domEvent);
- }
-
- public void dragDrop(nsIDOMEvent domEvent) {
- dnd.dragDrop(domEvent);
- onRefresh();
- }
-
- /**
* @return the selectionBuilder
*/
public VpeSelectionBuilder getSelectionBuilder() {
@@ -3028,4 +2530,11 @@
this.zoomEventManager = zoomEventManager;
}
+ public ActiveEditorSwitcher getSwitcher() {
+ return switcher;
+ }
+
+ public VpeDropWindow getDropWindow() {
+ return dropWindow;
+ }
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeDropWindow.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeDropWindow.java 2010-03-18 13:42:33 UTC (rev 20905)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeDropWindow.java 2010-03-18 15:59:15 UTC (rev 20906)
@@ -234,5 +234,20 @@
}
return fTransferDropTargetListeners;
}
-
+
+ public boolean isActive() {
+ return active;
+ }
+
+ public void setActive(boolean active) {
+ this.active = active;
+ }
+
+ public String getFlavor() {
+ return flavor;
+ }
+
+ public void setFlavor(String flavor) {
+ this.flavor = flavor;
+ }
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSelectionBuilder.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSelectionBuilder.java 2010-03-18 13:42:33 UTC (rev 20905)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSelectionBuilder.java 2010-03-18 15:59:15 UTC (rev 20906)
@@ -910,7 +910,7 @@
return position;
}
- Point getSourceSelectionRangeAtVisualNode(nsIDOMNode visualInitNode, int visualInitOffset) {
+ public Point getSourceSelectionRangeAtVisualNode(nsIDOMNode visualInitNode, int visualInitOffset) {
if (visualInitNode.getNodeType() == Node.TEXT_NODE) {
Node sourceNode = domMapping.getSourceNode(visualInitNode);
if (sourceNode == null) {
@@ -1208,7 +1208,7 @@
setSelection(selection);
}
- VpeVisualInnerDragInfo getInnerDragInfo(nsIDOMMouseEvent event) {
+ public VpeVisualInnerDragInfo getInnerDragInfo(nsIDOMMouseEvent event) {
nsIDOMElement selectedElement
= visualBuilder.getXulRunnerEditor().getLastSelectedElement();
if (selectedElement == null) {
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2010-03-18 13:42:33 UTC (rev 20905)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2010-03-18 15:59:15 UTC (rev 20906)
@@ -1567,7 +1567,7 @@
return false;
}
- boolean canInnerDrag(nsIDOMElement visualDragElement) {
+ public boolean canInnerDrag(nsIDOMElement visualDragElement) {
VpeNodeMapping node = domMapping.getNodeMapping(visualDragElement);
if (node instanceof VpeElementMapping) {
VpeElementMapping elementMapping = (VpeElementMapping) node;
@@ -1582,7 +1582,7 @@
return false;
}
- VpeSourceInnerDropInfo getSourceInnerDropInfo(Node sourceDragNode,
+ public VpeSourceInnerDropInfo getSourceInnerDropInfo(Node sourceDragNode,
VpeVisualInnerDropInfo visualDropInfo, boolean checkParentTemplates) {
nsIDOMNode visualDropContainer = visualDropInfo.getDropContainer();
long visualDropOffset = visualDropInfo.getDropOffset();
@@ -1669,7 +1669,7 @@
}
}
- VpeSourceInnerDropInfo getSourceInnerDropInfo(Node dragNode,
+ public VpeSourceInnerDropInfo getSourceInnerDropInfo(Node dragNode,
Node container, int offset, boolean checkParentsTemplates) {
// Thread.dumpStack();
boolean canDrop = false;
@@ -1746,7 +1746,7 @@
}
}
- void innerDrop(VpeSourceInnerDragInfo dragInfo,
+ public void innerDrop(VpeSourceInnerDragInfo dragInfo,
VpeSourceInnerDropInfo dropInfo) {
dropper.drop(pageContext, dragInfo, dropInfo);
}
@@ -1806,7 +1806,7 @@
return true;
}
- VpeVisualInnerDropInfo getInnerDropInfo(Node sourceDropContainer,
+ public VpeVisualInnerDropInfo getInnerDropInfo(Node sourceDropContainer,
int sourceDropOffset) {
nsIDOMNode visualDropContainer = null;
long visualDropOffset = 0;
@@ -1964,7 +1964,7 @@
return visualLastChild;
}
- void correctVisualDropPosition(VpeVisualInnerDropInfo newVisualDropInfo,
+ public void correctVisualDropPosition(VpeVisualInnerDropInfo newVisualDropInfo,
VpeVisualInnerDropInfo oldVisualDropInfo) {
nsIDOMNode newVisualDropContainer = newVisualDropInfo
.getDropContainer();
@@ -2077,7 +2077,7 @@
return null;
}
- VpeSourceInnerDragInfo getSourceInnerDragInfo(
+ public VpeSourceInnerDragInfo getSourceInnerDragInfo(
VpeVisualInnerDragInfo visualDragInfo) {
nsIDOMNode visualNode = visualDragInfo.getNode();
int offset = visualDragInfo.getOffset();
14 years, 6 months
JBoss Tools SVN: r20905 - in trunk/hibernatetools/plugins: org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2010-03-18 09:42:33 -0400 (Thu, 18 Mar 2010)
New Revision: 20905
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/IRevEngGenerator.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/MapperMessages.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/MapperMessages.properties
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/GeneratorDetailsPage.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/model/DOMReverseEngineeringDefinition.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/model/RevEngGeneratorAdapter.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-6075
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/IRevEngGenerator.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/IRevEngGenerator.java 2010-03-18 11:35:56 UTC (rev 20904)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/IRevEngGenerator.java 2010-03-18 13:42:33 UTC (rev 20905)
@@ -28,4 +28,6 @@
IRevEngParameter[] getParameters();
void setGeneratorClassName(String value);
+
+ void addParameter();
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/MapperMessages.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/MapperMessages.java 2010-03-18 11:35:56 UTC (rev 20904)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/MapperMessages.java 2010-03-18 13:42:33 UTC (rev 20905)
@@ -34,6 +34,7 @@
public static String CounterFormPart_debug_counter_for_property_changes;
public static String CounterFormPart_zero;
public static String GeneratorDetailsPage_class;
+ public static String GeneratorDetailsPage_add_param;
public static String GeneratorDetailsPage_id_generator_details;
public static String GeneratorDetailsPage_set_the_properties_of_the_selected_generator;
public static String HibernateConfigurationForm_hibernate_configuration;
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/MapperMessages.properties
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/MapperMessages.properties 2010-03-18 11:35:56 UTC (rev 20904)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/MapperMessages.properties 2010-03-18 13:42:33 UTC (rev 20905)
@@ -28,6 +28,7 @@
CounterFormPart_debug_counter_for_property_changes=debug counter for property changes
CounterFormPart_zero=Zero
GeneratorDetailsPage_class=Class:
+GeneratorDetailsPage_add_param=Add parameter
GeneratorDetailsPage_id_generator_details=Id Generator details
GeneratorDetailsPage_set_the_properties_of_the_selected_generator=Set the properties of the selected generator.
HibernateConfigurationForm_hibernate_configuration=Hibernate Configuration
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/GeneratorDetailsPage.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/GeneratorDetailsPage.java 2010-03-18 11:35:56 UTC (rev 20904)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/GeneratorDetailsPage.java 2010-03-18 13:42:33 UTC (rev 20905)
@@ -27,6 +27,9 @@
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.forms.IDetailsPage;
import org.eclipse.ui.forms.IFormPart;
@@ -53,9 +56,21 @@
generator.setGeneratorClassName(entry.getValue());
}
});
+
+ Button button = toolkit.createButton(client, MapperMessages.GeneratorDetailsPage_add_param, SWT.NULL);
+ button.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ handleAddParameter();
+ }
+
+ });
}
+ protected void handleAddParameter() {
+ generator.addParameter();
+ }
+
public void selectionChanged(IFormPart part, ISelection selection) {
IRevEngGenerator newTable = (IRevEngGenerator) ((IStructuredSelection)selection).getFirstElement();
if(generator!=null) {
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/model/DOMReverseEngineeringDefinition.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/model/DOMReverseEngineeringDefinition.java 2010-03-18 11:35:56 UTC (rev 20904)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/model/DOMReverseEngineeringDefinition.java 2010-03-18 13:42:33 UTC (rev 20905)
@@ -32,9 +32,9 @@
import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.hibernate.dialect.FirebirdDialect;
import org.hibernate.eclipse.console.model.IRevEngColumn;
import org.hibernate.eclipse.console.model.IRevEngGenerator;
+import org.hibernate.eclipse.console.model.IRevEngParameter;
import org.hibernate.eclipse.console.model.IRevEngPrimaryKey;
import org.hibernate.eclipse.console.model.IRevEngTable;
import org.hibernate.eclipse.console.model.IReverseEngineeringDefinition;
@@ -45,7 +45,6 @@
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
public class DOMReverseEngineeringDefinition implements IReverseEngineeringDefinition {
@@ -392,5 +391,9 @@
public IRevEngGenerator createGenerator() {
return (IRevEngGenerator) factory.adapt((INodeNotifier) getDocument().createElement("generator")); //$NON-NLS-1$
}
+
+ public IRevEngParameter createParameter() {
+ return (IRevEngParameter) factory.adapt((INodeNotifier) getDocument().createElement("param")); //$NON-NLS-1$
+ }
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/model/RevEngGeneratorAdapter.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/model/RevEngGeneratorAdapter.java 2010-03-18 11:35:56 UTC (rev 20904)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/model/RevEngGeneratorAdapter.java 2010-03-18 13:42:33 UTC (rev 20905)
@@ -50,5 +50,11 @@
public void setGeneratorClassName(String value) {
setAttribute("class", value, null); //$NON-NLS-1$
}
+
+ public void addParameter() {
+ DOMAdapter key = (DOMAdapter) getModel().createParameter();
+ getNode().insertBefore(key.getNode(), getNode().getFirstChild());
+ DOMModelUtil.formatNode(getNode().getParentNode());
+ }
}
14 years, 6 months