JBoss Tools SVN: r36671 - in trunk/openshift/plugins: org.jboss.tools.openshift.express.ui and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: xcoulon
Date: 2011-11-25 11:31:58 -0500 (Fri, 25 Nov 2011)
New Revision: 36671
Added:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/.options
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/utils/
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/utils/Logger.java
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.client/org.jboss.tools.openshift.express.client-2.3.0-SNAPSHOT.jar
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationWizardPage.java
Log:
JBIDE-10096 Application is not removed from available application list in OpenShift Tooling
https://issues.jboss.org/browse/JBIDE-10096
(adding debug support to trace model refresh in the tableviewer)
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.client/org.jboss.tools.openshift.express.client-2.3.0-SNAPSHOT.jar
===================================================================
(Binary files differ)
Added: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/.options
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/.options (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/.options 2011-11-25 16:31:58 UTC (rev 36671)
@@ -0,0 +1,2 @@
+# This file enables runtime tracing
+org.jboss.tools.openshift.express.ui/debug=true
\ No newline at end of file
Property changes on: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/.options
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationWizardPage.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationWizardPage.java 2011-11-25 16:03:47 UTC (rev 36670)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationWizardPage.java 2011-11-25 16:31:58 UTC (rev 36671)
@@ -60,6 +60,7 @@
import org.jboss.tools.openshift.express.client.NotFoundOpenShiftException;
import org.jboss.tools.openshift.express.client.OpenShiftException;
import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
+import org.jboss.tools.openshift.express.internal.utils.Logger;
/**
* @author André Dietisheim
@@ -291,7 +292,8 @@
protected IStatus run(IProgressMonitor monitor) {
try {
model.destroyCurrentApplication();
- refreshViewer();
+ final Collection<IApplication> applications = model.getApplications();
+ setViewerInput(applications);
return Status.OK_STATUS;
} catch (OpenShiftException e) {
return OpenShiftUIActivator.createErrorStatus(
@@ -317,8 +319,14 @@
Shell shell = getContainer().getShell();
NewApplicationWizard applicationDialog = new NewApplicationWizard(model.getUser());
if (WizardUtils.openWizardDialog(applicationDialog, shell) == Dialog.OK) {
- viewer.refresh();
- model.setSelectedApplication(applicationDialog.getApplication());
+ try {
+ final Collection<IApplication> applications = model.getApplications();
+ setViewerInput(applications);
+ model.setSelectedApplication(applicationDialog.getApplication());
+ } catch (OpenShiftException ex) {
+ Logger.error(NLS.bind("Could not delete application \"{0}\"",
+ model.getSelectedApplication().getName()), ex);
+ }
}
}
};
@@ -378,17 +386,8 @@
}
}
- private void refreshViewer() {
- getShell().getDisplay().syncExec(new Runnable() {
-
- @Override
- public void run() {
- viewer.refresh();
- }
- });
- }
-
private void clearViewer() {
+ Logger.debug("Clearing applications list in viewer");
setViewerInput(new ArrayList<IApplication>());
}
@@ -397,6 +396,7 @@
@Override
public void run() {
+ Logger.debug("Setting {} application(s) in the viewer", applications.size());
viewer.setInput(applications);
}
});
Added: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/utils/Logger.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/utils/Logger.java (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/utils/Logger.java 2011-11-25 16:31:58 UTC (rev 36671)
@@ -0,0 +1,151 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Xavier Coulon - Initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.openshift.express.internal.utils;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
+
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Xavier Coulon - Initial API and implementation
+ ******************************************************************************/
+
+/**
+ * A logger wrapper utility for classes in the current bundle only.
+ */
+public final class Logger {
+
+ /** The debug name, matching the .options file. */
+ private static final String DEBUG = OpenShiftUIActivator.PLUGIN_ID + "/debug";
+
+ private static final ThreadLocal<DateFormat> dateFormatter = new ThreadLocal<DateFormat>() {
+ @Override
+ protected DateFormat initialValue() {
+ return new SimpleDateFormat("HH:mm:ss.SSS");
+ }
+ };
+
+ /**
+ * The private constructor of the static class.
+ */
+ private Logger() {
+ }
+
+ /**
+ * Logs a message with an 'error' severity.
+ *
+ * @param message
+ * the message to log
+ * @param t
+ * the throwable cause
+ */
+ public static void error(final String message, final Throwable t) {
+ OpenShiftUIActivator.getDefault().getLog()
+ .log(new Status(Status.ERROR, OpenShiftUIActivator.PLUGIN_ID, message, t));
+ }
+
+ /**
+ * Logs a message with an 'error' severity.
+ *
+ * @param message
+ * the message to log
+ */
+ public static void error(final String message) {
+ OpenShiftUIActivator.getDefault().getLog()
+ .log(new Status(Status.ERROR, OpenShiftUIActivator.PLUGIN_ID, message));
+ }
+
+ /**
+ * Logs a message with an 'warning' severity.
+ *
+ * @param message
+ * the message to log
+ * @param t
+ * the throwable cause
+ */
+ public static void warn(final String message, final Throwable t) {
+ OpenShiftUIActivator.getDefault().getLog()
+ .log(new Status(Status.WARNING, OpenShiftUIActivator.PLUGIN_ID, message, t));
+ }
+
+ /**
+ * Logs a message with a 'warning' severity.
+ *
+ * @param message
+ * the message to log
+ */
+ public static void warn(final String message) {
+ OpenShiftUIActivator.getDefault().getLog()
+ .log(new Status(Status.WARNING, OpenShiftUIActivator.PLUGIN_ID, message));
+ }
+
+ /**
+ * Logs a message with an 'info' severity.
+ *
+ * @param message
+ * the message to log
+ */
+ public static void info(String message) {
+ OpenShiftUIActivator.getDefault().getLog()
+ .log(new Status(Status.INFO, OpenShiftUIActivator.PLUGIN_ID, message));
+ }
+
+ /**
+ * Outputs a debug message in the trace file (not the error view of the
+ * runtime workbench). Traces must be activated for this plugin in order to
+ * see the output messages.
+ *
+ * @param message
+ * the message to trace.
+ */
+ public static void debug(final String message) {
+ String debugOption = Platform.getDebugOption(DEBUG);
+ if (OpenShiftUIActivator.getDefault().isDebugging() && "true".equalsIgnoreCase(debugOption)) {
+ System.out.println("[" + Thread.currentThread().getName() + "] " + message);
+ }
+
+ }
+
+ /**
+ * Outputs a debug message in the trace file (not the error view of the
+ * runtime workbench). Traces must be activated for this plugin in order to
+ * see the output messages.
+ *
+ * @param message
+ * the message to trace.
+ */
+ public static void debug(final String message, Object... items) {
+ String debugOption = Platform.getDebugOption(DEBUG);
+ String valuedMessage = message;
+ if (OpenShiftUIActivator.getDefault() != null && OpenShiftUIActivator.getDefault().isDebugging()
+ && "true".equalsIgnoreCase(debugOption)) {
+ for (Object item : items) {
+ valuedMessage = valuedMessage.replaceFirst("\\{\\}", (item != null ? item.toString() : "null"));
+ }
+
+ System.out.println(dateFormatter.get().format(new Date()) + " [" + Thread.currentThread().getName() + "] "
+ + valuedMessage);
+ }
+
+ }
+}
Property changes on: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/utils/Logger.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
13 years, 1 month
JBoss Tools SVN: r36670 - in trunk: jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: vpakan(a)redhat.com
Date: 2011-11-25 11:03:47 -0500 (Fri, 25 Nov 2011)
New Revision: 36670
Added:
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/gefutils/
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/gefutils/FacesConfigGefEditorBot.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/gefutils/FacesConfigGefEditorPartMatcher.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/gefutils/FacesConfigGefEditorUtil.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/META-INF/MANIFEST.MF
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/JSFAutoTestCase.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/FacesConfigEditingTest.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/DragAndDropHelper.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
Log:
Added test of editing via GUI Editor
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/META-INF/MANIFEST.MF 2011-11-25 16:01:30 UTC (rev 36669)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/META-INF/MANIFEST.MF 2011-11-25 16:03:47 UTC (rev 36670)
@@ -8,11 +8,14 @@
org.eclipse.core.runtime,
org.eclipse.swtbot.eclipse.core;bundle-version="2.0.0",
org.eclipse.swtbot.eclipse.finder;bundle-version="2.0.0",
+ org.eclipse.swtbot.eclipse.gef.finder,
org.eclipse.swtbot.swt.finder;bundle-version="2.0.0",
org.apache.log4j;bundle-version="1.2.13",
org.junit4;bundle-version="4.5.0",
org.eclipse.swtbot.junit4_x;bundle-version="2.0.0",
- org.jboss.tools.ui.bot.ext
+ org.jboss.tools.jsf.ui;bundle-version="3.2.0",
+ org.jboss.tools.ui.bot.ext,
+ org.eclipse.gef
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Import-Package: org.jboss.tools.ui.bot.test,
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/JSFAutoTestCase.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/JSFAutoTestCase.java 2011-11-25 16:01:30 UTC (rev 36669)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/JSFAutoTestCase.java 2011-11-25 16:03:47 UTC (rev 36670)
@@ -2,6 +2,7 @@
import java.io.File;
import java.io.IOException;
+import java.util.NoSuchElementException;
import java.util.Scanner;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.Platform;
@@ -91,17 +92,23 @@
File file = new File(getPathToResources(resourceRelativePath));
StringBuilder builder = new StringBuilder(""); //$NON-NLS-1$
Scanner scanner = null;
- try {
- scanner = new Scanner(file);
- while (scanner.hasNextLine()) {
- builder.append(scanner.nextLine()+"\n"); //$NON-NLS-1$
- }
- } catch (IOException e) {
- if (scanner != null) {
- scanner.close();
- }
- }
- return builder.toString();
+ try {
+ scanner = new Scanner(file);
+ while (scanner.hasNextLine()) {
+ builder.append(scanner.nextLine() + "\n"); //$NON-NLS-1$
+ }
+ }
+ catch (IllegalStateException e) {
+ if (scanner != null) {
+ scanner.close();
+ }
+ }
+ catch (NoSuchElementException e) {
+ if (scanner != null) {
+ scanner.close();
+ }
+ }
+ return builder.toString();
}
/**
* Returns CSS Editor text striped from spaces, tabs CR and EOL
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/FacesConfigEditingTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/FacesConfigEditingTest.java 2011-11-25 16:01:30 UTC (rev 36669)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/FacesConfigEditingTest.java 2011-11-25 16:03:47 UTC (rev 36670)
@@ -10,16 +10,25 @@
******************************************************************************/
package org.jboss.tools.jsf.ui.bot.test.smoke;
+import org.eclipse.draw2d.FigureCanvas;
+import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
+import org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefEditPart;
+import org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefViewer;
import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
import org.jboss.tools.jsf.ui.bot.test.JSFAutoTestCase;
+import org.jboss.tools.jsf.ui.bot.test.smoke.gefutils.FacesConfigGefEditorBot;
+import org.jboss.tools.jsf.ui.bot.test.smoke.gefutils.FacesConfigGefEditorPartMatcher;
+import org.jboss.tools.jsf.ui.bot.test.smoke.gefutils.FacesConfigGefEditorUtil;
import org.jboss.tools.ui.bot.ext.Assertions;
import org.jboss.tools.ui.bot.ext.SWTBotExt;
-import org.jboss.tools.ui.bot.ext.SWTUtilExt;
+import org.jboss.tools.ui.bot.ext.SWTEclipseExt;
import org.jboss.tools.ui.bot.ext.Timing;
+import org.jboss.tools.ui.bot.ext.gen.ActionItem;
+import org.jboss.tools.ui.bot.ext.helper.DragAndDropHelper;
import org.jboss.tools.ui.bot.ext.parts.SWTBotEditorExt;
import org.jboss.tools.ui.bot.ext.types.IDELabel;
import org.jboss.tools.ui.bot.ext.view.ProblemsView;
@@ -35,7 +44,10 @@
private String originalContent;
private SWTBotEditorExt facesConfigEditorExt;
private SWTBotExt botExt;
-
+ private SWTBotGefEditPart gefObjectAddedViaViewTool = null;
+ private SWTBotGefEditPart gefObjectAddedViaDnDTool = null;
+ private SWTBotGefViewer gefViewer = null;
+
@Override
public void setUp() throws Exception {
super.setUp();
@@ -50,9 +62,26 @@
@Override
public void tearDown() throws Exception {
+ if (gefViewer != null){
+ if (gefObjectAddedViaViewTool != null){
+ gefObjectAddedViaViewTool.click();
+ bot.sleep(Timing.time1S());
+ gefViewer.clickContextMenu(IDELabel.Menu.DELETE);
+ confirmViewDelete();
+ bot.sleep(Timing.time1S());
+ }
+ if (gefObjectAddedViaDnDTool != null){
+ gefObjectAddedViaDnDTool.click();
+ bot.sleep(Timing.time1S());
+ gefViewer.clickContextMenu(IDELabel.Menu.DELETE);
+ confirmViewDelete();
+ bot.sleep(Timing.time1S());
+ }
+ }
if (facesConfigEditor != null) {
facesConfigEditor.toTextEditor().setText(originalContent);
facesConfigEditor.saveAndClose();
+ bot.sleep(Timing.time1S());
}
super.tearDown();
}
@@ -63,7 +92,6 @@
facesConfigEditorExt.selectPage(IDELabel.FacesConfigEditor.TREE_TAB_LABEL);
SWTBot editorBot = facesConfigEditorExt.bot();
SWTBotTree tree = editorBot.tree();
- SWTUtilExt.displayAllBotWidgets(facesConfigEditor.bot());
final String managedBeanName = "TestBean";
final String managedBeanClass = "TestBeanClass";
SWTBotTreeItem tiFacesConfigXml = tree.expandNode(FacesConfigEditingTest.FACES_CONFIG_FILE_NAME);
@@ -87,13 +115,11 @@
selectedNode.equals(managedBeanName));
Assertions.assertFileExistsInWorkspace(managedBeanClass + ".java",
JBT_TEST_PROJECT_NAME,"JavaSource");
- Assertions.assertSourceEditorContains(facesConfigEditorExt.getText(),
- "<managed-bean-name>" + managedBeanName + "</managed-bean-name>",
+ Assertions.assertSourceEditorContains(stripXMLSourceText(facesConfigEditorExt.getText()),
+ "<managed-bean><managed-bean-name>" + managedBeanName + "</managed-bean-name>" +
+ "<managed-bean-class>" + managedBeanClass + "</managed-bean-class>" +
+ "<managed-bean-scope>request</managed-bean-scope></managed-bean>",
FacesConfigEditingTest.FACES_CONFIG_FILE_NAME);
- Assertions.assertSourceEditorContains(facesConfigEditorExt.getText(),
- "<managed-bean-class>" + managedBeanClass + "</managed-bean-class>",
- FacesConfigEditingTest.FACES_CONFIG_FILE_NAME);
- SWTUtilExt.displayAllBotWidgets(facesConfigEditor.bot());
// Modify Managed Bean
editorBot.textWithLabel(IDELabel.FacesConfigEditor.MANAGED_BEAN_CLASS_LABEL)
.setText(managedBeanClass + "xxqq");
@@ -131,6 +157,81 @@
FacesConfigEditingTest.FACES_CONFIG_FILE_NAME);
}
/**
+ * Tests Component editing
+ */
+ public void testComponent (){
+ checkFacesConfigNodeEditing(IDELabel.FacesConfigEditor.COMPONENTS_NODE,
+ IDELabel.Shell.ADD_COMPONENT,
+ IDELabel.FacesConfigEditor.NEW_COMPONENT_TYPE_LABEL,
+ "TestComponentType",
+ IDELabel.FacesConfigEditor.NEW_COMPONENT_CLASS_LABEL,
+ "TestComponentClass",
+ "component",
+ "component-type",
+ "component-class",
+ true);
+ }
+ /**
+ * Tests Converter editing
+ */
+ public void testConverter (){
+ checkFacesConfigNodeEditing(IDELabel.FacesConfigEditor.CONVERTERS_NODE,
+ IDELabel.Shell.ADD_CONVERTER,
+ IDELabel.FacesConfigEditor.NEW_CONVERTER_ID_LABEL,
+ "TestConverterID",
+ IDELabel.FacesConfigEditor.NEW_CONVERTER_CLASS_LABEL,
+ "TestConverterClass",
+ "converter",
+ "converter-id",
+ "converter-class",
+ true);
+ }
+ /**
+ * Tests Referenced Bean editing
+ */
+ public void testReferencedBean (){
+ checkFacesConfigNodeEditing(IDELabel.FacesConfigEditor.REFERENCED_BEAN_NODE,
+ IDELabel.Shell.ADD_REFERENCED_BEAN,
+ IDELabel.FacesConfigEditor.NEW_REFERENCED_BEAN_NAME_LABEL,
+ "TestReferencedBeanName",
+ IDELabel.FacesConfigEditor.NEW_REFERENCED_BEAN_CLASS_LABEL,
+ "TestReferencedBeanClass",
+ "referenced-bean",
+ "referenced-bean-name",
+ "referenced-bean-class",
+ true);
+ }
+ /**
+ * Tests Render Kit editing
+ */
+ public void testRenderKit (){
+ checkFacesConfigNodeEditing(IDELabel.FacesConfigEditor.RENDER_KITS_NODE,
+ IDELabel.Shell.ADD_RENDER_KIT,
+ IDELabel.FacesConfigEditor.NEW_RENDER_KIT_ID_LABEL,
+ "TestRenderKitID",
+ IDELabel.FacesConfigEditor.NEW_RENDER_KIT_CLASS_LABEL,
+ "TestRenderKitClass",
+ "render-kit",
+ "render-kit-id",
+ "render-kit-class",
+ false);
+ }
+ /**
+ * Tests Validator editing
+ */
+ public void testValidator (){
+ checkFacesConfigNodeEditing(IDELabel.FacesConfigEditor.VALIDATOR_NODE,
+ IDELabel.Shell.ADD_VALIDATOR,
+ IDELabel.FacesConfigEditor.NEW_VALIDATOR_ID_LABEL,
+ "TestValidatorID",
+ IDELabel.FacesConfigEditor.NEW_VALIDATOR_CLASS_LABEL,
+ "TestValidatorClass",
+ "validator",
+ "validator-id",
+ "validator-class",
+ false);
+ }
+ /**
* Asserts if faces-config.xml has no errors
* @param botExt
*/
@@ -153,10 +254,174 @@
assertTrue("There are missing errors in Problems view for " + FacesConfigEditingTest.FACES_CONFIG_FILE_NAME + " file.",
areThereErrors);
}
- // adding Component
- // adding Custom Converter
- // adding Render Kit
- // adding Referenced Bean
- // adding Validator
-
-}
\ No newline at end of file
+ /**
+ * Check editing of particular tree node within Face Config Editor Tree
+ * @param treeNodeLabel
+ * @param addWizardTitle
+ * @param nameTextLabel
+ * @param typeTextValue
+ * @param classTextLabel
+ * @param classTextValue
+ * @param xmlNodeName
+ * @param nameXmlNodeName
+ * @param classXmlNodeName
+ * @param checkForValdiationErrors
+ */
+ private void checkFacesConfigNodeEditing(String treeNodeLabel,
+ String addWizardTitle,
+ String nameTextLabel,
+ String typeTextValue,
+ String classTextLabel,
+ String classTextValue,
+ String xmlNodeName,
+ String nameXmlNodeName,
+ String classXmlNodeName,
+ boolean checkForValdiationErrors){
+
+ facesConfigEditorExt.selectPage(IDELabel.FacesConfigEditor.TREE_TAB_LABEL);
+ SWTBot editorBot = facesConfigEditorExt.bot();
+ SWTBotTree tree = editorBot.tree();
+ SWTBotTreeItem tiFacesConfigXml = tree.expandNode(FacesConfigEditingTest.FACES_CONFIG_FILE_NAME);
+ SWTBotTreeItem tiNodeToCheck = tiFacesConfigXml.getNode(treeNodeLabel);
+ tiNodeToCheck.select();
+ bot.sleep(Timing.time1S());
+ // Add Node
+ editorBot.button(IDELabel.Button.ADD).click();
+ bot.shell(addWizardTitle).activate();
+ bot.textWithLabel(nameTextLabel).setText(typeTextValue);
+ bot.textWithLabel(classTextLabel).setText(classTextValue);
+ bot.button(IDELabel.Button.FINISH).click();
+ facesConfigEditorExt.save();
+ bot.sleep(Timing.time1S());
+ if (checkForValdiationErrors){
+ assertFacesConfigXmlHasErrors(botExt);
+ }
+ final String selectedNode = tree.selection().get(0,0);
+ assertTrue ("Selected node has to have label '" + typeTextValue +"'\n" +
+ "but has '" + selectedNode + "'.",
+ selectedNode.equals(typeTextValue));
+ Assertions.assertSourceEditorContains(stripXMLSourceText(facesConfigEditorExt.getText()),
+ "<" + xmlNodeName + ">" +
+ "<" + nameXmlNodeName + ">" + typeTextValue + "</" + nameXmlNodeName +">" +
+ "<" + classXmlNodeName + ">" + classTextValue + "</" + classXmlNodeName +">" +
+ "</" + xmlNodeName + ">",
+ FacesConfigEditingTest.FACES_CONFIG_FILE_NAME);
+ // Delete Node
+ tiNodeToCheck.select();
+ editorBot.table().select(typeTextValue);
+ editorBot.button(IDELabel.Button.REMOVE_WITH_DOTS).click();
+ bot.shell(IDELabel.Shell.CONFIRMATION).activate();
+ bot.button(IDELabel.Button.OK).click();
+ boolean nodeWasDeleted = false;
+ try{
+ editorBot.table().select(typeTextValue);
+ } catch (WidgetNotFoundException wnfe){
+ nodeWasDeleted = true;
+ } catch (IllegalArgumentException iae){
+ nodeWasDeleted = true;
+ }
+ assertTrue(typeTextValue + " was not deleted properly.",
+ nodeWasDeleted);
+ Assertions.assertSourceEditorNotContain(facesConfigEditorExt.getText(),
+ "<" + nameXmlNodeName + ">" + typeTextValue + "</" + nameXmlNodeName +">",
+ FacesConfigEditingTest.FACES_CONFIG_FILE_NAME);
+ Assertions.assertSourceEditorNotContain(facesConfigEditorExt.getText(),
+ "<" + classXmlNodeName + ">" + classTextValue + "</" + classXmlNodeName +">",
+ FacesConfigEditingTest.FACES_CONFIG_FILE_NAME);
+ }
+ /**
+ * Test editing via Diagram tab
+ */
+ public void testDiagramEditing(){
+ final int verticalSpacing = 100;
+ facesConfigEditorExt.selectPage(IDELabel.FacesConfigEditor.DIAGRAM_TAB_LABEL);
+ final FacesConfigGefEditorBot gefEditorBot = new FacesConfigGefEditorBot(facesConfigEditorExt.getReference());
+ gefViewer = gefEditorBot.getViewer();
+ SWTBotGefEditPart mainPart = gefViewer.mainEditPart();
+ // add View to diagram via pallete tool
+ gefViewer.activateTool(IDELabel.FacesConfigEditor.GEF_VIEW_TEMPLATE_TOOL);
+ SWTBotGefEditPart gefObjectPart = mainPart.descendants(new FacesConfigGefEditorPartMatcher("/pages/inputUserName.jsp")).get(0);
+ gefViewer.click(FacesConfigGefEditorUtil.getGefPartPosition(gefObjectPart).x,
+ FacesConfigGefEditorUtil.getGefPartPosition(gefObjectPart).y + verticalSpacing);
+ final String viewAddedViaToolName = "addedViaTool";
+ handleNewViewWizard(viewAddedViaToolName + ".jsp");
+ bot.sleep(Timing.time3S());
+ facesConfigEditor.save();
+ bot.sleep(Timing.time3S());
+ assertFacesConfigXmlHasNoErrors(botExt);
+ Assertions.assertFileExistsInWorkspace(viewAddedViaToolName + ".jsp",
+ JBT_TEST_PROJECT_NAME,"WebContent");
+ gefViewer.activateTool(IDELabel.FacesConfigEditor.GEF_CREATE_NEW_CONNECTION_TOOL);
+ gefObjectPart.click();
+ bot.sleep(Timing.time1S());
+ gefObjectAddedViaViewTool = mainPart.descendants(new FacesConfigGefEditorPartMatcher("/" + viewAddedViaToolName + ".jsp")).get(0);
+ gefObjectAddedViaViewTool.click();
+ bot.sleep(Timing.time1S());
+ facesConfigEditor.save();
+ bot.sleep(Timing.time3S());
+ Assertions.assertSourceEditorContains(FacesConfigEditingTest.stripXMLSourceText(facesConfigEditorExt.getText()),
+ "<navigation-case><from-outcome>" + viewAddedViaToolName +
+ "</from-outcome><to-view-id>/" + viewAddedViaToolName + ".jsp</to-view-id></navigation-case>",
+ FacesConfigEditingTest.FACES_CONFIG_FILE_NAME);
+ // add View to Diagram via D'n'D
+ final String dndPageName = "testDnDPage";
+ createJspPage(dndPageName + ".jsp");
+ facesConfigEditor.show();
+ facesConfigEditor.setFocus();
+ SWTBotTreeItem tiPage = SWTEclipseExt.selectTreeLocation(open.viewOpen(ActionItem.View.JBossToolsWebWebProjects.LABEL).bot(),
+ VPEAutoTestCase.JBT_TEST_PROJECT_NAME,"WebContent","pages",dndPageName + ".jsp");
+ DragAndDropHelper.dnd((TreeItem)tiPage.widget, (FigureCanvas) gefEditorBot.getControl());
+ facesConfigEditor.save();
+ bot.sleep(Timing.time3S());
+ assertFacesConfigXmlHasNoErrors(botExt);
+ gefViewer.activateTool(IDELabel.FacesConfigEditor.GEF_CREATE_NEW_CONNECTION_TOOL);
+ gefObjectPart.click();
+ bot.sleep(Timing.time1S());
+ gefObjectAddedViaDnDTool = mainPart.descendants(new FacesConfigGefEditorPartMatcher("/pages/" + dndPageName + ".jsp")).get(0);
+ gefObjectAddedViaDnDTool.click();
+ bot.sleep(Timing.time1S());
+ gefViewer.click(FacesConfigGefEditorUtil.getGefPartPosition(gefObjectAddedViaDnDTool).x,
+ FacesConfigGefEditorUtil.getGefPartPosition(gefObjectAddedViaDnDTool).y + verticalSpacing);
+ gefViewer.clickContextMenu(IDELabel.Menu.AUTO_LAYOUT);
+ bot.shell(IDELabel.Shell.AUTO_LAYOUT).activate();
+ bot.button(IDELabel.Button.OK).click();
+ facesConfigEditor.save();
+ bot.sleep(Timing.time3S());
+ Assertions.assertSourceEditorContains(FacesConfigEditingTest.stripXMLSourceText(facesConfigEditorExt.getText()),
+ "<navigation-case><from-outcome>" + dndPageName +
+ "</from-outcome><to-view-id>/pages/" + dndPageName + ".jsp</to-view-id></navigation-case>",
+ FacesConfigEditingTest.FACES_CONFIG_FILE_NAME);
+ }
+ /**
+ * Handle adding new View
+ * @param fromViewID
+ */
+ private void handleNewViewWizard(String fromViewID){
+ SWTBot dialogBot = bot.shell(IDELabel.Shell.NEW_VIEW).activate().bot();
+ dialogBot.textWithLabel(IDELabel.NewViewDialog.FROM_VIEW_ID_TEXT_LABEL)
+ .setText(fromViewID);
+ dialogBot.checkBox(IDELabel.NewViewDialog.CREATE_FILE_ON_DISK_CHECKBOX_LABEL)
+ .select();
+ dialogBot.button(IDELabel.Button.FINISH).click();
+
+ }
+ /**
+ * Returns XNL Source striped from spaces, tabs and EOL
+ *
+ * @return String
+ */
+ protected static String stripXMLSourceText(String editorText) {
+ return editorText.replaceAll("\n", "").replaceAll("\t", "")
+ .replaceAll("\b", "").replaceAll(" ", "").replaceAll("\r", "")
+ .replaceAll("\f", "");
+ }
+ /**
+ * Confirm deletion of View from Diagram Editor
+ */
+ private void confirmViewDelete(){
+ bot.shell(IDELabel.Shell.CONFIRMATION).activate();
+ bot.checkBox(IDELabel.FacesConfigEditor.DELETE_FILE_FROM_DISK_CHECK_BOX).select();
+ bot.button(IDELabel.Button.OK).click();
+ }
+}
+
Added: trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/gefutils/FacesConfigGefEditorBot.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/gefutils/FacesConfigGefEditorBot.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/gefutils/FacesConfigGefEditorBot.java 2011-11-25 16:03:47 UTC (rev 36670)
@@ -0,0 +1,98 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.ui.bot.test.smoke.gefutils;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.eclipse.gef.GraphicalViewer;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
+import org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefViewer;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
+import org.eclipse.swtbot.swt.finder.results.Result;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IEditorReference;
+import org.eclipse.ui.part.EditorPart;
+
+/**
+ * modified copy of SWTBotGefEditor class to get it working with Faces Config GEF editor
+ *
+ * @author Vlado Pakan
+ */
+public class FacesConfigGefEditorBot extends SWTBotEditor {
+
+ private final FacesConfigGefEditorViewer viewer;
+ private static final Logger log = Logger.getLogger(FacesConfigGefEditorBot.class.getName());
+
+ public FacesConfigGefEditorBot(final IEditorReference editorReference)
+ throws WidgetNotFoundException {
+ super(editorReference, new SWTWorkbenchBot());
+ GraphicalViewer graphicalViewer = UIThreadRunnable.syncExec(new Result<GraphicalViewer>() {
+ public GraphicalViewer run() {
+ final IEditorPart editor = partReference.getEditor(true);
+ EditorPart ep = null;
+ try {
+ Field f = editor.getClass().getDeclaredField("editor");
+ f.setAccessible(true);
+ Object/*StrutsConfigEditor*/ o = f.get(editor);
+ f.setAccessible(false);
+ f = o.getClass().getDeclaredField("guiEditor");
+ f.setAccessible(true);
+ Object o2 = f.get(o);
+ f.setAccessible(false);
+ Method m = o2.getClass().getMethod("getGUI");
+ ep = (EditorPart) m.invoke(o2);
+ } catch (SecurityException e) {
+ log.log(Level.WARNING, e.getMessage(), e);
+ } catch (NoSuchFieldException e) {
+ log.log(Level.WARNING, e.getMessage(), e);
+ } catch (IllegalArgumentException e) {
+ log.log(Level.WARNING, e.getMessage(), e);
+ } catch (IllegalAccessException e) {
+ log.log(Level.WARNING, e.getMessage(), e);
+ } catch (NoSuchMethodException e) {
+ log.log(Level.WARNING, e.getMessage(), e);
+ } catch (InvocationTargetException e) {
+ log.log(Level.WARNING, e.getMessage(), e);
+ }
+ return (GraphicalViewer) ep.getAdapter(GraphicalViewer.class);
+ }
+ });
+ viewer = new FacesConfigGefEditorViewer(graphicalViewer);
+ }
+
+ public SWTBotGefViewer getViewer(){
+ return viewer;
+ }
+
+ public Control getControl(){
+ return viewer.getControl();
+ }
+
+ private static class FacesConfigGefEditorViewer extends SWTBotGefViewer {
+
+ public FacesConfigGefEditorViewer(GraphicalViewer graphicalViewer)
+ throws WidgetNotFoundException {
+ super(graphicalViewer);
+ }
+
+ public Control getControl() {
+ return super.getControl();
+ }
+
+ }
+}
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/gefutils/FacesConfigGefEditorBot.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/gefutils/FacesConfigGefEditorPartMatcher.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/gefutils/FacesConfigGefEditorPartMatcher.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/gefutils/FacesConfigGefEditorPartMatcher.java 2011-11-25 16:03:47 UTC (rev 36670)
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.ui.bot.test.smoke.gefutils;
+
+import org.eclipse.gef.EditPart;
+import org.eclipse.swtbot.swt.finder.matchers.AbstractMatcher;
+import org.hamcrest.Description;
+import org.jboss.tools.jsf.ui.editor.model.IGroup;
+/**
+ * Matcher for Editor Part within Face Config Diagram Editor
+ * @author Vlado Pakan
+ *
+ */
+public class FacesConfigGefEditorPartMatcher extends AbstractMatcher<EditPart> {
+
+ private final String path;
+
+ public FacesConfigGefEditorPartMatcher(String path) {
+ assert path != null;
+ assert path.trim().length() > 0;
+ this.path = path;
+ }
+
+ @Override
+ protected boolean doMatch(Object item) {
+ EditPart ep = (EditPart) item;
+ IGroup iGroup = (IGroup) ep.getModel();
+ return path.equals(iGroup.getPath());
+ }
+
+ public void describeTo(Description d) {
+ d.appendText("Edit Part with path: " + path);
+ }
+}
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/gefutils/FacesConfigGefEditorPartMatcher.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/gefutils/FacesConfigGefEditorUtil.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/gefutils/FacesConfigGefEditorUtil.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/gefutils/FacesConfigGefEditorUtil.java 2011-11-25 16:03:47 UTC (rev 36670)
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.ui.bot.test.smoke.gefutils;
+
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefEditPart;
+import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
+import org.eclipse.swtbot.swt.finder.results.Result;
+import org.jboss.tools.jsf.ui.editor.model.IGroup;
+/**
+ * Utils for Faces Config GEF Editor
+ * @author Vlado Pakan
+ *
+ */
+public class FacesConfigGefEditorUtil {
+ /**
+ * Returns position of gefPart
+ * @param gefPart
+ * @return
+ */
+ public static Point getGefPartPosition (SWTBotGefEditPart gefPart) {
+ return ((IGroup)gefPart.part().getModel()).getPosition();
+ }
+ /**
+ * Returns gefPart bounds
+ * @param gefPart
+ * @return
+ */
+ public static Rectangle getGefPartBounds(SWTBotGefEditPart gefPart) {
+ return ((IGroup)gefPart.part().getModel()).getImage().getBounds();
+ }
+
+ public static Rectangle getEditorControlBounds(final FacesConfigGefEditorBot facesConfigGefEditorBot){
+ return UIThreadRunnable.syncExec(new Result<Rectangle>() {
+ public Rectangle run() {
+ return facesConfigGefEditorBot.getControl().getBounds();
+ }
+ });
+
+ }
+}
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/gefutils/FacesConfigGefEditorUtil.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/DragAndDropHelper.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/DragAndDropHelper.java 2011-11-25 16:01:30 UTC (rev 36669)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/DragAndDropHelper.java 2011-11-25 16:03:47 UTC (rev 36670)
@@ -15,8 +15,11 @@
import java.awt.AWTException;
import java.awt.Robot;
import java.awt.event.InputEvent;
+import java.text.MessageFormat;
import org.apache.log4j.Logger;
+import org.eclipse.draw2d.FigureCanvas;
+import org.eclipse.jface.util.Geometry;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
@@ -24,15 +27,17 @@
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.swt.widgets.Widget;
+import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
import org.eclipse.swtbot.swt.finder.results.Result;
import org.eclipse.swtbot.swt.finder.results.VoidResult;
/**
* Adds DnD Bot functionality
- * @author Vladimir Pakan
+ * @author jlukas, Vladimir Pakan
*
*/
public class DragAndDropHelper {
private static final Logger log = Logger.getLogger(DragAndDropHelper.class);
+ private static final int robotDelay = Integer.getInteger("org.jboss.tools.ui.bot.ext.dndDelay", 150);
private static Robot robot = null;
/**
* Drag&Drop sourceWidget on to targetWidget
@@ -136,4 +141,125 @@
}
});
}
+
+ public static void dnd(final TreeItem ti, final TreeItem ti2) {
+ Rectangle r1 = UIThreadRunnable.syncExec(new Result<Rectangle>() {
+
+ public Rectangle run() {
+ return ti.getDisplay().map(ti.getParent(), null, ti.getBounds());
+ }
+ });
+ final Point slightOffset = Geometry.add(Geometry.getLocation(r1),
+ new Point(10, 10));
+
+ Rectangle r2 = UIThreadRunnable.syncExec(new Result<Rectangle>() {
+
+ public Rectangle run() {
+ return ti2.getDisplay().map(ti2.getParent(), null, ti2.getBounds());
+ }
+ });
+
+ doDragAndDrop(Geometry.min(Geometry.centerPoint(r1), slightOffset),
+ Geometry.centerPoint(r2));
+ }
+
+ public static void dnd(final TreeItem ti, final FigureCanvas fc) {
+ Rectangle r1 = UIThreadRunnable.syncExec(new Result<Rectangle>() {
+
+ public Rectangle run() {
+ return ti.getDisplay().map(ti.getParent(), null, ti.getBounds());
+ }
+ });
+ final Point slightOffset = Geometry.add(Geometry.getLocation(r1),
+ new Point(10, 10));
+
+ Rectangle r2 = UIThreadRunnable.syncExec(new Result<Rectangle>() {
+
+ public Rectangle run() {
+ return fc.getDisplay().map(fc.getParent(), null, fc.getBounds());
+ }
+ });
+
+ doDragAndDrop(Geometry.min(Geometry.centerPoint(r1), slightOffset),
+ Geometry.centerPoint(r2));
+ }
+
+ public static void dnd(final TreeItem ti, final Control fc, final int x,
+ final int y) {
+ Rectangle r1 = UIThreadRunnable.syncExec(new Result<Rectangle>() {
+
+ public Rectangle run() {
+ return ti.getDisplay().map(ti.getParent(), null, ti.getBounds());
+ }
+ });
+ final Point slightOffset = Geometry.add(Geometry.getLocation(r1),
+ new Point(10, 10));
+
+ Point r2 = UIThreadRunnable.syncExec(new Result<Point>() {
+
+ public Point run() {
+ log.info("xxx: " + fc.getLocation().x + ":" + fc.getLocation().y);
+ return fc.getDisplay().map(fc, null, x, y);
+ }
+ });
+
+ doDragAndDrop(Geometry.min(Geometry.centerPoint(r1), slightOffset), r2);
+ }
+
+ /**
+ *
+ */
+ private static void doDragAndDrop(final Point source, final Point dest) {
+ log.info(MessageFormat.format(
+ "Drag-and-dropping from ({0},{1}) to ({2},{3})", source.x, source.y,
+ dest.x, dest.y));
+ try {
+ final Robot awtRobot = new Robot();
+ awtRobot.setAutoDelay(robotDelay);
+ // the x+10 motion is needed to let native functions register a drag
+ // detect. It did not work under Windows
+ // otherwise and has been reported to be required for linux, too.
+ // But I could not test that.
+ UIThreadRunnable.syncExec(new VoidResult() {
+
+ public void run() {
+ awtRobot.mouseMove(source.x, source.y);
+ awtRobot.mousePress(InputEvent.BUTTON1_MASK);
+ awtRobot.mouseMove((source.x + 10), source.y);
+ }
+ });
+
+ // now pause the test until all runnables on the Display thread have
+ // run this is necessary for the pick up
+ // to register on linux
+ waitForIdle(awtRobot);
+
+ UIThreadRunnable.syncExec(new VoidResult() {
+
+ public void run() {
+ awtRobot.mouseMove((dest.x + 10), dest.y);
+ awtRobot.mouseMove(dest.x, dest.y);
+ }
+ });
+
+ waitForIdle(awtRobot);
+
+ UIThreadRunnable.syncExec(new VoidResult() {
+
+ public void run() {
+ awtRobot.mouseRelease(InputEvent.BUTTON1_MASK);
+ }
+ });
+ waitForIdle(awtRobot);
+ } catch (final AWTException e) {
+ log.info(e.getMessage(), e);
+ throw new RuntimeException(e);
+ }
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ // ignore
+ }
+ }
+
}
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2011-11-25 16:01:30 UTC (rev 36669)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2011-11-25 16:03:47 UTC (rev 36670)
@@ -84,6 +84,7 @@
public static final String UNDO = "Undo";
public static final String CLOSE_ALL = "Close All";
public static final String SAVE_AS_TEMPLATE = "Save As Template...";
+ public static final String AUTO_LAYOUT = "Auto Layout";
}
public class Button {
@@ -168,6 +169,13 @@
public static final String SECURE_STORAGE = "Secure Storage";
public static final String ADD_JSF_PROJECT_TEMPLATE = "Add JSF Project Template";
public static final String NEW_MANAGED_BEAN = "New Managed Bean";
+ public static final String ADD_COMPONENT = "Add Component";
+ public static final String ADD_CONVERTER = "Add Converter";
+ public static final String ADD_REFERENCED_BEAN = "Add Referenced Bean";
+ public static final String ADD_RENDER_KIT = "Add Render Kit";
+ public static final String ADD_VALIDATOR = "Add Validator";
+ public static final String NEW_VIEW = "New View";
+ public static final String AUTO_LAYOUT = "Auto Layout";
}
public class EntityGroup {
@@ -691,11 +699,28 @@
public static final String TREE_TAB_LABEL = "Tree";
public static final String DIAGRAM_TAB_LABEL = "Diagram";
public static final String MANAGED_BEANS_NODE = "Managed Beans";
+ public static final String COMPONENTS_NODE = "Components";
+ public static final String CONVERTERS_NODE = "Converters";
+ public static final String RENDER_KITS_NODE = "Render Kits";
+ public static final String VALIDATOR_NODE = "Validators";
+ public static final String REFERENCED_BEAN_NODE = "Referenced Beans";
public static final String NEW_MANAGED_BEAN_CLASS_LABEL = "Class:*";
public static final String MANAGED_BEAN_CLASS_LABEL = "Managed Bean Class:";
public static final String NEW_MANAGED_BEAN_NAME_LABEL = "Name:*";
public static final String DELETE_JAVA_SOURCE_CHECK_BOX = "Delete Java Source";
-
+ public static final String NEW_COMPONENT_TYPE_LABEL = "Component Type:*";
+ public static final String NEW_COMPONENT_CLASS_LABEL = "Component Class:*";
+ public static final String NEW_CONVERTER_ID_LABEL = "Converter ID:*";
+ public static final String NEW_CONVERTER_CLASS_LABEL = "Converter Class:*";
+ public static final String NEW_REFERENCED_BEAN_NAME_LABEL = "Referenced Bean Name:*";
+ public static final String NEW_REFERENCED_BEAN_CLASS_LABEL = "Referenced Bean Class:*";
+ public static final String NEW_RENDER_KIT_ID_LABEL = "Render Kit ID:";
+ public static final String NEW_RENDER_KIT_CLASS_LABEL = "Render Kit Class:";
+ public static final String NEW_VALIDATOR_ID_LABEL = "Validator ID:*";
+ public static final String NEW_VALIDATOR_CLASS_LABEL = "Validator Class:*";
+ public static final String GEF_VIEW_TEMPLATE_TOOL = "View Template";
+ public static final String GEF_CREATE_NEW_CONNECTION_TOOL = "Create New Connection";
+ public static final String DELETE_FILE_FROM_DISK_CHECK_BOX = "Delete file from disk";
}
public static class NewJsfProjectDialog{
@@ -738,4 +763,10 @@
public static final String NAME_TEXT_LABEL = "Name:*";
public static final String IMPLEMENTATION_COMBO_LABEL = "Implementation:*";
}
+
+ public static class NewViewDialog{
+ public static final String FROM_VIEW_ID_TEXT_LABEL = "From View ID:";
+ public static final String TEMPLATE_TEXT_LABEL = "Template:*";
+ public static final String CREATE_FILE_ON_DISK_CHECKBOX_LABEL = "Create File on Disk";
+ }
}
13 years, 1 month
JBoss Tools SVN: r36669 - in trunk/as/plugins: org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/internal/management/as7 and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-11-25 11:01:30 -0500 (Fri, 25 Nov 2011)
New Revision: 36669
Removed:
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/internal/management/as7/AS7ManagementActivator.java
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/AS71ManagementActivator.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/META-INF/MANIFEST.MF
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/META-INF/jboss-management-service.xml
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/internal/management/as7/DeploymentOperationResult.java
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/META-INF/MANIFEST.MF
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/META-INF/jboss-management-service.xml
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/DeploymentOperationResult.java
Log:
[JBIDE-10224] removed bundle activators, removed "lazy bundle activation", replaced bundle dependency by package dependency, commented hack
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/META-INF/MANIFEST.MF 2011-11-25 15:31:43 UTC (rev 36668)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/META-INF/MANIFEST.MF 2011-11-25 16:01:30 UTC (rev 36669)
@@ -3,11 +3,8 @@
Bundle-Name: JBoss AS7 management API
Bundle-SymbolicName: org.jboss.ide.eclipse.as.management.as7
Bundle-Version: 2.3.0.qualifier
-Bundle-Activator: org.jboss.ide.eclipse.as.internal.management.as7.AS7ManagementActivator
-Require-Bundle: org.jboss.ide.eclipse.as.core;bundle-version="2.3.0",
- org.eclipse.core.runtime;bundle-version="[3.7.0,4.0.0)",
+Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.7.0,4.0.0)",
org.eclipse.wst.server.core;bundle-version="1.1.302"
-Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ClassPath: .,
jboss-as-controller-client-7.0.0.Final.jar,
@@ -23,3 +20,4 @@
Service-Component: META-INF/jboss-management-service.xml
Export-Package: org.jboss.ide.eclipse.as.internal.management.as7;x-friends:="org.jboss.ide.eclipse.as.management.as7.tests"
Bundle-Vendor: JBoss by Red Hat
+Import-Package: org.jboss.ide.eclipse.as.core.server.v7.management
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/META-INF/jboss-management-service.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/META-INF/jboss-management-service.xml 2011-11-25 15:31:43 UTC (rev 36668)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/META-INF/jboss-management-service.xml 2011-11-25 16:01:30 UTC (rev 36669)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.jboss.ide.eclipse.as.management.as7.service">
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" immediate="false" name="org.jboss.ide.eclipse.as.management.as7.service">
<implementation class="org.jboss.ide.eclipse.as.internal.management.as7.JBoss7ManagerService"/>
<service>
<provide interface="org.jboss.ide.eclipse.as.core.server.v7.management.IJBoss7ManagerService"/>
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/internal/management/as7/AS7ManagementActivator.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/internal/management/as7/AS7ManagementActivator.java 2011-11-25 15:31:43 UTC (rev 36668)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/internal/management/as7/AS7ManagementActivator.java 2011-11-25 16:01:30 UTC (rev 36669)
@@ -1,54 +0,0 @@
-package org.jboss.ide.eclipse.as.internal.management.as7;
-
-import org.eclipse.core.runtime.Plugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class AS7ManagementActivator extends Plugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.jboss.ide.eclipse.as.management.as7"; //$NON-NLS-1$
-
- // The shared instance
- private static AS7ManagementActivator plugin;
-
- /**
- * The constructor
- */
- public AS7ManagementActivator() {
- }
-
- public static BundleContext getContext() {
- return plugin.getBundle().getBundleContext();
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static AS7ManagementActivator getDefault() {
- return plugin;
- }
-
-}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/internal/management/as7/DeploymentOperationResult.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/internal/management/as7/DeploymentOperationResult.java 2011-11-25 15:31:43 UTC (rev 36668)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/internal/management/as7/DeploymentOperationResult.java 2011-11-25 16:01:30 UTC (rev 36669)
@@ -31,6 +31,8 @@
*/
public class DeploymentOperationResult implements IJBoss7DeploymentResult {
+ private static final String BUNDLE_ID = "org.jboss.ide.eclipse.as.management.as7";
+
private Future<ServerDeploymentPlanResult> planResult;
private DeploymentAction action;
@@ -89,7 +91,7 @@
}
private IStatus createStatus(int severity, String messagePattern, Object... messageArguments) {
- return new Status(severity, AS7ManagementActivator.getContext().getBundle().getSymbolicName(), MessageFormat.format(
+ return new Status(severity, BUNDLE_ID, MessageFormat.format(
messagePattern, messageArguments));
}
}
\ No newline at end of file
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/META-INF/MANIFEST.MF 2011-11-25 15:31:43 UTC (rev 36668)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/META-INF/MANIFEST.MF 2011-11-25 16:01:30 UTC (rev 36669)
@@ -3,11 +3,8 @@
Bundle-Name: JBoss AS7.1 management API
Bundle-SymbolicName: org.jboss.ide.eclipse.as.management.as71
Bundle-Version: 2.3.0.qualifier
-Bundle-Activator: org.jboss.ide.eclipse.as.internal.management.as71.AS71ManagementActivator
-Require-Bundle: org.jboss.ide.eclipse.as.core;bundle-version="2.3.0",
- org.eclipse.core.runtime;bundle-version="[3.7.0,4.0.0)",
+Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.7.0,4.0.0)",
org.eclipse.wst.server.core;bundle-version="1.1.302"
-Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ClassPath: .,
jboss-as-controller-client-7.1.0.CR1-SNAPSHOT.jar,
@@ -23,3 +20,4 @@
Service-Component: META-INF/jboss-management-service.xml
Export-Package: org.jboss.ide.eclipse.as.internal.management.as71;x-friends:="org.jboss.ide.eclipse.as.management.as7.tests"
Bundle-Vendor: JBoss by Red Hat
+Import-Package: org.jboss.ide.eclipse.as.core.server.v7.management
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/META-INF/jboss-management-service.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/META-INF/jboss-management-service.xml 2011-11-25 15:31:43 UTC (rev 36668)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/META-INF/jboss-management-service.xml 2011-11-25 16:01:30 UTC (rev 36669)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.jboss.ide.eclipse.as.management.as7.service">
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" immediate="false" name="org.jboss.ide.eclipse.as.management.as7.service">
<implementation class="org.jboss.ide.eclipse.as.internal.management.as71.JBoss71ManagerService"/>
<service>
<provide interface="org.jboss.ide.eclipse.as.core.server.v7.management.IJBoss7ManagerService"/>
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/AS71ManagementActivator.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/AS71ManagementActivator.java 2011-11-25 15:31:43 UTC (rev 36668)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/AS71ManagementActivator.java 2011-11-25 16:01:30 UTC (rev 36669)
@@ -1,54 +0,0 @@
-package org.jboss.ide.eclipse.as.internal.management.as71;
-
-import org.eclipse.core.runtime.Plugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class AS71ManagementActivator extends Plugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.jboss.ide.eclipse.as.management.as7"; //$NON-NLS-1$
-
- // The shared instance
- private static AS71ManagementActivator plugin;
-
- /**
- * The constructor
- */
- public AS71ManagementActivator() {
- }
-
- public static BundleContext getContext() {
- return plugin.getBundle().getBundleContext();
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static AS71ManagementActivator getDefault() {
- return plugin;
- }
-
-}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/DeploymentOperationResult.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/DeploymentOperationResult.java 2011-11-25 15:31:43 UTC (rev 36668)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/DeploymentOperationResult.java 2011-11-25 16:01:30 UTC (rev 36669)
@@ -31,6 +31,8 @@
*/
public class DeploymentOperationResult implements IJBoss7DeploymentResult {
+ public static final String BUNDLE_ID = "org.jboss.ide.eclipse.as.management.as71"; //$NON-NLS-1$
+
private Future<ServerDeploymentPlanResult> planResult;
private DeploymentAction action;
@@ -89,7 +91,7 @@
}
private IStatus createStatus(int severity, String messagePattern, Object... messageArguments) {
- return new Status(severity, AS71ManagementActivator.getContext().getBundle().getSymbolicName(), MessageFormat.format(
+ return new Status(severity, BUNDLE_ID, MessageFormat.format(
messagePattern, messageArguments));
}
}
\ No newline at end of file
13 years, 1 month
JBoss Tools SVN: r36668 - trunk/build/target-platform.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2011-11-25 10:31:43 -0500 (Fri, 25 Nov 2011)
New Revision: 36668
Modified:
trunk/build/target-platform/jbds.target
trunk/build/target-platform/jbds.target.p2mirror.xml
trunk/build/target-platform/multiple.target
trunk/build/target-platform/multiple.target.p2mirror.xml
trunk/build/target-platform/unified.target
trunk/build/target-platform/unified.target.p2mirror.xml
Log:
add org.eclipse.objectteams.otdt.core.patch.feature.group to TPs
Modified: trunk/build/target-platform/jbds.target
===================================================================
--- trunk/build/target-platform/jbds.target 2011-11-25 15:08:29 UTC (rev 36667)
+++ trunk/build/target-platform/jbds.target 2011-11-25 15:31:43 UTC (rev 36668)
@@ -83,6 +83,7 @@
<unit id="org.eclipse.platform.feature.group" version="3.7.1.r37x_v20110729-9gF7UHOxFtniV7mI3T556iZN9AU8bEZ1lHMcVK"/>
<unit id="org.eclipse.cvs.feature.group" version="1.3.100.v20110520-0800-7B78FHk8sF7BB7VAH5AYC5"/>
<unit id="org.eclipse.jdt.feature.group" version="3.7.1.r371_v20110810-0800-7z8gFcoFMLfTabvKsR5Qm9rBGEBK"/>
+ <unit id="org.eclipse.objectteams.otdt.core.patch.feature.group" version="2.0.1.201109101025"/>
<unit id="org.eclipse.equinox.executable.feature.group" version="3.5.0.v20110530-7P7NFUFFLWUl76mart"/>
<unit id="org.eclipse.equinox.p2.user.ui.feature.group" version="2.1.2.R37x_v20110815-1155-6-Bj9JXOeQxOURYC-l9BL7rDEQO7"/>
<unit id="org.eclipse.rcp.feature.group" version="3.7.1.r37x_v20110729-9DB5FmNFnFLSFCtLxnRfMqt15A4A"/>
Modified: trunk/build/target-platform/jbds.target.p2mirror.xml
===================================================================
--- trunk/build/target-platform/jbds.target.p2mirror.xml 2011-11-25 15:08:29 UTC (rev 36667)
+++ trunk/build/target-platform/jbds.target.p2mirror.xml 2011-11-25 15:31:43 UTC (rev 36668)
@@ -83,6 +83,7 @@
<iu id="org.eclipse.platform.feature.group" version=""/>
<iu id="org.eclipse.cvs.feature.group" version=""/>
<iu id="org.eclipse.jdt.feature.group" version=""/>
+<iu id="org.eclipse.objectteams.otdt.core.patch.feature.group" version=""/>
<iu id="org.eclipse.equinox.executable.feature.group" version=""/>
<iu id="org.eclipse.equinox.p2.user.ui.feature.group" version=""/>
<iu id="org.eclipse.rcp.feature.group" version=""/>
Modified: trunk/build/target-platform/multiple.target
===================================================================
--- trunk/build/target-platform/multiple.target 2011-11-25 15:08:29 UTC (rev 36667)
+++ trunk/build/target-platform/multiple.target 2011-11-25 15:31:43 UTC (rev 36668)
@@ -97,6 +97,7 @@
<unit id="org.eclipse.sdk.examples.source.feature.group" version="3.4.0.v20110121"/>
<unit id="org.eclipse.cvs.feature.group" version="1.3.100.v20110207-7B78FGB8sF7BB7I8H58WG5"/>
<unit id="org.eclipse.jdt.feature.group" version="3.7.0.v20110208-0800-7z8gFb7FMTfEULpkdZIlQtX9H155"/>
+ <unit id="org.eclipse.objectteams.otdt.core.patch.feature.group" version="2.0.1.201109101025"/>
<unit id="org.eclipse.equinox.server.core.feature.group" version="1.1.1.R37x_v20110907-7K7TFBYDzbeA3ypK_98cDL15A4A"/>
<unit id="org.eclipse.equinox.executable.feature.group" version="3.5.0.v20101220-7P7NFUFFLWUl6m499UD1941"/>
<unit id="org.eclipse.equinox.compendium.sdk.feature.group" version="3.7.1.R37x_v20110909-7X7XGA3FNKoMz-UVh-nB7ZBJ"/>
Modified: trunk/build/target-platform/multiple.target.p2mirror.xml
===================================================================
--- trunk/build/target-platform/multiple.target.p2mirror.xml 2011-11-25 15:08:29 UTC (rev 36667)
+++ trunk/build/target-platform/multiple.target.p2mirror.xml 2011-11-25 15:31:43 UTC (rev 36668)
@@ -96,6 +96,7 @@
<iu id="org.eclipse.sdk.examples.source.feature.group" version=""/>
<iu id="org.eclipse.cvs.feature.group" version=""/>
<iu id="org.eclipse.jdt.feature.group" version=""/>
+<iu id="org.eclipse.objectteams.otdt.core.patch.feature.group" version=""/>
<iu id="org.eclipse.equinox.server.core.feature.group" version=""/>
<iu id="org.eclipse.equinox.executable.feature.group" version=""/>
<iu id="org.eclipse.equinox.compendium.sdk.feature.group" version=""/>
Modified: trunk/build/target-platform/unified.target
===================================================================
--- trunk/build/target-platform/unified.target 2011-11-25 15:08:29 UTC (rev 36667)
+++ trunk/build/target-platform/unified.target 2011-11-25 15:31:43 UTC (rev 36668)
@@ -97,6 +97,7 @@
<unit id="org.eclipse.sdk.examples.source.feature.group" version="3.4.0.v20110121"/>
<unit id="org.eclipse.cvs.feature.group" version="1.3.100.v20110207-7B78FGB8sF7BB7I8H58WG5"/>
<unit id="org.eclipse.jdt.feature.group" version="3.7.0.v20110208-0800-7z8gFb7FMTfEULpkdZIlQtX9H155"/>
+ <unit id="org.eclipse.objectteams.otdt.core.patch.feature.group" version="2.0.1.201109101025"/>
<unit id="org.eclipse.equinox.server.core.feature.group" version="1.1.1.R37x_v20110907-7K7TFBYDzbeA3ypK_98cDL15A4A"/>
<unit id="org.eclipse.equinox.executable.feature.group" version="3.5.0.v20101220-7P7NFUFFLWUl6m499UD1941"/>
<unit id="org.eclipse.equinox.compendium.sdk.feature.group" version="3.7.1.R37x_v20110909-7X7XGA3FNKoMz-UVh-nB7ZBJ"/>
Modified: trunk/build/target-platform/unified.target.p2mirror.xml
===================================================================
--- trunk/build/target-platform/unified.target.p2mirror.xml 2011-11-25 15:08:29 UTC (rev 36667)
+++ trunk/build/target-platform/unified.target.p2mirror.xml 2011-11-25 15:31:43 UTC (rev 36668)
@@ -116,6 +116,7 @@
<iu id="org.eclipse.cvs.feature.group" version=""/>
<iu id="org.eclipse.help.feature.group" version=""/>
<iu id="org.eclipse.jdt.feature.group" version=""/>
+<iu id="org.eclipse.objectteams.otdt.core.patch.feature.group" version=""/>
<iu id="org.eclipse.platform.feature.group" version=""/>
<iu id="org.eclipse.platform.ide" version=""/>
<iu id="org.eclipse.equinox.executable.feature.group" version=""/>
13 years, 1 month
JBoss Tools SVN: r36667 - trunk/ws/tests/org.jboss.tools.ws.creation.core.test/META-INF.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2011-11-25 10:08:29 -0500 (Fri, 25 Nov 2011)
New Revision: 36667
Modified:
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/META-INF/MANIFEST.MF
Log:
switch to junit4 and instead of 12 of 12 skipped tests, we get 5 of 12 failed tests.
Modified: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/META-INF/MANIFEST.MF 2011-11-25 14:55:40 UTC (rev 36666)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/META-INF/MANIFEST.MF 2011-11-25 15:08:29 UTC (rev 36667)
@@ -6,7 +6,7 @@
Bundle-Activator: org.jboss.tools.ws.creation.core.test.Activator
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
- org.junit,
+ org.junit4,
org.jboss.tools.tests,
org.jboss.tools.ws.core,
org.eclipse.core.resources,
13 years, 1 month
JBoss Tools SVN: r36666 - trunk/ws/tests/org.jboss.tools.ws.ui.test/META-INF.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2011-11-25 09:55:40 -0500 (Fri, 25 Nov 2011)
New Revision: 36666
Modified:
trunk/ws/tests/org.jboss.tools.ws.ui.test/META-INF/MANIFEST.MF
Log:
use junit4 instead of junit for ws/tests/org.jboss.tools.ws.ui.test
Modified: trunk/ws/tests/org.jboss.tools.ws.ui.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.test/META-INF/MANIFEST.MF 2011-11-25 14:53:33 UTC (rev 36665)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.test/META-INF/MANIFEST.MF 2011-11-25 14:55:40 UTC (rev 36666)
@@ -6,7 +6,7 @@
Bundle-Activator: org.jboss.tools.ws.ui.test.Activator
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
- org.junit,
+ org.junit4,
org.jboss.tools.tests,
org.jboss.tools.ws.ui,
org.jboss.tools.ws.core,
13 years, 1 month
JBoss Tools SVN: r36665 - trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2011-11-25 09:53:33 -0500 (Fri, 25 Nov 2011)
New Revision: 36665
Modified:
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/SwtUtil.java
Log:
https://issues.jboss.org/browse/JBIDE-10221
- removed odd code
Modified: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/SwtUtil.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/SwtUtil.java 2011-11-25 14:51:34 UTC (rev 36664)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/SwtUtil.java 2011-11-25 14:53:33 UTC (rev 36665)
@@ -31,7 +31,6 @@
widget.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent e) {
resource.dispose();
- System.out.println("Resource Disposed: " + resource);
}
});
}
13 years, 1 month
JBoss Tools SVN: r36664 - in trunk/ws: tests/org.jboss.tools.ws.jaxrs.core.test/META-INF and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2011-11-25 09:51:34 -0500 (Fri, 25 Nov 2011)
New Revision: 36664
Modified:
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/META-INF/MANIFEST.MF
trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/META-INF/MANIFEST.MF
Log:
backlevel dependency on org.eclipse.jdt.core, org.eclipse.jface.text and org.eclipse.core.resources from 3.7.1 to 3.7.0 to try to fix build failure
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/META-INF/MANIFEST.MF 2011-11-25 14:49:34 UTC (rev 36663)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/META-INF/MANIFEST.MF 2011-11-25 14:51:34 UTC (rev 36664)
@@ -23,10 +23,10 @@
org.eclipse.wst.common.project.facet.core;bundle-version="1.4.102",
org.eclipse.jdt.ui;bundle-version="3.7.0",
org.eclipse.jdt.doc.user;bundle-version="3.7.0";resolution:=optional,
- org.eclipse.core.resources;bundle-version="3.7.100",
+ org.eclipse.core.resources;bundle-version="3.7.0",
org.eclipse.equinox.ds;bundle-version="1.3.1",
- org.eclipse.jdt.core;bundle-version="3.7.1",
- org.eclipse.jface.text;bundle-version="3.7.1",
+ org.eclipse.jdt.core;bundle-version="3.7.0",
+ org.eclipse.jface.text;bundle-version="3.7.0",
org.eclipse.ui.workbench;bundle-version="3.7.0",
org.eclipse.jdt.core.manipulation;bundle-version="1.4.0",
org.eclipse.ui.editors;bundle-version="3.7.0",
Modified: trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/META-INF/MANIFEST.MF 2011-11-25 14:49:34 UTC (rev 36663)
+++ trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/META-INF/MANIFEST.MF 2011-11-25 14:51:34 UTC (rev 36664)
@@ -19,10 +19,10 @@
ch.qos.logback.classic;bundle-version="0.9.27",
org.eclipse.jdt.ui;bundle-version="3.7.0",
org.eclipse.jdt.doc.user;bundle-version="3.7.0";resolution:=optional,
- org.eclipse.core.resources;bundle-version="3.7.100",
+ org.eclipse.core.resources;bundle-version="3.7.0",
org.eclipse.equinox.ds;bundle-version="1.3.1",
- org.eclipse.jdt.core;bundle-version="3.7.1",
- org.eclipse.jface.text;bundle-version="3.7.1",
+ org.eclipse.jdt.core;bundle-version="3.7.0",
+ org.eclipse.jface.text;bundle-version="3.7.0",
org.eclipse.ui.workbench;bundle-version="3.7.0",
org.eclipse.jdt.core.manipulation;bundle-version="1.4.0",
org.eclipse.ui.editors;bundle-version="3.7.0",
13 years, 1 month
JBoss Tools SVN: r36663 - in trunk: jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2011-11-25 09:49:34 -0500 (Fri, 25 Nov 2011)
New Revision: 36663
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JsfJSPTagNameHyperlinkDetector.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/FaceletsELCompletionProposalComputer.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/FaceletsTagCompletionProposalComputer.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/JspELCompletionProposalComputer.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/JspTagCompletionProposalComputer.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/XmlELCompletionProposalComputer.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/XmlTagCompletionProposalComputer.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/info/FaceletTagInfoHoverProcessor.java
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/CSSClassHyperlink.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/XmlContextImpl.java
Log:
JBIDE-10090 NPE in VPE
NPE is fixed, PageContextFactory is made to return non-null context for any valid document regarding on its type even IFile couldn't be obtained for the document (f. i., if the document is packed in a jar). Context Type detection is improved. Dealing with Structured model is fixed in JsfJSPTagNameHyperlinkDetector.
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JsfJSPTagNameHyperlinkDetector.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JsfJSPTagNameHyperlinkDetector.java 2011-11-25 14:45:18 UTC (rev 36662)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JsfJSPTagNameHyperlinkDetector.java 2011-11-25 14:49:34 UTC (rev 36663)
@@ -1,12 +1,12 @@
/*******************************************************************************
- * Copyright (c) 2011 Exadel, Inc. and Red Hat, Inc.
+ * Copyright (c) 2011 Red Hat, Inc.
* Distributed under license by Red Hat, Inc. All rights reserved.
* This program is made available under the terms of the
* Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ * Red Hat, Inc. - initial API and implementation
******************************************************************************/
package org.jboss.tools.jsf.text.ext.hyperlink;
@@ -24,12 +24,10 @@
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.jboss.tools.common.core.resources.XModelObjectEditorInput;
import org.jboss.tools.common.el.core.resolver.ELContext;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.text.ext.util.StructuredModelWrapper;
import org.jboss.tools.common.text.ext.util.Utils;
-import org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor;
import org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor.JSPStructuredTextViewer;
import org.jboss.tools.jst.text.ext.util.TaglibManagerWrapper;
import org.jboss.tools.jst.web.kb.IPageContext;
@@ -47,6 +45,7 @@
import org.w3c.dom.Element;
import org.w3c.dom.Node;
+@SuppressWarnings("restriction")
public class JsfJSPTagNameHyperlinkDetector extends AbstractHyperlinkDetector {
public IHyperlink[] detectHyperlinks(ITextViewer textViewer,
@@ -55,90 +54,85 @@
if(!(textViewer instanceof JSPStructuredTextViewer))
return null;
- JSPStructuredTextViewer viewer = (JSPStructuredTextViewer) textViewer;
-
- JSPTextEditor editor = viewer.getEditor();
-
- XModelObjectEditorInput xInput = (XModelObjectEditorInput) editor.getEditorInput();
-
- IFile file = xInput.getFile();
-
StructuredModelWrapper smw = new StructuredModelWrapper();
smw.init(textViewer.getDocument());
-
- Document xmlDocument = smw.getDocument();
- if (xmlDocument == null)
- return null;
-
- Node n = Utils.findNodeForOffset(xmlDocument, region.getOffset());
-
- IRegion reg = getRegion(n, region.getOffset());
-
- if(reg != null && n instanceof IDOMElement) {
- String tagName = n.getNodeName();
- int i = tagName.indexOf(":");
- KbQuery query = new KbQuery();
- query.setType(KbQuery.Type.TAG_NAME);
+ try {
+ Document xmlDocument = smw.getDocument();
+ if (xmlDocument == null)
+ return null;
- if(i > 0) query.setPrefix(tagName.substring(0, i));
- else query.setPrefix("");
+ Node n = Utils.findNodeForOffset(xmlDocument, region.getOffset());
- query.setOffset(reg.getOffset());
- query.setValue(tagName);
- query.setUri(getURI(region, textViewer.getDocument()));
- query.setMask(false);
+ IRegion reg = getRegion(n, region.getOffset());
- ELContext context = PageContextFactory.createPageContext(file);
-
- if(context instanceof IPageContext){
- IComponent[] components = PageProcessor.getInstance().getComponents(query, (IPageContext)context);
- ArrayList<IHyperlink> hyperlinks = new ArrayList<IHyperlink>();
- for(IComponent component : components){
- if(!component.isExtended() && validateComponent(component, ((IPageContext)context).getNameSpaces(reg.getOffset()), query.getPrefix())){
- TLDTagHyperlink link = new TLDTagHyperlink((AbstractComponent)component, reg);
- link.setDocument(textViewer.getDocument());
- hyperlinks.add(link);
+ if(reg != null && n instanceof IDOMElement) {
+ String tagName = n.getNodeName();
+ int i = tagName.indexOf(":");
+ KbQuery query = new KbQuery();
+ query.setType(KbQuery.Type.TAG_NAME);
+
+ if(i > 0) query.setPrefix(tagName.substring(0, i));
+ else query.setPrefix("");
+
+ query.setOffset(reg.getOffset());
+ query.setValue(tagName);
+ query.setUri(getURI(region, textViewer.getDocument()));
+ query.setMask(false);
+
+ ELContext context = PageContextFactory.createPageContext(textViewer.getDocument());
+
+ if(context instanceof IPageContext){
+ IComponent[] components = PageProcessor.getInstance().getComponents(query, (IPageContext)context);
+ ArrayList<IHyperlink> hyperlinks = new ArrayList<IHyperlink>();
+ for(IComponent component : components){
+ if(!component.isExtended() && validateComponent(component, ((IPageContext)context).getNameSpaces(reg.getOffset()), query.getPrefix())){
+ TLDTagHyperlink link = new TLDTagHyperlink((AbstractComponent)component, reg);
+ link.setDocument(textViewer.getDocument());
+ hyperlinks.add(link);
+ }
}
+ sortHyperlinks(hyperlinks);
+ if(hyperlinks.size() > 0)
+ return (IHyperlink[]) hyperlinks.toArray(new IHyperlink[hyperlinks.size()]);
}
- sortHyperlinks(hyperlinks);
- if(hyperlinks.size() > 0)
- return (IHyperlink[]) hyperlinks.toArray(new IHyperlink[hyperlinks.size()]);
- }
- } else if(reg != null && n instanceof IDOMAttr) {
- String tagName = ((IDOMAttr)n).getOwnerElement().getNodeName();
- int i = tagName.indexOf(":");
- KbQuery query = new KbQuery();
- query.setType(KbQuery.Type.ATTRIBUTE_NAME);
-
- if(i > 0) query.setPrefix(tagName.substring(0, i));
- else query.setPrefix("");
-
- query.setUri(getURI(region, textViewer.getDocument()));
- query.setParentTags(new String[]{tagName});
- query.setParent(tagName);
- query.setOffset(reg.getOffset());
- query.setValue(n.getNodeName());
- query.setMask(false);
-
- ELContext context = PageContextFactory.createPageContext(file);
-
- if(context instanceof IPageContext){
- IAttribute[] attributes = PageProcessor.getInstance().getAttributes(query, (IPageContext)context);
- ArrayList<IHyperlink> hyperlinks = new ArrayList<IHyperlink>();
- for(IAttribute attribute : attributes){
- if(!attribute.isExtended() && validateComponent(attribute.getComponent(), ((IPageContext)context).getNameSpaces(reg.getOffset()), query.getPrefix()) && attribute instanceof AbstractAttribute){
- TLDAttributeHyperlink link = new TLDAttributeHyperlink((AbstractAttribute)attribute, reg);
- link.setDocument(textViewer.getDocument());
- hyperlinks.add(link);
+ } else if(reg != null && n instanceof IDOMAttr) {
+ String tagName = ((IDOMAttr)n).getOwnerElement().getNodeName();
+ int i = tagName.indexOf(":");
+ KbQuery query = new KbQuery();
+ query.setType(KbQuery.Type.ATTRIBUTE_NAME);
+
+ if(i > 0) query.setPrefix(tagName.substring(0, i));
+ else query.setPrefix("");
+
+ query.setUri(getURI(region, textViewer.getDocument()));
+ query.setParentTags(new String[]{tagName});
+ query.setParent(tagName);
+ query.setOffset(reg.getOffset());
+ query.setValue(n.getNodeName());
+ query.setMask(false);
+
+ ELContext context = PageContextFactory.createPageContext(textViewer.getDocument());
+
+ if(context instanceof IPageContext){
+ IAttribute[] attributes = PageProcessor.getInstance().getAttributes(query, (IPageContext)context);
+ ArrayList<IHyperlink> hyperlinks = new ArrayList<IHyperlink>();
+ for(IAttribute attribute : attributes){
+ if(!attribute.isExtended() && validateComponent(attribute.getComponent(), ((IPageContext)context).getNameSpaces(reg.getOffset()), query.getPrefix()) && attribute instanceof AbstractAttribute){
+ TLDAttributeHyperlink link = new TLDAttributeHyperlink((AbstractAttribute)attribute, reg);
+ link.setDocument(textViewer.getDocument());
+ hyperlinks.add(link);
+ }
}
+ sortHyperlinks(hyperlinks);
+ if(hyperlinks.size() > 0)
+ return (IHyperlink[]) hyperlinks.toArray(new IHyperlink[hyperlinks.size()]);
}
- sortHyperlinks(hyperlinks);
- if(hyperlinks.size() > 0)
- return (IHyperlink[]) hyperlinks.toArray(new IHyperlink[hyperlinks.size()]);
}
+
+ return parse(textViewer.getDocument(), xmlDocument, region);
+ } finally {
+ smw.dispose();
}
-
- return parse(textViewer.getDocument(), xmlDocument, region);
}
private boolean validateComponent(IComponent component, Map<String, List<INameSpace>> nameSpaces, String prefix){
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/FaceletsELCompletionProposalComputer.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/FaceletsELCompletionProposalComputer.java 2011-11-25 14:45:18 UTC (rev 36662)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/FaceletsELCompletionProposalComputer.java 2011-11-25 14:49:34 UTC (rev 36663)
@@ -124,7 +124,7 @@
*/
@Override
protected ELContext createContext() {
- return PageContextFactory.createPageContext(getResource(), PageContextFactory.FACELETS_PAGE_CONTEXT_TYPE);
+ return PageContextFactory.createPageContext(getDocument(), PageContextFactory.FACELETS_PAGE_CONTEXT_TYPE);
}
/*
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/FaceletsTagCompletionProposalComputer.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/FaceletsTagCompletionProposalComputer.java 2011-11-25 14:45:18 UTC (rev 36662)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/FaceletsTagCompletionProposalComputer.java 2011-11-25 14:49:34 UTC (rev 36663)
@@ -124,7 +124,7 @@
*/
@Override
protected ELContext createContext() {
- return PageContextFactory.createPageContext(getResource(), PageContextFactory.FACELETS_PAGE_CONTEXT_TYPE);
+ return PageContextFactory.createPageContext(getDocument(), PageContextFactory.FACELETS_PAGE_CONTEXT_TYPE);
}
/*
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/JspELCompletionProposalComputer.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/JspELCompletionProposalComputer.java 2011-11-25 14:45:18 UTC (rev 36662)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/JspELCompletionProposalComputer.java 2011-11-25 14:49:34 UTC (rev 36663)
@@ -18,8 +18,6 @@
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.Region;
-import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
-import org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest;
import org.jboss.tools.common.el.core.model.ELExpression;
import org.jboss.tools.common.el.core.parser.ELParserFactory;
import org.jboss.tools.common.el.core.parser.ELParserUtil;
@@ -42,7 +40,6 @@
* @author Jeremy
*
*/
-@SuppressWarnings("restriction")
public class JspELCompletionProposalComputer extends XmlELCompletionProposalComputer {
/*
@@ -51,7 +48,7 @@
*/
@Override
protected ELContext createContext() {
- return PageContextFactory.createPageContext(getResource(), PageContextFactory.JSP_PAGE_CONTEXT_TYPE);
+ return PageContextFactory.createPageContext(getDocument(), PageContextFactory.JSP_PAGE_CONTEXT_TYPE);
}
/*
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/JspTagCompletionProposalComputer.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/JspTagCompletionProposalComputer.java 2011-11-25 14:45:18 UTC (rev 36662)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/JspTagCompletionProposalComputer.java 2011-11-25 14:49:34 UTC (rev 36663)
@@ -50,7 +50,7 @@
*/
@Override
protected ELContext createContext() {
- return PageContextFactory.createPageContext(getResource(), PageContextFactory.JSP_PAGE_CONTEXT_TYPE);
+ return PageContextFactory.createPageContext(getDocument(), PageContextFactory.JSP_PAGE_CONTEXT_TYPE);
}
/*
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/XmlELCompletionProposalComputer.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/XmlELCompletionProposalComputer.java 2011-11-25 14:45:18 UTC (rev 36662)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/XmlELCompletionProposalComputer.java 2011-11-25 14:49:34 UTC (rev 36663)
@@ -161,7 +161,6 @@
CompletionProposalInvocationContext context) {
}
- @SuppressWarnings("unused")
@Override
protected void addAttributeValueELProposals(ContentAssistRequest contentAssistRequest,
CompletionProposalInvocationContext context) {
@@ -357,10 +356,10 @@
int quoteIndex = restOfValue.indexOf('\'');
if (quoteIndex == -1 || paraIndex == -1 || (paraIndex != -1 && quoteIndex > paraIndex)) {
// Need to insert closing single-quote if there is no quote inserted
- if (!replacementString.endsWith("\'"))
+ if (!replacementString.endsWith("\'")) //$NON-NLS-1$
replacementString += '\'';
} else {
- if (quoteIndex != -1 && replacementString.endsWith("\'"))
+ if (quoteIndex != -1 && replacementString.endsWith("\'")) //$NON-NLS-1$
replacementString = replacementString.substring(0, replacementString.length() - 1);
}
if (paraIndex == -1) {
@@ -368,7 +367,7 @@
replacementString += ']';
}
} else {
- if (replacementString.endsWith("]") && restOfValue.indexOf(']') != -1) {
+ if (replacementString.endsWith("]") && restOfValue.indexOf(']') != -1) { //$NON-NLS-1$
replacementString = replacementString.substring(0, replacementString.length() -1);
}
}
@@ -440,7 +439,6 @@
*
* @param contentAssistRequest
*/
- @SuppressWarnings("unused")
protected void addELPredicateProposals(ContentAssistRequest contentAssistRequest, int baseRelevance, boolean shiftRelevanceAgainstTagNameProposals) {
if (!isELCAToBeShown())
return;
@@ -528,7 +526,7 @@
}
protected ELContext createContext() {
- return PageContextFactory.createPageContext(getResource(), PageContextFactory.XML_PAGE_CONTEXT_TYPE);
+ return PageContextFactory.createPageContext(getDocument(), PageContextFactory.XML_PAGE_CONTEXT_TYPE);
}
protected KbQuery createKbQuery(Type type, String query, String stringQuery) {
@@ -926,7 +924,7 @@
ELInstance is = ELUtil.findInstance(model, inValueOffset);// ELInstance
ELInvocationExpression ie = ELUtil.findExpression(model, inValueOffset);// ELExpression
- boolean isELStarted = (model != null && is != null && (startsWithELBeginning(model.toString()))); //$NON-NLS-1$
+ boolean isELStarted = (model != null && is != null && (startsWithELBeginning(model.toString())));
boolean isELClosed = (model != null && is != null && model.toString().endsWith("}")); //$NON-NLS-1$
// boolean insideEL = startOffset + model.toString().length()
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/XmlTagCompletionProposalComputer.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/XmlTagCompletionProposalComputer.java 2011-11-25 14:45:18 UTC (rev 36662)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/XmlTagCompletionProposalComputer.java 2011-11-25 14:49:34 UTC (rev 36663)
@@ -321,7 +321,6 @@
String mainPrefix = getTagPrefix();
String mainURI = getTagUri();
- // TODO: Insert here: processing for the tag ending start region due to
// - calculate correct replacenemt begin position
// - calculate correct replacenment length
// - calculate correct match string
@@ -331,7 +330,6 @@
/*
* Jeremy: Add attribute name proposals before empty tag close
*/
- // TODO: calculate those values hereafter
IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(getOffset());
ITextRegion completionRegion = getCompletionRegion(getOffset(),
contentAssistRequest.getNode());
@@ -443,7 +441,7 @@
}
protected ELContext createContext() {
- return PageContextFactory.createPageContext(getResource(), PageContextFactory.XML_PAGE_CONTEXT_TYPE);
+ return PageContextFactory.createPageContext(getDocument(), PageContextFactory.XML_PAGE_CONTEXT_TYPE);
}
protected KbQuery createKbQuery(Type type, String query, String stringQuery) {
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/info/FaceletTagInfoHoverProcessor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/info/FaceletTagInfoHoverProcessor.java 2011-11-25 14:45:18 UTC (rev 36662)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/info/FaceletTagInfoHoverProcessor.java 2011-11-25 14:49:34 UTC (rev 36663)
@@ -88,11 +88,7 @@
this.fDocumentPosition = documentPosition;
this.fContext = null;
- IFile file = getResource(textViewer.getDocument());
- if (file == null)
- return null;
-
- fContext = PageContextFactory.createPageContext(file);
+ fContext = PageContextFactory.createPageContext(textViewer.getDocument());
if (fContext == null)
return null;
Modified: trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/CSSClassHyperlink.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/CSSClassHyperlink.java 2011-11-25 14:45:18 UTC (rev 36662)
+++ trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/CSSClassHyperlink.java 2011-11-25 14:49:34 UTC (rev 36663)
@@ -60,7 +60,7 @@
@Override
protected void doHyperlink(IRegion region) {
ICSSContainerSupport cssContainerSupport = null;
- ELContext context = PageContextFactory.createPageContext(getFile());
+ ELContext context = PageContextFactory.createPageContext(getDocument());
if (!(context instanceof ICSSContainerSupport)) {
openFileFailed();
return;
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java 2011-11-25 14:45:18 UTC (rev 36662)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java 2011-11-25 14:49:34 UTC (rev 36663)
@@ -21,6 +21,7 @@
import java.util.Map;
import java.util.Set;
+import org.eclipse.core.filebuffers.FileBuffers;
import org.eclipse.core.internal.resources.ICoreConstants;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
@@ -28,13 +29,16 @@
import org.eclipse.core.resources.IResourceChangeEvent;
import org.eclipse.core.resources.IResourceChangeListener;
import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.resources.IStorage;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.content.IContentType;
+import org.eclipse.jdt.core.IJarEntryResource;
import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.internal.core.JarPackageFragmentRoot;
import org.eclipse.jdt.internal.ui.text.FastJavaPartitionScanner;
import org.eclipse.jdt.ui.text.IJavaPartitions;
import org.eclipse.jface.text.BadLocationException;
@@ -47,7 +51,11 @@
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.ui.IEditorInput;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.IStorageEditorInput;
import org.eclipse.ui.ide.IDE;
+import org.eclipse.ui.texteditor.ITextEditor;
import org.eclipse.wst.common.componentcore.internal.ComponentResource;
import org.eclipse.wst.common.componentcore.internal.StructureEdit;
import org.eclipse.wst.common.componentcore.internal.WorkbenchComponent;
@@ -158,6 +166,28 @@
}
/**
+ * Creates a page context for the specified context document
+ *
+ * @param file
+ * @param contentType
+ * @return
+ */
+ public static ELContext createPageContext(IDocument document) {
+ return createPageContext(document, null);
+ }
+
+ /**
+ * Creates a page context for the specified context document
+ *
+ * @param file
+ * @param contentType
+ * @return
+ */
+ public static ELContext createPageContext(IDocument document, String contextType) {
+ return createPageContext(document, null, contextType);
+ }
+
+ /**
* Creates a page context for the specified context file
*
* @param file
@@ -169,17 +199,28 @@
}
/**
- * Creates a page context for the specified context type
+ * Creates a page context for the specified context file
*
* @param file
* @param contentType
* @return
*/
public static ELContext createPageContext(IFile file, String contextType) {
- return getInstance().createPageContext(file, new ArrayList<String>(), contextType);
+ return createPageContext(null, file, null);
}
/**
+ * Creates a page context for the specified context type
+ *
+ * @param file
+ * @param contentType
+ * @return
+ */
+ public static ELContext createPageContext(IDocument document, IFile file, String contextType) {
+ return getInstance().createPageContext(document, file, new ArrayList<String>(), contextType);
+ }
+
+ /**
* Cleans up the context for the file specified
*
* @param file
@@ -323,12 +364,14 @@
* @param parents List of parent contexts
* @return
*/
- private ELContext createPageContext(IFile file, List<String> parents, String defaultContextType) {
+ private ELContext createPageContext(IDocument document, IFile file, List<String> parents, String defaultContextType) {
+ if (file == null)
+ file = getResource(document);
+
boolean isContextCachingAllowed = !EclipseUIUtil.isOpenInActiveEditor(file);
ELContext context = isContextCachingAllowed ? getSavedContext(file) : null;
- if (context == null && file != null) {
- IContentType type = IDE.getContentType(file);
- String typeId = (type == null ? null : type.getId());
+ if (context == null) {
+ String typeId = getContentTypeIdentifier(file == null ? document : file);
if(JavaCore.JAVA_SOURCE_CONTENT_TYPE.equalsIgnoreCase(typeId)) {
context = createJavaContext(file);
@@ -342,23 +385,32 @@
if(manager != null) {
IStructuredModel model = null;
try {
- model = manager.getModelForRead(file);
+ model = file != null ?
+ manager.getModelForRead(file) :
+ manager.getExistingModelForRead(document);
if (model instanceof IDOMModel) {
IDOMModel domModel = (IDOMModel) model;
context = defaultContextType == null ?
createPageContextInstance(domModel.getContentTypeIdentifier()) :
createContextInstanceOfType(defaultContextType);
if (context != null) {
- IDOMDocument document = domModel.getDocument();
+ IDOMDocument domDocument = domModel.getDocument();
context.setResource(file);
- context.setElResolvers(ELResolverFactoryManager.getInstance().getResolvers(file));
+ if (document != null && context instanceof XmlContextImpl) {
+ // Renew the document in context, since it might be cleared by context.setResource() call
+ ((XmlContextImpl)context).setDocument(document);
+ }
+
+ IProject project = file != null ? file.getProject() : getActiveProject();
+
+ context.setElResolvers(ELResolverFactoryManager.getInstance().getResolvers(project));
if (context instanceof JspContextImpl && !(context instanceof FaceletPageContextImpl)) {
// Fill JSP namespaces defined in TLDCMDocumentManager
fillJSPNameSpaces((JspContextImpl)context);
}
// The subsequently called functions may use the file and document
// already stored in context for their needs
- fillContextForChildNodes(model.getStructuredDocument(), document, context, parents);
+ fillContextForChildNodes(model.getStructuredDocument(), domDocument, context, parents);
}
}
} catch (CoreException e) {
@@ -379,9 +431,86 @@
}
return context;
}
-
+
+ private IProject getActiveProject() {
+ ITextEditor editor = EclipseUIUtil.getActiveEditor();
+ if (editor == null) return null;
+
+ IEditorInput editorInput = editor.getEditorInput();
+ if (editorInput instanceof IFileEditorInput) {
+ IFile file = ((IFileEditorInput)editorInput).getFile();
+ return file == null ? null : file.getProject();
+ } else if (editorInput instanceof IStorageEditorInput) {
+ IStorage storage;
+ try {
+ storage = ((IStorageEditorInput)editorInput).getStorage();
+ } catch (CoreException e) {
+ return null;
+ }
+ if (storage instanceof IJarEntryResource) {
+ Object parent = ((IJarEntryResource)storage).getParent();
+ while (parent instanceof IJarEntryResource && !(parent instanceof IProject)) {
+ parent = ((IJarEntryResource)parent).getParent();
+ }
+ if (parent instanceof JarPackageFragmentRoot) {
+ return ((JarPackageFragmentRoot)parent).getJavaProject().getProject();
+ }
+ return null;
+ }
+ }
+ return null;
+ }
+
+ protected String getContentTypeIdentifier(Object source) {
+ if (source instanceof IFile) {
+ IContentType type = IDE.getContentType((IFile)source);
+ if (type != null) return type.getId();
+ } else if (source instanceof IDocument) {
+ IStructuredModel sModel = StructuredModelManager.getModelManager().getExistingModelForRead((IDocument)source);
+ try {
+ if (sModel != null) return sModel.getContentTypeIdentifier();
+ } finally {
+ if (sModel != null) sModel.releaseFromRead();
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Returns IFile resource of the document
+ *
+ * @return
+ */
+ public static IFile getResource(IDocument document) {
+ if (document == null) return null;
+ IStructuredModel sModel = StructuredModelManager.getModelManager().getExistingModelForRead(document);
+ try {
+ if (sModel != null) {
+ String baseLocation = sModel.getBaseLocation();
+ IPath location = new Path(baseLocation).makeAbsolute();
+ return FileBuffers.getWorkspaceFileAtLocation(location);
+ }
+ }
+ finally {
+ if (sModel != null) {
+ sModel.releaseFromRead();
+ }
+ }
+ return null;
+ }
+
private static ELContext createPageContextInstance(String contentType) {
String contextType = IncludeContextBuilder.getContextType(contentType);
+ if (contextType == null && contentType != null) {
+ IContentType baseContentType = Platform.getContentTypeManager().getContentType(contentType);
+ baseContentType = baseContentType == null ? null : baseContentType.getBaseType();
+
+ while (contextType == null && baseContentType != null) {
+ contextType = IncludeContextBuilder.getContextType(baseContentType.getId());
+ baseContentType = baseContentType.getBaseType();
+ }
+ }
+
return createContextInstanceOfType(contextType);
}
@@ -556,7 +685,7 @@
if (fileName != null && !fileName.trim().isEmpty()) {
IFile file = getFileFromProject(fileName, context.getResource());
if (file != null && checkCycling(parents, file)) { // checkCycling is to fix for JBIDE-5083
- ELContext includedContext = createPageContext(file, newParentList, null);
+ ELContext includedContext = createPageContext(null, file, newParentList, null);
if (includedContext != null)
((IIncludedContextSupport)context).addIncludedContext(includedContext);
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/XmlContextImpl.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/XmlContextImpl.java 2011-11-25 14:45:18 UTC (rev 36662)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/XmlContextImpl.java 2011-11-25 14:49:34 UTC (rev 36663)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2010-2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.jst.web.kb.internal;
import java.util.ArrayList;
@@ -20,6 +30,11 @@
import org.jboss.tools.jst.web.kb.WebKbPlugin;
import org.jboss.tools.jst.web.kb.taglib.INameSpace;
+/**
+ *
+ * @author Victor V. Rubezhny
+ *
+ */
public class XmlContextImpl extends ELContextImpl implements IXmlContext {
protected IDocument document;
@@ -33,13 +48,16 @@
@Override
public void setResource(IFile resource) {
super.setResource(resource);
-
- FileEditorInput editorInput = null;
- try {
- editorInput = new FileEditorInput(resource);
- document = getConnectedDocument(editorInput);
- } finally {
- releaseConnectedDocument(editorInput);
+
+ document = null;
+ if (resource != null) {
+ FileEditorInput editorInput = null;
+ try {
+ editorInput = new FileEditorInput(resource);
+ document = getConnectedDocument(editorInput);
+ } finally {
+ releaseConnectedDocument(editorInput);
+ }
}
}
@@ -51,6 +69,14 @@
return document;
}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.PageContext#getDocument()
+ */
+ public void setDocument(IDocument document) {
+ this.document = document;
+ }
+
/*
* TODO: the visibility must differ between 'include'-like and 'template'-like inclusion
*
13 years, 1 month
JBoss Tools SVN: r36662 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2011-11-25 09:45:18 -0500 (Fri, 25 Nov 2011)
New Revision: 36662
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/VpeDropWindow.java
Log:
https://issues.jboss.org/browse/JBIDE-10221 /
https://issues.jboss.org/browse/JBIDE-10222 : VpeController has resource leaks
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 2011-11-25 14:42:23 UTC (rev 36661)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2011-11-25 14:45:18 UTC (rev 36662)
@@ -41,6 +41,8 @@
import org.eclipse.swt.custom.LineStyleListener;
import org.eclipse.swt.custom.StyleRange;
import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.events.MenuEvent;
import org.eclipse.swt.events.MenuListener;
import org.eclipse.swt.events.SelectionEvent;
@@ -87,6 +89,7 @@
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.common.util.SwtUtil;
import org.jboss.tools.jst.jsp.bundle.BundleMap;
import org.jboss.tools.jst.jsp.editor.IJSPTextEditor;
import org.jboss.tools.jst.jsp.editor.IVisualController;
@@ -1792,6 +1795,7 @@
tip = new Shell(parent, SWT.NO_FOCUS | SWT.ON_TOP);
Color bckgColor = new Color(tip.getDisplay(), 255, 250, 236);
+ SwtUtil.bindDisposal(bckgColor, tip);
tip.setBackground(bckgColor);
Composite composite = tip;
@@ -1828,8 +1832,9 @@
tipControlHeaderText.addLineStyleListener(new LineStyleListener() {
public void lineGetStyle(LineStyleEvent event) {
- Color color = new Color(tipControlHeaderText.getDisplay(), 201,
- 51, 40);
+ final Color color = new Color(tipControlHeaderText.getDisplay(),
+ 201, 51, 40);
+ SwtUtil.bindDisposal(color, tipControlHeaderText);
if (event.lineOffset == 0) {
StyleRange st = new StyleRange();
st.fontStyle = SWT.BOLD;
@@ -1876,6 +1881,7 @@
public void lineGetStyle(LineStyleEvent event) {
Color color = new Color(tipControlHeaderText
.getDisplay(), 42, 148, 0);
+ SwtUtil.bindDisposal(color, tipControlAttributeText);
StyleRange st = new StyleRange();
st.start = event.lineOffset;
st.length = event.lineText.length();
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 2011-11-25 14:42:23 UTC (rev 36661)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeDropWindow.java 2011-11-25 14:45:18 UTC (rev 36662)
@@ -44,12 +44,12 @@
import org.eclipse.wst.xml.ui.internal.contentoutline.JFaceNodeLabelProvider;
import org.jboss.tools.common.model.ui.dnd.ModelTransfer;
import org.jboss.tools.common.model.ui.editors.dnd.context.DropContext;
+import org.jboss.tools.common.util.SwtUtil;
import org.jboss.tools.jst.jsp.editor.IJSPTextEditor;
import org.jboss.tools.vpe.editor.dnd.context.JSPViewerDropAdapter;
import org.w3c.dom.Node;
public class VpeDropWindow extends Window {
- static final Color BACKGROUND_COLOR = new Color(null, 0xff, 0xff, 0xcd);
IJSPTextEditor editor;
boolean active = false;
TreeViewer treeViewer;
@@ -104,7 +104,10 @@
treeViewer.setLabelProvider(labelProvider);
treeViewer.setInput(rootNode);
- tree.setBackground(BACKGROUND_COLOR);
+ Color treeBackgroundColor = new Color(null, 0xff, 0xff, 0xcd);
+ tree.setBackground(treeBackgroundColor);
+ SwtUtil.bindDisposal(treeBackgroundColor, tree);
+
GridData data = new GridData(GridData.FILL_BOTH);
data.verticalIndent = 0;
data.horizontalIndent = 0;
13 years, 1 month