JBoss Tools SVN: r6102 - in trunk/as/plugins/org.jboss.ide.eclipse.as.core: jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-02-03 20:21:52 -0500 (Sun, 03 Feb 2008)
New Revision: 6102
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/AbstractJBossLaunchConfigType.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossServerStartupLaunchConfiguration.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml
Log:
JBIDE-1292 - fix. involved digging deeper and using more official launching API.
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/AbstractJBossLaunchConfigType.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/AbstractJBossLaunchConfigType.java 2008-02-03 15:51:12 UTC (rev 6101)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/AbstractJBossLaunchConfigType.java 2008-02-04 01:21:52 UTC (rev 6102)
@@ -7,7 +7,6 @@
import java.util.Map;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
@@ -31,7 +30,7 @@
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
public abstract class AbstractJBossLaunchConfigType extends AbstractJavaLaunchConfigurationDelegate {
- protected static final String SERVER_ID = "server-id";
+ public static final String SERVER_ID = "server-id";
// we have no need to do anything in pre-launch check
public boolean preLaunchCheck(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException {
@@ -125,31 +124,29 @@
list.add(JavaRuntime.newArchiveRuntimeClasspathEntry(new Path(getServerHome(jbs)).append(relative)));
}
+ @Deprecated
protected static ArrayList<String> convertClasspath(ArrayList<IRuntimeClasspathEntry> cp, IVMInstall vmInstall) {
+ addJREEntry(cp, vmInstall);
+ return convertClasspath(cp);
+ }
+
+ protected static void addJREEntry(ArrayList<IRuntimeClasspathEntry> cp, IVMInstall vmInstall) {
if (vmInstall != null) {
- try {
- cp.add(JavaRuntime.newRuntimeContainerClasspathEntry(
- new Path(JavaRuntime.JRE_CONTAINER).append(
- "org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType")
- .append(vmInstall.getName()),
- IRuntimeClasspathEntry.BOOTSTRAP_CLASSES));
- } catch (CoreException e) {
- IStatus s = new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
- "Unexpected Exception converting launch classpath: ", e);
- JBossServerCorePlugin.getDefault().getLog().log(s);
- }
-
- IPath jrePath = new Path(vmInstall.getInstallLocation()
- .getAbsolutePath());
- if (jrePath != null) {
- IPath toolsPath = jrePath.append("lib").append("tools.jar");
- if (toolsPath.toFile().exists()) {
- cp.add(JavaRuntime
- .newArchiveRuntimeClasspathEntry(toolsPath));
- }
+ try {
+ cp.add(JavaRuntime.newRuntimeContainerClasspathEntry(
+ new Path(JavaRuntime.JRE_CONTAINER)
+ .append(vmInstall.getVMInstallType().getId()).append(vmInstall.getName()),
+// "org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType")
+ IRuntimeClasspathEntry.BOOTSTRAP_CLASSES));
+ } catch (CoreException e) {
+ IStatus s = new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
+ "Unexpected Exception converting launch classpath: ", e);
+ JBossServerCorePlugin.getDefault().getLog().log(s);
}
}
-
+ }
+
+ protected static ArrayList<String> convertClasspath(ArrayList<IRuntimeClasspathEntry> cp) {
Iterator<IRuntimeClasspathEntry> cpi = cp.iterator();
ArrayList<String> list = new ArrayList<String>();
while (cpi.hasNext()) {
@@ -188,4 +185,12 @@
public static String getServerHome(JBossServer jbs) {
return jbs.getServer().getRuntime().getLocation().toOSString();
}
+
+ public IVMInstall getVMInstall(ILaunchConfiguration configuration) throws CoreException {
+ String serverId = configuration.getAttribute(SERVER_ID, (String)null);
+ JBossServer jbs = findJBossServer(serverId);
+ IJBossServerRuntime jbrt = findJBossServerRuntime(jbs.getServer());
+ return jbrt.getVM();
+ }
+
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossServerStartupLaunchConfiguration.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossServerStartupLaunchConfiguration.java 2008-02-03 15:51:12 UTC (rev 6101)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossServerStartupLaunchConfiguration.java 2008-02-04 01:21:52 UTC (rev 6102)
@@ -38,6 +38,7 @@
import org.eclipse.debug.core.model.IProcess;
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
+import org.eclipse.jdt.launching.StandardClasspathProvider;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.ServerUtil;
import org.eclipse.wst.server.core.internal.ServerType;
@@ -49,7 +50,6 @@
public class JBossServerStartupLaunchConfiguration extends AbstractJBossLaunchConfigType {
protected static final char[] INVALID_CHARS = new char[] {'\\', '/', ':', '*', '?', '"', '<', '>', '|', '\0', '@', '&'};
-
private static final String LAUNCH_TYPE = "org.jboss.ide.eclipse.as.core.server.startupConfiguration";
private static final String DEFAULTS_SET = "jboss.defaults.been.set";
private static final String START_JAR_LOC = "bin" + Path.SEPARATOR + "run.jar";
@@ -64,28 +64,21 @@
public static void setupLaunchConfiguration(
ILaunchConfigurationWorkingCopy workingCopy, IServer server) throws CoreException {
- ensureDefaultsSet(workingCopy, server);
+ if(!workingCopy.getAttributes().containsKey(DEFAULTS_SET)) {
+ forceDefaultsSet(workingCopy, server);
+ }
}
- public static void ensureDefaultsSet(ILaunchConfigurationWorkingCopy wc, IServer server) throws CoreException {
- if(!wc.getAttributes().containsKey(DEFAULTS_SET)) {
- JBossServer jbs = findJBossServer(server.getId());
- IJBossServerRuntime jbrt = findJBossServerRuntime(server);
- String serverHome = getServerHome(jbs);
-
- wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, getDefaultArgs(jbs));
- wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, getDefaultVMArgs(jbs));
-
- wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, START_MAIN_TYPE);
- wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, serverHome + Path.SEPARATOR + "bin");
- ArrayList<IRuntimeClasspathEntry> classpath = new ArrayList<IRuntimeClasspathEntry>();
- addCPEntry(classpath, jbs, START_JAR_LOC);
- ArrayList<String> runtimeClassPaths = convertClasspath(classpath, jbrt.getVM());
- String cpKey = IJavaLaunchConfigurationConstants.ATTR_CLASSPATH;
- wc.setAttribute(cpKey, runtimeClassPaths);
- wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH, false);
- wc.setAttribute(DEFAULTS_SET, true);
- }
+ public static void forceDefaultsSet(ILaunchConfigurationWorkingCopy wc, IServer server) throws CoreException {
+ JBossServer jbs = findJBossServer(server.getId());
+ String serverHome = getServerHome(jbs);
+
+ wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, getDefaultArgs(jbs));
+ wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, getDefaultVMArgs(jbs));
+ wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, START_MAIN_TYPE);
+ wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, serverHome + Path.SEPARATOR + "bin");
+ wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH_PROVIDER, "org.jboss.ide.eclipse.as.core.launch.classpathProvider");
+ wc.setAttribute(DEFAULTS_SET, true);
}
public static String getDefaultArgs(JBossServer jbs) throws CoreException {
@@ -182,4 +175,29 @@
return wc;
}
+
+ public static class StartupClasspathProvider extends StandardClasspathProvider {
+
+ public IRuntimeClasspathEntry[] computeUnresolvedClasspath(ILaunchConfiguration configuration) throws CoreException {
+ boolean useDefault = configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH, true);
+ if (useDefault) {
+ return computeUnresolvedDefaultClasspath(configuration);
+ }
+ // recover persisted classpath
+ return recoverRuntimePath(configuration, IJavaLaunchConfigurationConstants.ATTR_CLASSPATH);
+ }
+
+ protected IRuntimeClasspathEntry[] computeUnresolvedDefaultClasspath(ILaunchConfiguration configuration) throws CoreException {
+ String serverId = configuration.getAttribute(SERVER_ID, (String)null);
+ JBossServer jbs = findJBossServer(serverId);
+ IJBossServerRuntime jbrt = findJBossServerRuntime(jbs.getServer());
+ ArrayList<IRuntimeClasspathEntry> classpath = new ArrayList<IRuntimeClasspathEntry>();
+ addCPEntry(classpath, jbs, START_JAR_LOC);
+ addJREEntry(classpath, jbrt.getVM());
+ return (IRuntimeClasspathEntry[]) classpath
+ .toArray(new IRuntimeClasspathEntry[classpath.size()]);
+ }
+
+ }
+
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml 2008-02-03 15:51:12 UTC (rev 6101)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml 2008-02-04 01:21:52 UTC (rev 6102)
@@ -464,4 +464,11 @@
</facet>
</default-facets>
</extension>
+ <extension
+ point="org.eclipse.jdt.launching.classpathProviders">
+ <classpathProvider
+ class="org.jboss.ide.eclipse.as.core.server.internal.launch.JBossServerStartupLaunchConfiguration$StartupClasspathProvider"
+ id="org.jboss.ide.eclipse.as.core.launch.classpathProvider">
+ </classpathProvider>
+ </extension>
</plugin>
16 years, 3 months
JBoss Tools SVN: r6101 - trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner.
by jbosstools-commits@lists.jboss.org
Author: svasilyev
Date: 2008-02-03 10:51:12 -0500 (Sun, 03 Feb 2008)
New Revision: 6101
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/XPCOM.java
Log:
Code adjustment
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/XPCOM.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/XPCOM.java 2008-02-03 15:51:00 UTC (rev 6100)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/XPCOM.java 2008-02-03 15:51:12 UTC (rev 6101)
@@ -16,16 +16,19 @@
*
*/
public final class XPCOM {
- private XPCOM() {};
+ private XPCOM() {}
/*
* Contract IDs
*/
- public static final String NS_DRAGSERVICE_CONTRACTID = "@mozilla.org/widget/dragservice;1;"; //$NON-NLS-1$
+ public static final String NS_DRAGSERVICE_CONTRACTID = "@mozilla.org/widget/dragservice;1"; //$NON-NLS-1$
public static final String NS_TRANSFERABLE_CONTRACTID = "@mozilla.org/widget/transferable;1"; //$NON-NLS-1$
public static final String NS_WINDOWWATCHER_CONTRACTID = "@mozilla.org/embedcomp/window-watcher;1"; //$NON-NLS-1$
public static final String NS_PREFSERVICE_CONTRACTID = "@mozilla.org/preferences-service;1"; //$NON-NLS-1$
- public static final String IN_FLASHER_CONTRACTID = "@mozilla.org/inspector/flasher;1";
+ public static final String NS_SUPPORTSSTRING_CONTRACTID = "@mozilla.org/supports-string;1"; //$NON-NLS-1$
+ public static final String NS_SUPPORTSARRAY_CONTRACTID = "@mozilla.org/supports-array;1"; //$NON-NLS-1$
- public static final String NS_IWEBBROWSER_CID = "F1EAC761-87E9-11d3-AF80-00A024FFC08C"; // $NON-NLS-1$
- public static final String NS_IAPPSHELL_CID = "2d96b3df-c051-11d1-a827-0040959a28c9"; // $NON-NLS-1$
+ public static final String IN_FLASHER_CONTRACTID = "@mozilla.org/inspector/flasher;1"; //$NON-NLS-1$
+
+ public static final String NS_IWEBBROWSER_CID = "F1EAC761-87E9-11d3-AF80-00A024FFC08C"; //$NON-NLS-1$
+ public static final String NS_IAPPSHELL_CID = "2d96b3df-c051-11d1-a827-0040959a28c9"; //$NON-NLS-1$
}
16 years, 3 months
JBoss Tools SVN: r6100 - 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: svasilyev
Date: 2008-02-03 10:51:00 -0500 (Sun, 03 Feb 2008)
New Revision: 6100
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/VpeSelectionBuilder.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java
Log:
Code adjustment
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 2008-02-02 11:35:52 UTC (rev 6099)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/VpeDnD.java 2008-02-03 15:51:00 UTC (rev 6100)
@@ -14,6 +14,7 @@
import org.jboss.tools.vpe.editor.VpeController;
import org.jboss.tools.vpe.editor.mozilla.EditorDomEventListener;
import org.jboss.tools.vpe.editor.mozilla.MozillaDropInfo;
+import org.jboss.tools.vpe.xulrunner.XPCOM;
import org.mozilla.interfaces.nsIComponentManager;
import org.mozilla.interfaces.nsIDOMEvent;
import org.mozilla.interfaces.nsIDOMMouseEvent;
@@ -31,13 +32,6 @@
*Class which response for drag and drop functionality
*/
public class VpeDnD {
-
- private static final String CID_DRAGSERVICE = "@mozilla.org/widget/dragservice;1";
- private static final String CID_TRANSFERABLE = "@mozilla.org/widget/transferable;1";
- private static final String CID_SUPPORTSSTRING = "@mozilla.org/supports-string;1";
-
- private static final String CID_SUPPORTSARRAY = "@mozilla.org/supports-array;1";
-
/**
* service manager */
private nsIServiceManager serviceManager;
@@ -59,7 +53,7 @@
*/
public void startDragSession(nsIDOMEvent domEvent) {
nsISupportsArray transArray = (nsISupportsArray) getComponentManager()
- .createInstanceByContractID(CID_SUPPORTSARRAY, null,
+ .createInstanceByContractID(XPCOM.NS_SUPPORTSARRAY_CONTRACTID, null,
nsISupportsArray.NS_ISUPPORTSARRAY_IID);
transArray.appendElement(createTransferable());
getDragService().invokeDragSession((nsIDOMNode) domEvent.getTarget().queryInterface(nsIDOMNode.NS_IDOMNODE_IID), transArray, null,
@@ -80,22 +74,22 @@
private nsITransferable createTransferable() {
nsITransferable iTransferable = (nsITransferable) getComponentManager()
- .createInstanceByContractID(CID_TRANSFERABLE, null,
+ .createInstanceByContractID(XPCOM.NS_TRANSFERABLE_CONTRACTID, null,
nsITransferable.NS_ITRANSFERABLE_IID);
nsISupportsString transferData = (nsISupportsString) getComponentManager()
- .createInstanceByContractID(CID_SUPPORTSSTRING, null,
+ .createInstanceByContractID(XPCOM.NS_SUPPORTSSTRING_CONTRACTID, null,
nsISupportsString.NS_ISUPPORTSSTRING_IID);
- String data="vpe-element";
+ String data="vpe-element"; //$NON-NLS-1$
transferData.setData(data);
iTransferable.setTransferData(VpeController.MODEL_FLAVOR, transferData, data.length());
- iTransferable.setTransferData("text/plain", transferData, data.length());
- iTransferable.setTransferData("text/unicode", transferData,data.length()*2);
- iTransferable.setTransferData("text/html", transferData, data.length()*2);
- iTransferable.setTransferData("text/xml", transferData, data.length()*2);
- iTransferable.setTransferData("text/rtf", transferData, data.length()*2);
- iTransferable.setTransferData("text/enriched", transferData, data.length()*2);
- iTransferable.setTransferData("text/richtext", transferData, data.length()*2);
- iTransferable.setTransferData("text/t140", transferData, data.length()*2);
+ iTransferable.setTransferData("text/plain", transferData, data.length()); //$NON-NLS-1$
+ iTransferable.setTransferData("text/unicode", transferData,data.length()*2); //$NON-NLS-1$
+ iTransferable.setTransferData("text/html", transferData, data.length()*2); //$NON-NLS-1$
+ iTransferable.setTransferData("text/xml", transferData, data.length()*2); //$NON-NLS-1$
+ iTransferable.setTransferData("text/rtf", transferData, data.length()*2); //$NON-NLS-1$
+ iTransferable.setTransferData("text/enriched", transferData, data.length()*2); //$NON-NLS-1$
+ iTransferable.setTransferData("text/richtext", transferData, data.length()*2); //$NON-NLS-1$
+ iTransferable.setTransferData("text/t140", transferData, data.length()*2); //$NON-NLS-1$
return iTransferable;
}
@@ -131,7 +125,7 @@
if(dragService==null) {
dragService = (nsIDragService) getServiceManager()
- .getServiceByContractID(CID_DRAGSERVICE,
+ .getServiceByContractID(XPCOM.NS_DRAGSERVICE_CONTRACTID,
nsIDragService.NS_IDRAGSERVICE_IID);
}
return dragService;
@@ -152,7 +146,7 @@
if(getDragService().getCurrentSession().getSourceNode()==null){
//external drag
- info = editorDomEventListener.canExternalDrop(mouseEvent, VpeController.MODEL_FLAVOR, "");
+ info = editorDomEventListener.canExternalDrop(mouseEvent, VpeController.MODEL_FLAVOR, ""); //$NON-NLS-1$
} else {
//internal drag
info = editorDomEventListener.canInnerDrop(mouseEvent);
@@ -179,7 +173,7 @@
if(getDragService().getCurrentSession().getSourceDocument()==null) {
//in this case it's is external drag
- editorDomEventListener.externalDrop((nsIDOMMouseEvent)domEvent.queryInterface(nsIDOMMouseEvent.NS_IDOMMOUSEEVENT_IID), VpeController.MODEL_FLAVOR, "");
+ editorDomEventListener.externalDrop((nsIDOMMouseEvent)domEvent.queryInterface(nsIDOMMouseEvent.NS_IDOMMOUSEEVENT_IID), VpeController.MODEL_FLAVOR, ""); //$NON-NLS-1$
} else {
// in this case it's is an internal drag
editorDomEventListener.innerDrop((nsIDOMMouseEvent)domEvent.queryInterface(nsIDOMMouseEvent.NS_IDOMMOUSEEVENT_IID));
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 2008-02-02 11:35:52 UTC (rev 6099)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSelectionBuilder.java 2008-02-03 15:51:00 UTC (rev 6100)
@@ -337,7 +337,7 @@
Node setContextMenuSelection(nsIDOMNode visualNode) {
if (VpeDebug.PRINT_VISUAL_CONTEXTMENU_EVENT) {
- System.out.println(">>>>>>>>>>>>>> onShowContextMenu visualNode: " + visualNode.getNodeName() + "(" + visualNode + ")");
+ System.out.println(">>>>>>>>>>>>>> onShowContextMenu visualNode: " + visualNode.getNodeName() + "(" + visualNode + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
visualSelectionController.setCaretEnabled(false);
@@ -659,8 +659,8 @@
if (!anchorStartFlag) visualAnchorOffset++;
}
if (VpeDebug.PRINT_SOURCE_SELECTION_EVENT) {
- System.out.println("setVisualSelection");
- System.out.println(" visualAnchorNode: " + visualAnchorNode.getNodeName() + "(" + visualAnchorNode + ") visualAnchorContainer: " + visualAnchorContainer.getNodeName() + "(" + visualAnchorContainer + ") visualAnchorOffset: " + visualAnchorOffset + " anchorStartFlag: " + anchorStartFlag);
+ System.out.println("setVisualSelection"); //$NON-NLS-1$
+ System.out.println(" visualAnchorNode: " + visualAnchorNode.getNodeName() + "(" + visualAnchorNode + ") visualAnchorContainer: " + visualAnchorContainer.getNodeName() + "(" + visualAnchorContainer + ") visualAnchorOffset: " + visualAnchorOffset + " anchorStartFlag: " + anchorStartFlag); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
}
nsIDOMNode visualFocusContainer = null;
@@ -1159,7 +1159,7 @@
nsISelection selection = visualSelectionController.getSelection(nsISelectionController.SELECTION_NORMAL);
nsIDOMNode visualNode = VisualDomUtil.getTargetNode(mouseEvent);
if (visualNode != null && visualNode.getNodeType() == Node.ELEMENT_NODE &&
- (HTML.TAG_INPUT.equalsIgnoreCase(visualNode.getNodeName()) || HTML.TAG_BUTTON.equalsIgnoreCase(visualNode.getNodeName()) || "SELECT".equalsIgnoreCase(visualNode.getNodeName())) &&
+ (HTML.TAG_INPUT.equalsIgnoreCase(visualNode.getNodeName()) || HTML.TAG_BUTTON.equalsIgnoreCase(visualNode.getNodeName()) || HTML.TAG_SELECT.equalsIgnoreCase(visualNode.getNodeName())) &&
!selection.containsNode(visualNode, false) && visualBuilder.canInnerDrag((nsIDOMElement)visualNode.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID))) {
return (nsIDOMElement)visualNode.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
}
@@ -1263,21 +1263,21 @@
void printVisualSelection() {
nsISelection selection = visualSelectionController.getSelection(nsISelectionController.SELECTION_NORMAL);
boolean collapsed = selection.getIsCollapsed();
- System.out.println(" ## VisualSelection");
- System.out.println(" ## collapsed: " + collapsed);
+ System.out.println(" ## VisualSelection"); //$NON-NLS-1$
+ System.out.println(" ## collapsed: " + collapsed); //$NON-NLS-1$
if (!collapsed) {
nsIDOMNode anchorNode = selection.getAnchorNode();
if (anchorNode != null) {
- System.out.println(" ## anchorNode: " + anchorNode.getNodeName() + " (" + anchorNode + ") offset: " + selection.getAnchorOffset());
+ System.out.println(" ## anchorNode: " + anchorNode.getNodeName() + " (" + anchorNode + ") offset: " + selection.getAnchorOffset()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
} else {
- System.out.println(" ## anchorNode: " + anchorNode);
+ System.out.println(" ## anchorNode: " + anchorNode); //$NON-NLS-1$
}
}
nsIDOMNode focusNode = selection.getFocusNode();
if (focusNode != null) {
- System.out.println(" ## focusNode: " + focusNode.getNodeName() + " (" + focusNode + ") offset: " + selection.getFocusOffset());
+ System.out.println(" ## focusNode: " + focusNode.getNodeName() + " (" + focusNode + ") offset: " + selection.getFocusOffset()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
} else {
- System.out.println(" ## focusNode: " + focusNode);
+ System.out.println(" ## focusNode: " + focusNode); //$NON-NLS-1$
}
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java 2008-02-02 11:35:52 UTC (rev 6099)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java 2008-02-03 15:51:00 UTC (rev 6100)
@@ -20,53 +20,53 @@
private HTML() {
}
- public static final String TAG_HTML = "HTML";
- public static final String TAG_HEAD = "HEAD";
- public static final String TAG_BODY = "BODY";
- public static final String TAG_IMG = "IMG";
- public static final String TAG_LINK = "LINK";
- public static final String TAG_SELECT = "SELECT";
- public static final String TAG_OPTION = "OPTION";
- public static final String TAG_STYLE = "STYLE";
- public static final String TAG_TABLE = "TABLE";
- public static final String TAG_TBODY = "TBODY";
- public static final String TAG_THEAD = "THEAD";
- public static final String TAG_TFOOT = "TFOOT";
- public static final String TAG_TH = "TH";
- public static final String TAG_TR = "TR";
- public static final String TAG_TD = "TD";
- public static final String TAG_DL = "DL";
- public static final String TAG_DT = "DT";
- public static final String TAG_COL = "COL";
- public static final String TAG_COLS = "COLS";
- public static final String TAG_COLGROUP = "COLGROUP";
- public static final String TAG_BR = "BR";
- public static final String TAG_LI = "LI";
- public static final String TAG_DIV = "DIV";
- public static final String TAG_SPAN = "SPAN";
- public static final String TAG_P = "P";
- public static final String TAG_TEXTAREA = "TEXTAREA";
- public static final String TAG_INPUT = "INPUT";
- public static final String TAG_BUTTON = "BUTTON";
- public static final String TAG_OL = "OL";
- public static final String TAG_UL = "UL";
- public static final String TAG_CODE = "CODE";
- public static final String TAG_PRE = "PRE";
+ public static final String TAG_HTML = "HTML"; //$NON-NLS-1$
+ public static final String TAG_HEAD = "HEAD"; //$NON-NLS-1$
+ public static final String TAG_BODY = "BODY"; //$NON-NLS-1$
+ public static final String TAG_IMG = "IMG"; //$NON-NLS-1$
+ public static final String TAG_LINK = "LINK"; //$NON-NLS-1$
+ public static final String TAG_SELECT = "SELECT"; //$NON-NLS-1$
+ public static final String TAG_OPTION = "OPTION"; //$NON-NLS-1$
+ public static final String TAG_STYLE = "STYLE"; //$NON-NLS-1$
+ public static final String TAG_TABLE = "TABLE"; //$NON-NLS-1$
+ public static final String TAG_TBODY = "TBODY"; //$NON-NLS-1$
+ public static final String TAG_THEAD = "THEAD"; //$NON-NLS-1$
+ public static final String TAG_TFOOT = "TFOOT"; //$NON-NLS-1$
+ public static final String TAG_TH = "TH"; //$NON-NLS-1$
+ public static final String TAG_TR = "TR"; //$NON-NLS-1$
+ public static final String TAG_TD = "TD"; //$NON-NLS-1$
+ public static final String TAG_DL = "DL"; //$NON-NLS-1$
+ public static final String TAG_DT = "DT"; //$NON-NLS-1$
+ public static final String TAG_COL = "COL"; //$NON-NLS-1$
+ public static final String TAG_COLS = "COLS"; //$NON-NLS-1$
+ public static final String TAG_COLGROUP = "COLGROUP"; //$NON-NLS-1$
+ public static final String TAG_BR = "BR"; //$NON-NLS-1$
+ public static final String TAG_LI = "LI"; //$NON-NLS-1$
+ public static final String TAG_DIV = "DIV"; //$NON-NLS-1$
+ public static final String TAG_SPAN = "SPAN"; //$NON-NLS-1$
+ public static final String TAG_P = "P"; //$NON-NLS-1$
+ public static final String TAG_TEXTAREA = "TEXTAREA"; //$NON-NLS-1$
+ public static final String TAG_INPUT = "INPUT"; //$NON-NLS-1$
+ public static final String TAG_BUTTON = "BUTTON"; //$NON-NLS-1$
+ public static final String TAG_OL = "OL"; //$NON-NLS-1$
+ public static final String TAG_UL = "UL"; //$NON-NLS-1$
+ public static final String TAG_CODE = "CODE"; //$NON-NLS-1$
+ public static final String TAG_PRE = "PRE"; //$NON-NLS-1$
- public static final String ATTR_ID = "ID";
- public static final String ATTR_TYPE = "TYPE";
- public static final String ATTR_TEXT = "TEXT";
- public static final String ATTR_CLASS = "CLASS";
- public static final String ATTR_TITLE = "TITLE";
- public static final String ATTR_NAME = "NAME";
- public static final String ATTR_VALUE = "VALUE";
- public static final String ATTR_STYLE = "STYLE";
- public static final String ATTR_SIZE = "SIZE";
- public static final String ATTR_MULTIPLE = "MULTIPLE";
- public static final String ATTR_COLSPAN = "colspan";
- public static final String ATTR_CELLSPACING = "cellspacing";
- public static final String ATTR_CELLPADDING = "cellpadding";
- public static final String ATTR_WIDTH = "WIDTH";
- public static final String ATTR_HEIGHT = "HEIGHT";
- public static final String ATTR_BORDER = "BORDER";
+ public static final String ATTR_ID = "ID"; //$NON-NLS-1$
+ public static final String ATTR_TYPE = "TYPE"; //$NON-NLS-1$
+ public static final String ATTR_TEXT = "TEXT"; //$NON-NLS-1$
+ public static final String ATTR_CLASS = "CLASS"; //$NON-NLS-1$
+ public static final String ATTR_TITLE = "TITLE"; //$NON-NLS-1$
+ public static final String ATTR_NAME = "NAME"; //$NON-NLS-1$
+ public static final String ATTR_VALUE = "VALUE"; //$NON-NLS-1$
+ public static final String ATTR_STYLE = "STYLE"; //$NON-NLS-1$
+ public static final String ATTR_SIZE = "SIZE"; //$NON-NLS-1$
+ public static final String ATTR_MULTIPLE = "MULTIPLE"; //$NON-NLS-1$
+ public static final String ATTR_COLSPAN = "colspan"; //$NON-NLS-1$
+ public static final String ATTR_CELLSPACING = "cellspacing"; //$NON-NLS-1$
+ public static final String ATTR_CELLPADDING = "cellpadding"; //$NON-NLS-1$
+ public static final String ATTR_WIDTH = "WIDTH"; //$NON-NLS-1$
+ public static final String ATTR_HEIGHT = "HEIGHT"; //$NON-NLS-1$
+ public static final String ATTR_BORDER = "BORDER"; //$NON-NLS-1$
}
\ No newline at end of file
16 years, 3 months
JBoss Tools SVN: r6099 - trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/browser.
by jbosstools-commits@lists.jboss.org
Author: svasilyev
Date: 2008-02-02 06:35:52 -0500 (Sat, 02 Feb 2008)
New Revision: 6099
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/browser/XulRunnerBrowser.java
Log:
As soon as bundled javaxpcom interfaces do not support the XULRunner 1.9 and higher the corresponding condition was added. And some the code adjusting was performed.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/browser/XulRunnerBrowser.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/browser/XulRunnerBrowser.java 2008-02-02 02:40:12 UTC (rev 6098)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/browser/XulRunnerBrowser.java 2008-02-02 11:35:52 UTC (rev 6099)
@@ -51,11 +51,11 @@
public class XulRunnerBrowser implements nsIWebBrowserChrome,
nsIWebProgressListener, nsITooltipListener {
- private static final String XULRUNNER_LOWER_VERSION = "1.8.1.2";
- private static final String XULRUNNER_HIGHER_VERSION = "*";
+ private static final String XULRUNNER_LOWER_VERSION = "1.8.1.2"; //$NON-NLS-1$
+ private static final String XULRUNNER_HIGHER_VERSION = "1.8.1.9"; //$NON-NLS-1$
// TODO Sergey Vasilyev Think. May be XULRUNNER_BUNDLE shouldn't be final?
private static final String XULRUNNER_BUNDLE;
- private static final String XULRUNNER_ENTRY = "/xulrunner";
+ private static final String XULRUNNER_ENTRY = "/xulrunner"; //$NON-NLS-1$
// TEMPORARY CODE (@see org.eclipse.swt.browser.Mozilla)
static final String XULRUNNER_INITIALIZED = "org.eclipse.swt.browser.XULRunnerInitialized"; //$NON-NLS-1$
@@ -77,10 +77,10 @@
private static boolean XULRUNNER_LOADING_INDICATOR=false;
static {
- XULRUNNER_BUNDLE = (new StringBuffer("org.mozilla.xulrunner")) // $NON-NLS-1$
- .append(".").append(Platform.getWS()) // $NON-NLS-1$
- .append(".").append(Platform.getOS()) // $NON-NLS-1$
- .append(Platform.OS_MACOSX.equals(Platform.getOS()) ? "" : (new StringBuffer(".")).append(Platform.getOSArch()).toString()) // $NON-NLS-1$ // $NON-NLS-1$
+ XULRUNNER_BUNDLE = (new StringBuffer("org.mozilla.xulrunner")) //$NON-NLS-1$
+ .append(".").append(Platform.getWS()) //$NON-NLS-1$
+ .append(".").append(Platform.getOS()) //$NON-NLS-1$
+ .append(Platform.OS_MACOSX.equals(Platform.getOS()) ? "" : (new StringBuffer(".")).append(Platform.getOSArch()).toString()) //$NON-NLS-1$ //$NON-NLS-2$
.toString();
mozilla = Mozilla.getInstance();
@@ -93,7 +93,7 @@
webBrowser = (nsIWebBrowser) browser.getWebBrowser();
if (webBrowser == null) {
- throw new XulRunnerException("nsIWebBrowser is not available"); // $NON-NLS-1$
+ throw new XulRunnerException("nsIWebBrowser is not available"); //$NON-NLS-1$
}
setBoolRootPref(PREFERENCE_DISABLEOPENDURINGLOAD, true);
@@ -108,7 +108,7 @@
// nsIWebProgressListener.NS_IWEBPROGRESSLISTENER_IID);
nsIServiceManager serviceManager = mozilla.getServiceManager();
nsIWebProgress webProgress = (nsIWebProgress) serviceManager
- .getServiceByContractID("@mozilla.org/docloaderservice;1", // $NON-NLS-1$
+ .getServiceByContractID("@mozilla.org/docloaderservice;1", //$NON-NLS-1$
nsIWebProgress.NS_IWEBPROGRESS_IID);
webProgress.addProgressListener(this, nsIWebProgress.NOTIFY_ALL);
@@ -119,12 +119,11 @@
public synchronized void initXulRunner() throws XulRunnerException {
String xulRunnerPath = getXulRunnerPath();
- Boolean isXulRunnerInitialized = "true".equals(System.getProperty(XULRUNNER_INITIALIZED)); // $NON-NLS-1$
- if (!isXulRunnerInitialized) {
+ if (!"true".equals(System.getProperty(XULRUNNER_INITIALIZED))) { //$NON-NLS-1$
File file = new File(xulRunnerPath);
mozilla.initialize(file);
mozilla.initEmbedding(file, file, new AppFileLocProvider(file));
- System.setProperty(XULRUNNER_INITIALIZED, "true"); // $NON-NLS-1$
+ System.setProperty(XULRUNNER_INITIALIZED, "true"); //$NON-NLS-1$
}
}
@@ -201,25 +200,26 @@
|| !xulRunnerFile.exists()) {
Bundle xulRunnerBundle = Platform.getBundle(getXulRunnerBundle());
if (xulRunnerBundle == null) {
- throw new XulRunnerException("Bundle " + getXulRunnerBundle() + " is not found.");
+ throw new XulRunnerException("Bundle " + getXulRunnerBundle() + " is not found."); //$NON-NLS-1$ //$NON-NLS-2$
}
- String xulRunnerVersion = (String) xulRunnerBundle.getHeaders().get("Bundle-Version");
+ String xulRunnerVersion = (String) xulRunnerBundle.getHeaders().get("Bundle-Version"); //$NON-NLS-1$
if (!greRanges[0].check(xulRunnerVersion)) {
- throw new XulRunnerException("the version of the bundled XULRunner must be >= 1.8.1.2 ");
+ throw new XulRunnerException("the version of the bundled XULRunner must be >= " + XulRunnerBrowser.XULRUNNER_LOWER_VERSION //$NON-NLS-1$
+ + " and <= " + XulRunnerBrowser.XULRUNNER_HIGHER_VERSION); //$NON-NLS-1$
}
URL url = xulRunnerBundle.getEntry(XULRUNNER_ENTRY);
if (url == null) {
- throw new XulRunnerException("Bundle " + getXulRunnerBundle() + " doesn't contain /xulrunner");
+ throw new XulRunnerException("Bundle " + getXulRunnerBundle() + " doesn't contain " + XULRUNNER_ENTRY); //$NON-NLS-1$ //$NON-NLS-2$
}
try {
URL url1 = FileLocator.resolve(url);
xulRunnerFile = new File(FileLocator.toFileURL(url1).getFile());
} catch (IOException ioe) {
- throw new XulRunnerException("Cannot get path to XULRunner from bundle " + getXulRunnerBundle(), ioe); // $NON-NLS-1$
+ throw new XulRunnerException("Cannot get path to XULRunner from bundle " + getXulRunnerBundle(), ioe); //$NON-NLS-1$
}
}
@@ -327,11 +327,11 @@
*/
public void destroyBrowserWindow() {
// TODO Sergey Vasilyev implement
- throw new RuntimeException("Not implemented");
+ throw new RuntimeException("Not implemented"); //$NON-NLS-1$
}
public void exitModalEventLoop(long arg0) {
- throw new RuntimeException("Not implemented");
+ throw new RuntimeException("Not implemented"); //$NON-NLS-1$
}
public long getChromeFlags() {
@@ -353,7 +353,7 @@
public void setStatus(long arg0, String arg1) {
// TODO Sergey Vasilyev implement
- throw new RuntimeException("Not implemented");
+ throw new RuntimeException("Not implemented"); //$NON-NLS-1$
}
public void setWebBrowser(nsIWebBrowser arg0) {
@@ -362,12 +362,12 @@
public void showAsModal() {
// TODO Sergey Vasilyev implement
- throw new RuntimeException("Not implemented");
+ throw new RuntimeException("Not implemented"); //$NON-NLS-1$
}
public void sizeBrowserTo(int arg0, int arg1) {
// TODO Sergey Vasilyev implement
- throw new RuntimeException("Not implemented");
+ throw new RuntimeException("Not implemented"); //$NON-NLS-1$
}
/* (non-Javadoc)
16 years, 3 months
JBoss Tools SVN: r6098 - trunk/jsf/tests/org.jboss.tools.jsf.vpe.ui.test/src/org/jboss/tools/vpe/ui/test.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2008-02-01 21:40:12 -0500 (Fri, 01 Feb 2008)
New Revision: 6098
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeTest.java
Log:
removed delay that seem to be unnecessary.
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeTest.java 2008-02-02 02:34:37 UTC (rev 6097)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeTest.java 2008-02-02 02:40:12 UTC (rev 6098)
@@ -182,7 +182,7 @@
assertNotNull(editor);
TestUtil.waitForJobs();
- TestUtil.delay(1000);
+ //TestUtil.delay(1000);
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
.closeAllEditors(true);
16 years, 3 months
JBoss Tools SVN: r6097 - trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2008-02-01 21:34:37 -0500 (Fri, 01 Feb 2008)
New Revision: 6097
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenSourceAction.java
Log:
Fix JBIDE-1722 by using JDT api to use java editor for types.
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenSourceAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenSourceAction.java 2008-02-02 02:10:15 UTC (rev 6096)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenSourceAction.java 2008-02-02 02:34:37 UTC (rev 6097)
@@ -19,6 +19,7 @@
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor;
+import org.eclipse.jdt.ui.JavaUI;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.TreePath;
import org.eclipse.jface.viewers.TreeSelection;
@@ -103,24 +104,19 @@
} else {
type = proj.findType(fullyQualifiedName);
}
- IResource resource = null;
- if (type != null) resource = type.getResource();
- IEditorPart editorPart = null;
- if (resource instanceof IFile){
- editorPart = OpenFileActionUtils.openEditor(HibernateConsolePlugin.getDefault().getActiveWorkbenchWindow().getActivePage(), (IFile) resource);
- if (editorPart instanceof JavaEditor) {
- IJavaElement jElement = null;
- if (selection instanceof Property){
- jElement = type.getField(((Property)selection).getName());
- } else {
- jElement = type;
- }
- JavaEditor jEditor = (JavaEditor) editorPart;
- selectionToEditor(jElement, jEditor);
- }
- }
-
+ IEditorPart editorPart = JavaUI.openInEditor(type);
+ if (editorPart instanceof JavaEditor) {
+ IJavaElement jElement = null;
+ if (selection instanceof Property){
+ jElement = type.getField(((Property)selection).getName());
+ } else {
+ jElement = type;
+ }
+ JavaEditor jEditor = (JavaEditor) editorPart;
+ selectionToEditor(jElement, jEditor);
+ }
+
if (editorPart == null) {
throw new FileNotFoundException("Source file for class '" + fullyQualifiedName + "' not found.");
}
16 years, 3 months
JBoss Tools SVN: r6096 - trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2008-02-01 21:10:15 -0500 (Fri, 01 Feb 2008)
New Revision: 6096
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLCompletionProcessor.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLSourceViewerConfiguration.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/LoadConsoleCFGCompletionProposal.java
Log:
Addtional fixes for JBIDE-1500.
+ show info why "Load console configuration" is relevant
+ don't just stop adding other usefull completions because configuration is not open
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLCompletionProcessor.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLCompletionProcessor.java 2008-02-02 01:30:43 UTC (rev 6095)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLCompletionProcessor.java 2008-02-02 02:10:15 UTC (rev 6096)
@@ -110,15 +110,16 @@
}
Configuration configuration = consoleConfiguration!=null?consoleConfiguration.getConfiguration():null;
- if(configuration == null && consoleConfiguration!=null) {
- errorMessage = "Configuration not opened";
- return new ICompletionProposal[]{ new LoadConsoleCFGCompletionProposal(consoleConfiguration) };
- }
IHQLCodeAssist hqlEval = new HQLCodeAssist(configuration);
EclipseHQLCompletionRequestor eclipseHQLCompletionCollector = new EclipseHQLCompletionRequestor();
hqlEval.codeComplete(doc.get(), currentOffset, eclipseHQLCompletionCollector);
proposalList.addAll(eclipseHQLCompletionCollector.getCompletionProposals());
errorMessage = eclipseHQLCompletionCollector.getLastErrorMessage();
+
+ if(configuration == null && consoleConfiguration!=null) {
+ proposalList.add(new LoadConsoleCFGCompletionProposal(consoleConfiguration));
+ }
+
//findMatchingWords( currentOffset, proposalList, startWord, HQLCodeScanner.getHQLKeywords(), "keyword" );
//findMatchingWords( currentOffset, proposalList, startWord, HQLCodeScanner.getHQLFunctionNames(), "function");
@@ -149,7 +150,7 @@
public char[] getCompletionProposalAutoActivationCharacters() { return autoActivationChars; }
- public char[] getContextInformationAutoActivationCharacters() { return new char[0]; }
+ public char[] getContextInformationAutoActivationCharacters() { return null; }
public IContextInformationValidator getContextInformationValidator() { return validator; }
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLSourceViewerConfiguration.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLSourceViewerConfiguration.java 2008-02-02 01:30:43 UTC (rev 6095)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLSourceViewerConfiguration.java 2008-02-02 02:10:15 UTC (rev 6096)
@@ -75,6 +75,8 @@
assistant.setAutoActivationDelay( 500 );
assistant.setProposalPopupOrientation( IContentAssistant.PROPOSAL_STACKED );
+ assistant.setInformationControlCreator(getInformationControlCreator(sourceViewer));
+
return assistant;
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/LoadConsoleCFGCompletionProposal.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/LoadConsoleCFGCompletionProposal.java 2008-02-02 01:30:43 UTC (rev 6095)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/LoadConsoleCFGCompletionProposal.java 2008-02-02 02:10:15 UTC (rev 6096)
@@ -15,8 +15,10 @@
import org.eclipse.jface.text.contentassist.IContextInformation;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
+import org.hibernate.HibernateException;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.ImageConstants;
+import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.utils.EclipseImages;
/**
@@ -37,7 +39,11 @@
public void apply(IDocument document) {
//load console configuration
if(consoleConfiguration.getConfiguration()==null) {
- consoleConfiguration.build();
+ try {
+ consoleConfiguration.build();
+ } catch (HibernateException he) {
+ HibernateConsolePlugin.getDefault().showError(HibernateConsolePlugin.getDefault().getShell(), "Could not load configuration " + consoleConfiguration.getName(), he);
+ }
}
}
@@ -45,7 +51,7 @@
* @see org.eclipse.jface.text.contentassist.ICompletionProposal#getAdditionalProposalInfo()
*/
public String getAdditionalProposalInfo() {
- return "Additional Info";
+ return "No open console configuration found.\nThis will attempt to open the console configuration\nto enable better code completion.";
}
/* (non-Javadoc)
16 years, 3 months
JBoss Tools SVN: r6095 - trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2008-02-01 20:30:43 -0500 (Fri, 01 Feb 2008)
New Revision: 6095
Modified:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model/JBIDE1657Test.java
Log:
Ensuring that the classpath container test actually fails if 0 elements returned.
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model/JBIDE1657Test.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model/JBIDE1657Test.java 2008-02-01 18:42:02 UTC (rev 6094)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model/JBIDE1657Test.java 2008-02-02 01:30:43 UTC (rev 6095)
@@ -80,8 +80,9 @@
}
jp.setRawClasspath(raw2, new NullProgressMonitor());
IClasspathEntry[] resolved2 = jp.getResolvedClasspath(false);
- assertTrue("New classpath container path should return the same classpath entries as the old. ",
- resolved1.length == resolved2.length);
+ assertEquals("New classpath container path should return the same classpath entries as the old. ",
+ resolved1.length , resolved2.length);
+ assertTrue("Should be more than one classpath entry", resolved1.length > 0);
} catch( CoreException ce ) {
ce.printStackTrace();
fail(ce.getMessage());
16 years, 3 months
JBoss Tools SVN: r6094 - trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2008-02-01 13:42:02 -0500 (Fri, 01 Feb 2008)
New Revision: 6094
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/RedHatJSPContentAssistProcessor.java
Log:
http://jira.jboss.org/jira/browse/JBIDE-1717 Empty CA if EL used in atributes for JSF tags.
Workaround for the issue is created
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/RedHatJSPContentAssistProcessor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/RedHatJSPContentAssistProcessor.java 2008-02-01 17:27:06 UTC (rev 6093)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/RedHatJSPContentAssistProcessor.java 2008-02-01 18:42:02 UTC (rev 6094)
@@ -23,16 +23,22 @@
import org.eclipse.jst.jsp.core.internal.contentmodel.TaglibController;
import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TLDCMDocumentManager;
import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TaglibTracker;
+import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
+import org.eclipse.jst.jsp.core.text.IJSPPartitions;
import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
import org.eclipse.jst.jsp.ui.internal.contentassist.JSPContentAssistProcessor;
import org.eclipse.jst.jsp.ui.internal.preferences.JSPUIPreferenceNames;
+import org.eclipse.jst.jsp.ui.internal.templates.TemplateContextTypeIdsJSP;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.graphics.Image;
import org.eclipse.wst.css.ui.internal.contentassist.CSSContentAssistProcessor;
+import org.eclipse.wst.html.core.text.IHTMLPartitions;
import org.eclipse.wst.javascript.ui.internal.common.contentassist.JavaScriptContentAssistProcessor;
import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
import org.eclipse.wst.sse.core.utils.StringUtils;
import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
@@ -48,6 +54,7 @@
import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
import org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest;
+import org.eclipse.wst.xml.ui.internal.contentassist.XMLContentAssistUtilities;
import org.eclipse.wst.xml.ui.internal.contentassist.XMLContentModelGenerator;
import org.eclipse.wst.xml.ui.internal.contentassist.XMLRelevanceConstants;
import org.eclipse.wst.xml.ui.internal.editor.CMImageUtil;
@@ -625,6 +632,71 @@
return (node != null && node instanceof IDOMElement && ((IDOMElement) node).isCommentTag());
}
+ protected void addAttributeNameProposals(ContentAssistRequest contentAssistRequest) {
+
+ // JBIDE-1717 Workaround:
+ // The WTP processes the Attribute Containers in a different way comparing to how it does for
+ // the simple attributes.
+ // Also the whitespace-text placed after the attribute value is the part of that attribute value.
+ // These facts both are the reason of the JBIDE-1717 issue appeared.
+ // This workaround tries to add the attribute name proposals in case of WTP itself doesn't adds them
+ // because it faced the attribute container (In other words, some JSF-variable is used as the
+ // attribute's value
+ if (fViewer != null) {
+ int documentPosition = contentAssistRequest.getReplacementBeginPosition();
+ // check the actual partition type
+ String partitionType = getPartitionType((StructuredTextViewer) fViewer, documentPosition);
+
+ IStructuredDocument structuredDocument = (IStructuredDocument) fViewer.getDocument();
+ IStructuredDocumentRegion fn = structuredDocument.getRegionAtCharacterOffset(documentPosition);
+ // check if it's in an attribute value, if so, don't add CDATA
+ // proposal
+ ITextRegion attrContainer = (fn != null) ? fn.getRegionAtCharacterOffset(documentPosition) : null;
+ boolean doPerformProposalsComputing = false;
+
+ if (attrContainer != null && attrContainer instanceof ITextRegionContainer) {
+ if (attrContainer.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
+ // test location of the cursor
+ // return null if it's in the middle of an open/close
+ // delimeter
+ Iterator attrRegions = ((ITextRegionContainer) attrContainer).getRegions().iterator();
+ ITextRegion testRegion = null;
+ while (attrRegions.hasNext()) {
+ testRegion = (ITextRegion) attrRegions.next();
+ // need to check for other valid attribute regions
+ if (XMLContentAssistUtilities.isJSPOpenDelimiter(testRegion.getType())) {
+ if (!(((ITextRegionContainer) attrContainer).getEndOffset(testRegion) <= documentPosition))
+ break;
+ }
+ else if (XMLContentAssistUtilities.isJSPCloseDelimiter(testRegion.getType())) {
+ if (!(((ITextRegionContainer) attrContainer).getStartOffset(testRegion) >= documentPosition))
+ break;
+ }
+ }
+ if (!(testRegion.getType().equals(DOMJSPRegionContexts.JSP_CONTENT)))
+ doPerformProposalsComputing = true;
+ }
+ }
+ //
+
+ if (doPerformProposalsComputing) {
+ ICompletionProposal[] embeddedResults = null;
+ IContentAssistProcessor p = (IContentAssistProcessor) fPartitionToProcessorMap.get(partitionType);
+ if (p != null) {
+ embeddedResults = p.computeCompletionProposals(fViewer, documentPosition);
+ // TODO: Probably it's needed to get bean methods, objects, and constants if there are any...
+ // as it's done in JSPContentAssistProcessor but...
+ }
+ else {
+ // the partition type is probably not mapped
+ }
+ for (int i = 0; embeddedResults != null && i < embeddedResults.length; i++)
+ contentAssistRequest.addProposal(embeddedResults[i]);
+ }
+ }
+ super.addAttributeNameProposals(contentAssistRequest);
+ }
+
protected void addAttributeValueProposals(ContentAssistRequest contentAssistRequest) {
// JBIDE-1704:
// Check the position in the value:
16 years, 3 months
JBoss Tools SVN: r6093 - trunk/hibernatetools/docs/reference/en/modules.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-02-01 12:27:06 -0500 (Fri, 01 Feb 2008)
New Revision: 6093
Modified:
trunk/hibernatetools/docs/reference/en/modules/codegen.xml
Log:
http://jira.jboss.com/jira/browse/JBDS-173 - highlighting <meta> in the beginning of the chapter
Modified: trunk/hibernatetools/docs/reference/en/modules/codegen.xml
===================================================================
--- trunk/hibernatetools/docs/reference/en/modules/codegen.xml 2008-02-01 17:25:12 UTC (rev 6092)
+++ trunk/hibernatetools/docs/reference/en/modules/codegen.xml 2008-02-01 17:27:06 UTC (rev 6093)
@@ -5,8 +5,10 @@
<para>When using <emphasis>
<property><hbm2java></property>
</emphasis> or the eclipse plugin to generate POJO java code you have the possibility to control
- certain aspects of the code generation. This is primarily done through the <meta>
- tag in the mapping files. The following section describes the possible meta tags and their use.</para>
+ certain aspects of the code generation. This is primarily done through the <emphasis>
+ <property><meta></property></emphasis>
+ tag in the mapping files. The following section describes the possible <emphasis>
+ <property><meta></property></emphasis> tags and their use.</para>
<section>
<title>The <literal><meta></literal> attribute</title>
16 years, 3 months