JBoss Tools SVN: r24417 - trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/newfile.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-08-25 08:23:17 -0400 (Wed, 25 Aug 2010)
New Revision: 24417
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/newfile/NewXHTMLWizard.java
Log:
https://jira.jboss.org/browse/JBIDE-6687
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/newfile/NewXHTMLWizard.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/newfile/NewXHTMLWizard.java 2010-08-25 12:20:09 UTC (rev 24416)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/newfile/NewXHTMLWizard.java 2010-08-25 12:23:17 UTC (rev 24417)
@@ -34,6 +34,7 @@
import org.eclipse.wst.sse.core.utils.StringUtils;
import org.jboss.tools.common.meta.action.impl.SpecialWizardSupport;
import org.jboss.tools.common.model.XModelException;
+import org.jboss.tools.common.model.files.handlers.CreateFileSupport;
import org.jboss.tools.common.model.ui.ModelUIPlugin;
import org.jboss.tools.common.model.ui.wizard.newfile.NewFileContextEx;
import org.jboss.tools.common.model.ui.wizard.newfile.NewXHTMLFileWizard;
@@ -93,6 +94,7 @@
SpecialWizardSupport support = getNewXHTMLFileWizard().getFileContext().getSupport();
NewXHTMLWizardSelectTagLibrariesPage step = new NewXHTMLWizardSelectTagLibrariesPage(support, 1);
try {
+ support.setAttributeValue(0, "template", "");
support.action(SpecialWizardSupport.NEXT);
} catch (XModelException e) {
ModelUIPlugin.getPluginLog().logError(e);
@@ -199,5 +201,4 @@
this.newXHTMLFileWizard = newXHTMLFileWizard;
}
-
}
15 years, 4 months
JBoss Tools SVN: r24416 - trunk/documentation/whatsnew/cdi/images.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2010-08-25 08:20:09 -0400 (Wed, 25 Aug 2010)
New Revision: 24416
Modified:
trunk/documentation/whatsnew/cdi/images/decorator.png
trunk/documentation/whatsnew/cdi/images/interceptor.png
trunk/documentation/whatsnew/cdi/images/interceptor2.png
Log:
https://jira.jboss.org/browse/JBIDE-6890 CDI Component N&N. Updated images.
Modified: trunk/documentation/whatsnew/cdi/images/decorator.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/whatsnew/cdi/images/interceptor.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/whatsnew/cdi/images/interceptor2.png
===================================================================
(Binary files differ)
15 years, 4 months
JBoss Tools SVN: r24415 - trunk/documentation/whatsnew/jst/images.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2010-08-25 08:10:41 -0400 (Wed, 25 Aug 2010)
New Revision: 24415
Modified:
trunk/documentation/whatsnew/jst/images/1-ContextMenu.png
trunk/documentation/whatsnew/jst/images/2-RenameResourceBundleMessage.png
trunk/documentation/whatsnew/jst/images/3-ChangesPreview.png
trunk/documentation/whatsnew/jst/images/4-RenamePropertiesFile.png
trunk/documentation/whatsnew/jst/images/5-RenameResourceDialog.png
trunk/documentation/whatsnew/jst/images/6-RenameResourceChangesPreview.png
trunk/documentation/whatsnew/jst/images/jsftemplate.png
trunk/documentation/whatsnew/jst/images/richFacesPageTemplate.png
trunk/documentation/whatsnew/jst/images/validatorpreferences.png
Log:
https://jira.jboss.org/browse/JBIDE-6896 JST/JSF Components N&N. Updated images.
Modified: trunk/documentation/whatsnew/jst/images/1-ContextMenu.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/whatsnew/jst/images/2-RenameResourceBundleMessage.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/whatsnew/jst/images/3-ChangesPreview.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/whatsnew/jst/images/4-RenamePropertiesFile.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/whatsnew/jst/images/5-RenameResourceDialog.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/whatsnew/jst/images/6-RenameResourceChangesPreview.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/whatsnew/jst/images/jsftemplate.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/whatsnew/jst/images/richFacesPageTemplate.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/whatsnew/jst/images/validatorpreferences.png
===================================================================
(Binary files differ)
15 years, 4 months
JBoss Tools SVN: r24414 - trunk/documentation/whatsnew/hibernate.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2010-08-25 07:43:36 -0400 (Wed, 25 Aug 2010)
New Revision: 24414
Modified:
trunk/documentation/whatsnew/hibernate/hibernate-news-3.4.0.M2.html
Log:
Fixed the wrong link to the JSF component.
Modified: trunk/documentation/whatsnew/hibernate/hibernate-news-3.4.0.M2.html
===================================================================
--- trunk/documentation/whatsnew/hibernate/hibernate-news-3.4.0.M2.html 2010-08-25 11:29:40 UTC (rev 24413)
+++ trunk/documentation/whatsnew/hibernate/hibernate-news-3.4.0.M2.html 2010-08-25 11:43:36 UTC (rev 24414)
@@ -12,7 +12,7 @@
<h1>Hibernate tools 3.4.0.M2 What's New</h1>
<p align="right"<a href="../index.html">< Main
- Index</a> <a href="../jst/jst-news-3.2.0.M1.html">JST Tools ></a></p>
+ Index</a> <a href="../jst/jst-news-3.2.0.M2.html">JST Tools ></a></p>
<table border="0" cellpadding="10" cellspacing="0" width="80%">
15 years, 4 months
JBoss Tools SVN: r24413 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/bundle.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2010-08-25 07:29:40 -0400 (Wed, 25 Aug 2010)
New Revision: 24413
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/bundle/BundleMap.java
Log:
https://jira.jboss.org/browse/JBIDE-6729 , file for the resource bundle will be finding by the locale.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/bundle/BundleMap.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/bundle/BundleMap.java 2010-08-25 11:05:42 UTC (rev 24412)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/bundle/BundleMap.java 2010-08-25 11:29:40 UTC (rev 24413)
@@ -223,20 +223,34 @@
return false;
}
+ /**
+ * Gets the bundle file based on the locale
+ * from the loaded resource bundle.
+ *
+ * @param uri the uri
+ * @return the bundle file
+ */
public IFile getBundleFile(String uri){
IEditorInput input = editor.getEditorInput();
IProject project = ((FileEditorInput)input).getFile().getProject();
- String name = uri.replace('.','/')+".properties"; //$NON-NLS-1$
-
- if(project == null || !project.isOpen()) return null;
+ if(project == null || !project.isOpen()) {
+ return null;
+ }
try {
- if(!project.hasNature(JavaCore.NATURE_ID)) return null;
+ if(!project.hasNature(JavaCore.NATURE_ID)) {
+ return null;
+ }
IJavaProject javaProject = JavaCore.create(project);
IClasspathEntry[] es = javaProject.getResolvedClasspath(true);
for (int i = 0; i < es.length; i++) {
- if(es[i].getEntryKind() != IClasspathEntry.CPE_SOURCE) continue;
- IFile file = (IFile)project.getWorkspace().getRoot().getFolder(es[i].getPath()).findMember("/"+name); //$NON-NLS-1$
- if(file != null && file.exists()) return file;
+ if(es[i].getEntryKind() != IClasspathEntry.CPE_SOURCE) {
+ continue;
+ }
+ IFile file = (IFile) project.getWorkspace().getRoot()
+ .getFolder(es[i].getPath()).findMember("/" + getBundleFileName(uri)); //$NON-NLS-1$
+ if(file != null && file.exists()) {
+ return file;
+ }
}
} catch (CoreException e) {
VpePlugin.getPluginLog().logError(e);
@@ -245,6 +259,24 @@
return null;
}
+ /**
+ * Gets the bundle file name.
+ * <a href="https://jira.jboss.org/browse/JBIDE-6729">
+ * Related Jira</a>
+ *
+ * @param uri the uri
+ * @return the bundle file name
+ */
+ private String getBundleFileName(String uri) {
+ String resultUri = uri.replace('.','/');
+ ResourceBundle bundle = getBundleByUrl(uri, locale);
+ String localeString = bundle.getLocale().toString();
+ if ((null != localeString) && (localeString.length() > 0)){
+ resultUri += "_" + localeString; //$NON-NLS-1$
+ }
+ resultUri += ".properties"; //$NON-NLS-1$
+ return resultUri;
+ }
private ResourceBundle getBundleByUrl(String uri, Locale locale) {
try {
@@ -260,10 +292,9 @@
return null;
}
}
-
+
ClassLoader classLoader = new URLClassLoader(urls, ClassLoader.getSystemClassLoader());
ResourceBundle bundle = ResourceBundle.getBundle(uri, locale, classLoader);
-
return bundle;
}
} catch (MissingResourceException ex) {
15 years, 4 months
JBoss Tools SVN: r24412 - in trunk: jsf/plugins/org.jboss.tools.jsf/META-INF and 9 other directories.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2010-08-25 07:05:42 -0400 (Wed, 25 Aug 2010)
New Revision: 24412
Added:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2ComponentsValidator/WebContent/resources/
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2ComponentsValidator/WebContent/resources/demo/
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2ComponentsValidator/WebContent/resources/demo/input.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2ComponentsValidator/WebContent/resources/new/
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2ComponentsValidator/WebContent/resources/new/tmp.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/refactoring/JSF2RefactoringTest.java
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/META-INF/MANIFEST.MF
trunk/jsf/plugins/org.jboss.tools.jsf/plugin.xml
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/JSF2RenameParticipant.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/JSf2MoveParticipant.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/RefactoringChangesFactory.java
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2ComponentsValidator/WebContent/pages/inputname.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JsfAllTests.java
trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests/AbstractRefactorTest.java
Log:
https://jira.jboss.org/browse/JBIDE-6732
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/META-INF/MANIFEST.MF
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/META-INF/MANIFEST.MF 2010-08-25 10:52:41 UTC (rev 24411)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/META-INF/MANIFEST.MF 2010-08-25 11:05:42 UTC (rev 24412)
@@ -9,6 +9,7 @@
org.jboss.tools.jsf.el.refactoring,
org.jboss.tools.jsf.facelet.model,
org.jboss.tools.jsf.jsf2.model,
+ org.jboss.tools.jsf.jsf2.refactoring,
org.jboss.tools.jsf.messages,
org.jboss.tools.jsf.model,
org.jboss.tools.jsf.model.handlers,
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/plugin.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/plugin.xml 2010-08-25 10:52:41 UTC (rev 24411)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/plugin.xml 2010-08-25 11:05:42 UTC (rev 24412)
@@ -618,9 +618,10 @@
</with>
<with
variable="element">
- <instanceof
- value="org.eclipse.core.resources.IFile">
- </instanceof>
+ <or>
+ <instanceof value="org.eclipse.core.resources.IFile" />
+ <instanceof value="org.eclipse.core.resources.IFolder" />
+ </or>
</with>
</enablement>
</renameParticipant>
@@ -643,9 +644,10 @@
</with>
<with
variable="element">
- <instanceof
- value="org.eclipse.core.resources.IFolder">
- </instanceof>
+ <or>
+ <instanceof value="org.eclipse.core.resources.IFile" />
+ <instanceof value="org.eclipse.core.resources.IFolder" />
+ </or>
</with>
</enablement>
</moveParticipant>
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/JSF2RenameParticipant.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/JSF2RenameParticipant.java 2010-08-25 10:52:41 UTC (rev 24411)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/JSF2RenameParticipant.java 2010-08-25 11:05:42 UTC (rev 24412)
@@ -11,7 +11,10 @@
package org.jboss.tools.jsf.jsf2.refactoring;
+import java.util.Map;
+
import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
@@ -38,6 +41,9 @@
private IProject project;
private String URI;
private String oldFileName;
+ private Object element;
+
+ private Map<String, String> urisMap;
@Override
public RefactoringStatus checkConditions(IProgressMonitor pm,
@@ -49,6 +55,15 @@
public Change createChange(IProgressMonitor pm) throws CoreException,
OperationCanceledException {
String newFileName = getArguments().getNewName();
+ if(element instanceof IFolder){
+ IFolder folder = (IFolder)element;
+ IPath newPath = folder.getFullPath().removeLastSegments(1).append(newFileName);
+ if (JSf2MoveParticipant.checkDistFolderPath(newPath)) {
+ urisMap = JSf2MoveParticipant.invokePossibleURIs(folder, newPath, false);
+ return RefactoringChangesFactory.createRenameURIChanges(project, urisMap);
+ }
+ return null;
+ }
if (project == null || newFileName == null || oldFileName == null) {
return null;
}
@@ -70,6 +85,7 @@
@Override
protected boolean initialize(Object element) {
+ this.element = element;
if (element instanceof IFile) {
IFile file = (IFile) element;
URI = calcURIFromPath(file.getFullPath());
@@ -78,6 +94,14 @@
oldFileName = file.getName();
return true;
}
+ }else if(element instanceof IFolder){
+ IFolder folder = (IFolder) element;
+ if (JSf2MoveParticipant.checkResourceFolderPath(folder.getFullPath())) {
+ project = folder.getProject();
+ oldFileName = folder.getName();
+ return true;
+ }
+
}
return false;
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/JSf2MoveParticipant.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/JSf2MoveParticipant.java 2010-08-25 10:52:41 UTC (rev 24411)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/JSf2MoveParticipant.java 2010-08-25 11:05:42 UTC (rev 24412)
@@ -15,6 +15,8 @@
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
+
+import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
@@ -40,6 +42,7 @@
private IProject project;
private Map<String, String> urisMap;
+ private static boolean isMoveFolder = true;
@Override
public RefactoringStatus checkConditions(IProgressMonitor pm,
@@ -63,26 +66,35 @@
@Override
protected boolean initialize(Object element) {
- if (element instanceof IFolder) {
- IFolder folder = (IFolder) element;
- if (checkResourceFolderPath(folder.getFullPath())) {
- Object object = getArguments().getDestination();
- if (object instanceof IFolder) {
- if (folder.getProject() != ((IFolder) object).getProject()) {
- return false;
- }
- if (checkDistFolderPath(((IFolder) object).getFullPath())) {
- project = folder.getProject();
- invokePossibleURIs(folder, (IFolder) object);
- return true;
- }
+ if(!(element instanceof IFolder) && !(element instanceof IFile))
+ return false;
+
+ IFolder folder = null;
+ isMoveFolder = true;
+ if(element instanceof IFile){
+ IFile file = (IFile)element;
+
+ folder = (IFolder)file.getParent();
+ isMoveFolder = false;
+ }else
+ folder = (IFolder) element;
+ if (checkResourceFolderPath(folder.getFullPath())) {
+ Object object = getArguments().getDestination();
+ if (object instanceof IFolder) {
+ if (folder.getProject() != ((IFolder) object).getProject()) {
+ return false;
}
+ if (checkDistFolderPath(((IFolder) object).getFullPath())) {
+ project = folder.getProject();
+ urisMap = invokePossibleURIs(folder, (IFolder) object);
+ return true;
+ }
}
}
return false;
}
- private boolean checkDistFolderPath(IPath fullPath) {
+ public static boolean checkDistFolderPath(IPath fullPath) {
String[] segments = fullPath.segments();
if (segments.length > 2) {
if (segments[2].equals("resources")) { //$NON-NLS-1$
@@ -91,11 +103,17 @@
}
return false;
}
+
+ public static Map<String, String> invokePossibleURIs(IFolder srcFolder, IFolder distFolder){
+ return invokePossibleURIs(srcFolder, distFolder.getFullPath(), isMoveFolder);
+ }
- private void invokePossibleURIs(IFolder srcFolder, IFolder distFolder) {
- String newFirstURIPart = createJSF2URIFromPath(distFolder.getFullPath());
+ public static Map<String, String> invokePossibleURIs(IFolder srcFolder, IPath distPath, boolean isMoveFolder) {
+ Map<String, String> urisMap;
+ String newFirstURIPart = createJSF2URIFromPath(distPath);
String oldFirstURIPart = createJSF2URIFromPath(srcFolder.getFullPath());
- oldFirstURIPart = oldFirstURIPart.substring(0, oldFirstURIPart
+ if(isMoveFolder)
+ oldFirstURIPart = oldFirstURIPart.substring(0, oldFirstURIPart
.lastIndexOf('/'));
Set<String> oldURIs = new HashSet<String>();
invokeOldPossibleURIs(srcFolder, oldURIs);
@@ -104,9 +122,10 @@
urisMap.put(oldURI, newFirstURIPart
+ oldURI.replaceFirst(oldFirstURIPart, "")); //$NON-NLS-1$
}
+ return urisMap;
}
-
- private void invokeOldPossibleURIs(IFolder srcFolder, Set<String> uris) {
+
+ private static void invokeOldPossibleURIs(IFolder srcFolder, Set<String> uris) {
uris.add(createJSF2URIFromPath(srcFolder.getFullPath()));
try {
IResource[] children = srcFolder.members();
@@ -122,7 +141,7 @@
}
}
- private boolean checkResourceFolderPath(IPath path) {
+ public static boolean checkResourceFolderPath(IPath path) {
String[] segments = path.segments();
if (segments.length > 3) {
if (segments[2].equals("resources")) { //$NON-NLS-1$
@@ -132,7 +151,7 @@
return false;
}
- private String createJSF2URIFromPath(IPath path) {
+ private static String createJSF2URIFromPath(IPath path) {
StringBuilder uri = new StringBuilder(""); //$NON-NLS-1$
String[] segments = path.segments();
if (segments.length > 3) {
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/RefactoringChangesFactory.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/RefactoringChangesFactory.java 2010-08-25 10:52:41 UTC (rev 24411)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/RefactoringChangesFactory.java 2010-08-25 11:05:42 UTC (rev 24412)
@@ -214,6 +214,13 @@
if (file == null) {
return false;
}
+ if(!file.isSynchronized(IResource.DEPTH_ZERO)){
+ return false;
+ }else if(file.isPhantom()){
+ return false;
+ }else if(file.isReadOnly()){
+ return false;
+ }
if (!"xhtml".equals(file.getFileExtension()) && !"jsp".equals(file.getFileExtension())) { //$NON-NLS-1$ //$NON-NLS-2$
IContentType contentType = IDE.getContentType(file);
if (contentType == null) {
Modified: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2ComponentsValidator/WebContent/pages/inputname.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2ComponentsValidator/WebContent/pages/inputname.xhtml 2010-08-25 10:52:41 UTC (rev 24411)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2ComponentsValidator/WebContent/pages/inputname.xhtml 2010-08-25 11:05:42 UTC (rev 24412)
@@ -3,7 +3,8 @@
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
- xmlns:c="http://java.sun.com/jstl/core">
+ xmlns:c="http://java.sun.com/jstl/core"
+ xmlns:ez="http://java.sun.com/jsf/composite/demo">
<f:loadBundle basename="resources" var="msg" />
@@ -16,7 +17,7 @@
<ui:define name="pageHeader">Facelets Hello Application</ui:define>
<ui:define name="body">
-
+ <ez:input id="inputname" label="${msgs.prompt}" value="#{user.name}" action="#{user.sayHello}" submitlabel="Say Hello"/>
<form>
<jar:echo1 echo="Hello" />
<jar:echo echo="Hello" />
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2ComponentsValidator/WebContent/resources/demo/input.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2ComponentsValidator/WebContent/resources/demo/input.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2ComponentsValidator/WebContent/resources/demo/input.xhtml 2010-08-25 11:05:42 UTC (rev 24412)
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:composite="http://java.sun.com/jsf/composite">
+
+ <composite:interface>
+ <composite:attribute name="label"/>
+ <composite:attribute name="value" required="true"/>
+ <composite:attribute name="action" required="true" method-signature="java.lang.String f()"/>
+ <composite:attribute name="submitlabel"/>
+ </composite:interface>
+
+ <composite:implementation>
+ <h:form>
+ <h:outputText value="#{cc.attrs.label}" />
+ <h:inputText value="#{cc.attrs.value}" />
+ <h:commandButton action="#{cc.attrs.action}" value="#{cc.attrs.submitlabel}" />
+ </h:form>
+ </composite:implementation>
+</html>
\ No newline at end of file
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2ComponentsValidator/WebContent/resources/demo/input.xhtml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2ComponentsValidator/WebContent/resources/new/tmp.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2ComponentsValidator/WebContent/resources/new/tmp.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2ComponentsValidator/WebContent/resources/new/tmp.xhtml 2010-08-25 11:05:42 UTC (rev 24412)
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:composite="http://java.sun.com/jsf/composite">
+
+</html>
\ No newline at end of file
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2ComponentsValidator/WebContent/resources/new/tmp.xhtml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JsfAllTests.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JsfAllTests.java 2010-08-25 10:52:41 UTC (rev 24411)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JsfAllTests.java 2010-08-25 11:05:42 UTC (rev 24412)
@@ -19,6 +19,7 @@
import org.jboss.tools.jsf.kb.test.FaceletsKbModelTest;
import org.jboss.tools.jsf.model.pv.test.JSFPromptingProviderTest;
import org.jboss.tools.jsf.test.refactoring.ELVariableRefactoringTest;
+import org.jboss.tools.jsf.test.refactoring.JSF2RefactoringTest;
import org.jboss.tools.jsf.test.refactoring.MessagePropertyRefactoringTest;
import org.jboss.tools.jsf.test.validation.JSF2ComponentsValidatorTest;
import org.jboss.tools.test.util.ProjectImportTestSetup;
@@ -57,6 +58,11 @@
JSF2ComponentsValidatorTest.class), "org.jboss.tools.jsf.test", //$NON-NLS-1$
new String[] { "projects/JSF2ComponentsValidator" }, //$NON-NLS-1$
new String[] { "JSF2ComponentsValidator" })); //$NON-NLS-1$
+ suite.addTest(new ProjectImportTestSetup(new TestSuite(
+ JSF2RefactoringTest.class), "org.jboss.tools.jsf.test", //$NON-NLS-1$
+ new String[] { "projects/JSF2ComponentsValidator" }, //$NON-NLS-1$
+ new String[] { "JSF2ComponentsValidator" })); //$NON-NLS-1$
+
return new DisableJavaIndexingSetup(suite);
}
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/refactoring/JSF2RefactoringTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/refactoring/JSF2RefactoringTest.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/refactoring/JSF2RefactoringTest.java 2010-08-25 11:05:42 UTC (rev 24412)
@@ -0,0 +1,102 @@
+package org.jboss.tools.jsf.test.refactoring;
+
+import java.util.ArrayList;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.ltk.internal.core.refactoring.resource.MoveResourcesProcessor;
+import org.eclipse.ltk.internal.core.refactoring.resource.RenameResourceProcessor;
+import org.jboss.tools.jsf.jsf2.refactoring.JSF2RenameParticipant;
+import org.jboss.tools.jsf.jsf2.refactoring.JSf2MoveParticipant;
+import org.jboss.tools.test.util.ProjectImportTestSetup;
+import org.jboss.tools.tests.AbstractRefactorTest;
+
+public class JSF2RefactoringTest extends AbstractRefactorTest {
+ static String projectName = "JSF2ComponentsValidator";
+ static IProject project;
+
+ public JSF2RefactoringTest(){
+ super("Refactor JSF2 Composite Components Test");
+ }
+
+ protected void setUp() throws Exception {
+ project = ProjectImportTestSetup.loadProject(projectName);
+ project.build(IncrementalProjectBuilder.FULL_BUILD, new NullProgressMonitor());
+ }
+
+ public void testRenameCompositeComponentFile() throws CoreException {
+ ArrayList<TestChangeStructure> list = new ArrayList<TestChangeStructure>();
+
+ TestChangeStructure structure = new TestChangeStructure(project.getProject(), "/WebContent/pages/inputname.xhtml");
+ TestTextChange change = new TestTextChange(776, 6, "input2");
+ structure.addTextChange(change);
+ list.add(structure);
+
+ IFile sourceFile = project.getProject().getFile("/WebContent/resources/demo/input.xhtml");
+
+ RenameResourceProcessor processor = new RenameResourceProcessor(sourceFile);
+
+ JSF2RenameParticipant participant = new JSF2RenameParticipant();
+
+ checkRename(processor, sourceFile, "input2.xhtml", participant, list);
+ }
+
+ public void testRenameCompositeComponentFolder() throws CoreException {
+ ArrayList<TestChangeStructure> list = new ArrayList<TestChangeStructure>();
+
+ TestChangeStructure structure = new TestChangeStructure(project.getProject(), "/WebContent/pages/inputname.xhtml");
+ TestTextChange change = new TestTextChange(382, 5, "demo2");
+ structure.addTextChange(change);
+ list.add(structure);
+
+ IFolder sourceFolder = project.getProject().getFolder("/WebContent/resources/demo");
+
+ RenameResourceProcessor processor = new RenameResourceProcessor(sourceFolder);
+
+ JSF2RenameParticipant participant = new JSF2RenameParticipant();
+
+ checkRename(processor, sourceFolder, "demo2", participant, list);
+ }
+
+ public void testMoveCompositeComponentFile() throws CoreException {
+ ArrayList<TestChangeStructure> list = new ArrayList<TestChangeStructure>();
+
+ TestChangeStructure structure = new TestChangeStructure(project.getProject(), "/WebContent/pages/inputname.xhtml");
+ TestTextChange change = new TestTextChange(776, 6, "input2");
+ structure.addTextChange(change);
+ list.add(structure);
+
+ IFile sourceFile = project.getProject().getFile("/WebContent/resources/demo/input.xhtml");
+ IFolder destinationFolder = project.getProject().getFolder("/WebContent/resources/new");
+
+ MoveResourcesProcessor processor = new MoveResourcesProcessor(new IResource[]{sourceFile});
+
+ JSf2MoveParticipant participant = new JSf2MoveParticipant();
+
+ checkMove(processor, sourceFile, destinationFolder, participant, list);
+ }
+
+ public void testMoveCompositeComponentFolder() throws CoreException {
+ ArrayList<TestChangeStructure> list = new ArrayList<TestChangeStructure>();
+
+ TestChangeStructure structure = new TestChangeStructure(project.getProject(), "/WebContent/pages/inputname.xhtml");
+ TestTextChange change = new TestTextChange(776, 6, "input2");
+ structure.addTextChange(change);
+ list.add(structure);
+
+ IFolder sourceFolder = project.getProject().getFolder("/WebContent/resources/demo");
+ IFolder destinationFolder = project.getProject().getFolder("/WebContent/resources/new");
+
+ MoveResourcesProcessor processor = new MoveResourcesProcessor(new IResource[]{sourceFolder});
+
+ JSf2MoveParticipant participant = new JSf2MoveParticipant();
+
+ checkMove(processor, sourceFolder, destinationFolder, participant, list);
+ }
+
+}
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/refactoring/JSF2RefactoringTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests/AbstractRefactorTest.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests/AbstractRefactorTest.java 2010-08-25 10:52:41 UTC (rev 24411)
+++ trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests/AbstractRefactorTest.java 2010-08-25 11:05:42 UTC (rev 24412)
@@ -9,10 +9,16 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.ltk.core.refactoring.CompositeChange;
import org.eclipse.ltk.core.refactoring.TextFileChange;
+import org.eclipse.ltk.core.refactoring.participants.MoveArguments;
+import org.eclipse.ltk.core.refactoring.participants.MoveParticipant;
+import org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor;
+import org.eclipse.ltk.core.refactoring.participants.RenameArguments;
+import org.eclipse.ltk.core.refactoring.participants.RenameParticipant;
import org.eclipse.ltk.core.refactoring.participants.RenameProcessor;
import org.eclipse.text.edits.MultiTextEdit;
import org.jboss.tools.test.util.JobUtils;
@@ -27,6 +33,49 @@
JobUtils.waitForIdle(2000);
// Test before renaming
+ checkBeforeRefactoring(changeList);
+
+ // Rename
+ processor.checkInitialConditions(new NullProgressMonitor());
+ processor.checkFinalConditions(new NullProgressMonitor(), null);
+ CompositeChange rootChange = (CompositeChange)processor.createChange(new NullProgressMonitor());
+
+ checkChanges(rootChange, changeList);
+ }
+
+ protected void checkMove(RefactoringProcessor processor, IResource oldObject, IResource destinationObject, MoveParticipant participant, List<TestChangeStructure> changeList) throws CoreException {
+ JobUtils.waitForIdle(2000);
+
+ // Test before moving
+ checkBeforeRefactoring(changeList);
+
+ // Move
+ MoveArguments arguments = new MoveArguments(destinationObject, true);
+ participant.initialize(processor, oldObject, arguments);
+ participant.checkConditions(new NullProgressMonitor(), null);
+
+ CompositeChange rootChange = (CompositeChange)participant.createChange(new NullProgressMonitor());
+
+ checkChanges(rootChange, changeList);
+ }
+
+ protected void checkRename(RefactoringProcessor processor, IResource oldObject, String newName, RenameParticipant participant, List<TestChangeStructure> changeList) throws CoreException {
+ JobUtils.waitForIdle(2000);
+
+ // Test before renaming
+ checkBeforeRefactoring(changeList);
+
+ // Rename
+ RenameArguments arguments = new RenameArguments(newName, true);
+ participant.initialize(processor, oldObject, arguments);
+ participant.checkConditions(new NullProgressMonitor(), null);
+
+ CompositeChange rootChange = (CompositeChange)participant.createChange(new NullProgressMonitor());
+
+ checkChanges(rootChange, changeList);
+ }
+
+ private void checkBeforeRefactoring(List<TestChangeStructure> changeList){
for(TestChangeStructure changeStructure : changeList){
IFile file = changeStructure.getProject().getFile(changeStructure.getFileName());
String content = null;
@@ -41,12 +90,10 @@
assertNotSame(change.getText(), content.substring(change.getOffset(), change.getOffset()+change.getLength()));
}
}
-
- // Rename
- processor.checkInitialConditions(new NullProgressMonitor());
- processor.checkFinalConditions(new NullProgressMonitor(), null);
- CompositeChange rootChange = (CompositeChange)processor.createChange(new NullProgressMonitor());
-
+ }
+
+ private void checkChanges(CompositeChange rootChange, List<TestChangeStructure> changeList) throws CoreException {
+ assertNotNull("Root change is null",rootChange);
assertEquals("There is unexpected number of changes",changeList.size(), rootChange.getChildren().length);
for(int i = 0; i < rootChange.getChildren().length;i++){
@@ -62,7 +109,6 @@
rootChange.perform(new NullProgressMonitor());
JobUtils.waitForIdle(2000);
-
// Test results
for(TestChangeStructure changeStructure : changeList){
@@ -74,7 +120,6 @@
}
}
}
-
protected TestChangeStructure findChange(List<TestChangeStructure> changeList, IFile file){
for(TestChangeStructure tcs : changeList){
15 years, 4 months
JBoss Tools SVN: r24411 - trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2010-08-25 06:52:41 -0400 (Wed, 25 Aug 2010)
New Revision: 24411
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java
Log:
fixing compilation error
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java 2010-08-25 09:25:27 UTC (rev 24410)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java 2010-08-25 10:52:41 UTC (rev 24411)
@@ -934,7 +934,7 @@
}
// Drop from VPE to Source is forbidden
if (dropContext.getFlavor().equals("text/html")) { //$NON-NLS-1$
- if (InnerDragBuffer.object != null) {
+ if (InnerDragBuffer.getInnerDragObject() != null) {
event.detail = DND.DROP_NONE;
}
return;
15 years, 4 months
JBoss Tools SVN: r24410 - in trunk: common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/texteditors/xmleditor and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2010-08-25 05:25:27 -0400 (Wed, 25 Aug 2010)
New Revision: 24410
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/context/DropContext.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/context/InnerDragBuffer.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/texteditors/xmleditor/XMLTextEditor.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/VpeDnD.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/dnd/context/JSPViewerDropAdapter.java
Log:
https://jira.jboss.org/browse/JBIDE-6860
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/context/DropContext.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/context/DropContext.java 2010-08-25 08:18:54 UTC (rev 24409)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/context/DropContext.java 2010-08-25 09:25:27 UTC (rev 24410)
@@ -246,7 +246,7 @@
Object ooo = LocalSelectionTransfer.getTransfer().getSelection();
if(ooo instanceof StructuredSelection) {
ooo = ((StructuredSelection)ooo).getFirstElement();
- InnerDragBuffer.object = ooo;
+ InnerDragBuffer.setInnerDragObject(ooo);
}
mimeData = ooo == null ? null : ooo.toString();
}
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/context/InnerDragBuffer.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/context/InnerDragBuffer.java 2010-08-25 08:18:54 UTC (rev 24409)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/context/InnerDragBuffer.java 2010-08-25 09:25:27 UTC (rev 24410)
@@ -11,6 +11,15 @@
package org.jboss.tools.common.model.ui.editors.dnd.context;
public class InnerDragBuffer {
- public static Object object = null;
+
+ private static Object innerDragObject = null;
+ public static Object getInnerDragObject() {
+ return innerDragObject;
+ }
+
+ public static void setInnerDragObject(Object innerDragObject) {
+ InnerDragBuffer.innerDragObject = innerDragObject;
+ }
+
}
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/texteditors/xmleditor/XMLTextEditor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/texteditors/xmleditor/XMLTextEditor.java 2010-08-25 08:18:54 UTC (rev 24409)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/texteditors/xmleditor/XMLTextEditor.java 2010-08-25 09:25:27 UTC (rev 24410)
@@ -508,7 +508,7 @@
}
// Drop from VPE to Source is forbidden
if(dropContext.getFlavor().equals("text/html")) { //$NON-NLS-1$
- if(InnerDragBuffer.object != null) {
+ if(InnerDragBuffer.getInnerDragObject()!= null) {
event.detail = DND.DROP_NONE;
}
return;
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/VpeDnD.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/VpeDnD.java 2010-08-25 08:18:54 UTC (rev 24409)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/VpeDnD.java 2010-08-25 09:25:27 UTC (rev 24410)
@@ -278,8 +278,8 @@
}
private DropResolver getDropResolverForInternalDrop() {
- if (InnerDragBuffer.object instanceof Node) {
- return getDropResolverForNode((Node) InnerDragBuffer.object);
+ if (InnerDragBuffer.getInnerDragObject() instanceof Node) {
+ return getDropResolverForNode((Node) InnerDragBuffer.getInnerDragObject());
} else {
return getSimpleDropResolver(false);
}
@@ -467,12 +467,13 @@
}
private void rememberDragNode(Node node) {
- InnerDragBuffer.object = node;
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- InnerDragBuffer.object = null;
- }
- });
+ InnerDragBuffer.setInnerDragObject(node);
+ //commented by Maksim Areshkau as fix for https://jira.jboss.org/browse/JBIDE-6860
+// Display.getDefault().asyncExec(new Runnable() {
+// public void run() {
+// InnerDragBuffer.setInnerDragObject(null);
+// }
+// });
}
private boolean isDraggable(nsIDOMElement element) {
@@ -524,7 +525,7 @@
textWidget.replaceTextRange(selectionRange.x, selectionRange.y, ""); //$NON-NLS-1$
dropAny(DndUtil.kUnicodeMime, text);
- } else if (InnerDragBuffer.object instanceof Node) {
+ } else if (InnerDragBuffer.getInnerDragObject() instanceof Node) {
VpeSourceDropInfo sourceDropInfo = getDropInfo();
if (sourceDropInfo.getContainer() != null) {
if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
@@ -539,14 +540,14 @@
if (sourceDropInfo.canDrop()) {
VpeDnDHelper dropper = new VpeDnDHelper();
dropper.setDndData(false, true);
- Node node = (Node) InnerDragBuffer.object;
+ Node node = (Node) InnerDragBuffer.getInnerDragObject();
dropper.drop(vpeController.getPageContext(),
new VpeSourceInnerDragInfo(node, 0, 0), sourceDropInfo);
// select dropped node, JBIDE-6239
setSelectedNode(node);
- InnerDragBuffer.object = null;
+ InnerDragBuffer.setInnerDragObject(null);
}
}
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/dnd/context/JSPViewerDropAdapter.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/dnd/context/JSPViewerDropAdapter.java 2010-08-25 08:18:54 UTC (rev 24409)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/dnd/context/JSPViewerDropAdapter.java 2010-08-25 09:25:27 UTC (rev 24410)
@@ -189,13 +189,13 @@
if(testOnly) {
return editor != null && editor.isEditable() && dropContext.getFlavor() != null;
} else {
- if(InnerDragBuffer.object instanceof Node && editor instanceof IJSPTextEditor) {
+ if(InnerDragBuffer.getInnerDragObject() instanceof Node && editor instanceof IJSPTextEditor) {
int offset = 0;
if(refChild instanceof NodeImpl) {
offset = ((NodeImpl)refChild).getIndex();
}
- ((IJSPTextEditor)editor).getVPEController().drop((Node)InnerDragBuffer.object, parentNode, offset);
- InnerDragBuffer.object = null;
+ ((IJSPTextEditor)editor).getVPEController().drop((Node)InnerDragBuffer.getInnerDragObject(), parentNode, offset);
+ InnerDragBuffer.setInnerDragObject(null);
} else {
int pos = getDropPosition(parentNode, refChild);
editor.selectAndReveal(pos, 0);
15 years, 4 months
JBoss Tools SVN: r24409 - in trunk: tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: vpakan(a)redhat.com
Date: 2010-08-25 04:18:54 -0400 (Wed, 25 Aug 2010)
New Revision: 24409
Added:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/MenuItemEntity.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/VisualEditorContextMenuTest.java
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/ContextMenuHelper.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/KeyboardHelper.java
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/ViewType.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/tools/SWTBotWebBrowser.java
Log:
Added VisualEditorContextMenuTest test.
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/ContextMenuHelper.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/ContextMenuHelper.java 2010-08-25 08:06:59 UTC (rev 24408)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/ContextMenuHelper.java 2010-08-25 08:18:54 UTC (rev 24409)
@@ -49,7 +49,7 @@
public class ContextMenuHelper {
protected static final Logger log = Logger.getLogger(ContextMenuHelper.class);
/**
- * Clicks the context menu matching the text.
+ * Returns the context menu item matching the text.
*
* @param bot bot containing context menu.
* @param text the text on the context menu.
@@ -58,19 +58,42 @@
*/
public static MenuItem getContextMenu(final AbstractSWTBot<?> bot,
final String text, final boolean hideAfterwards) {
- final List<String> foundMenuItems = new Vector<String>();
+ final Menu menu = UIThreadRunnable.syncExec(new WidgetResult<Menu>() {
+ public Menu run() {
+ return getWidgetMenu(bot.widget);
+ }
+ });
+ if (menu == null) {
+ throw new WidgetNotFoundException("Could not find menu of active bot: " + bot);
+ }
+ else{
+ return ContextMenuHelper.getContextMenu(menu, text, hideAfterwards);
+ }
+
+ }
+ /**
+ * Returns the context menu item matching the text.
+ *
+ * @param menu top parent menu containing menu item.
+ * @param text the text on the context menu.
+ * @param hideAfterwards hide menu when method is finished.
+ * @throws WidgetNotFoundException if the widget is not found.
+ */
+ public static MenuItem getContextMenu(final Menu menu,
+ final String text, final boolean hideAfterwards) {
+ final List<String> foundMenuItems = new Vector<String>();
final MenuItem menuItem = UIThreadRunnable
.syncExec(new WidgetResult<MenuItem>() {
@SuppressWarnings("unchecked")
- public MenuItem run() {
+ public MenuItem run() {
MenuItem menuItem = null;
- Menu menu = getWidgetMenu(bot.widget);
Matcher<?> matcher = allOf(instanceOf(MenuItem.class),withMnemonic(text));
menuItem = show(menu, matcher, hideAfterwards, foundMenuItems);
+ Menu currentMenu = menu;
if (menuItem != null) {
- menu = menuItem.getMenu();
+ currentMenu = menuItem.getMenu();
} else {
- hide(menu);
+ hide(currentMenu);
}
return menuItem;
}
@@ -91,6 +114,7 @@
return menuItem;
}
}
+
/**
* Simulate Show event to menu and returns MenuItem matching to matcher
* @param menu
@@ -118,16 +142,26 @@
return null;
}
/**
- * Recursively hide menus
+ * Hides menus recursively dependent on hideRecursively parameter
* @param menu bottom menu to start hiding from
+ * @param hideRecursively
*/
- private static void hide(final Menu menu) {
- menu.notifyListeners(SWT.Hide, new Event());
- if (menu.getParentMenu() != null) {
- hide(menu.getParentMenu());
+ private static void hide(final Menu menu , boolean hideRecursively) {
+ if (menu != null){
+ menu.notifyListeners(SWT.Hide, new Event());
+ if (menu.getParentMenu() != null && hideRecursively) {
+ hide(menu.getParentMenu(),hideRecursively);
+ }
}
}
/**
+ * Hides menus recursively dependent on hideRecursively parameter
+ * @param menu bottom menu to start hiding from
+ */
+ private static void hide(final Menu menu) {
+ ContextMenuHelper.hide (menu,true);
+ }
+ /**
* Returns menu of input widget
* @param widget
* @return
@@ -270,204 +304,314 @@
}
private static void click(final MenuItem menuItem) {
- final Event event = new Event();
- event.time = (int) System.currentTimeMillis();
- event.widget = menuItem;
- event.display = menuItem.getDisplay();
- event.type = SWT.Selection;
+ final Event event = new Event();
+ event.time = (int) System.currentTimeMillis();
+ event.widget = menuItem;
+ event.display = menuItem.getDisplay();
+ event.type = SWT.Selection;
- UIThreadRunnable.asyncExec(menuItem.getDisplay(), new VoidResult() {
- public void run() {
- log.info("Click on menu item: " + menuItem.getText());
- menuItem.notifyListeners(SWT.Selection, event);
- }
- });
- }
- /**
- * Returns tree menu which contains menuLabel
- * @param tree
- * @param menuLabel
- * @return
- */
- public static Menu getTreeMenuViaReflections (final Tree tree, final String menuLabel){
- // Menu has to be already created
- return UIThreadRunnable.syncExec(new WidgetResult<Menu>() {
- public Menu run() {
- Menu result = null;
- Composite parent = tree.getParent();
- while (!(parent instanceof Decorations)){
- parent = parent.getParent();
- }
- try {
- Menu[] menus = ReflectionsHelper.getPrivateFieldValue(Decorations.class,
- "menus",
- parent,
- Menu[].class);
- if (menus != null){
- MenuItem topMenuItem = null;
- int index = menus.length - 1;
- while (topMenuItem == null && index >= 0){
- if (menus[index] != null){
- MenuItem[] menuItems = menus[index].getItems();
- int menuItemIndex = 0;
- while (topMenuItem == null && menuItemIndex < menuItems.length){
- if (menuItems[menuItemIndex].getText().equals(menuLabel)){
- topMenuItem = menuItems[menuItemIndex];
- }
- menuItemIndex++;
+ UIThreadRunnable.asyncExec(menuItem.getDisplay(), new VoidResult() {
+ public void run() {
+ log.info("Click on menu item: " + menuItem.getText());
+ menuItem.notifyListeners(SWT.Selection, event);
+ }
+ });
+ }
+
+ /**
+ * Returns tree menu which contains menuLabel
+ *
+ * @param tree
+ * @param menuLabel
+ * @return
+ */
+ public static Menu getTreeMenuViaReflections(final Tree tree,
+ final String menuLabel) {
+ // Menu has to be already created
+ return UIThreadRunnable.syncExec(new WidgetResult<Menu>() {
+ public Menu run() {
+ Menu result = null;
+ Composite parent = tree.getParent();
+ while (!(parent instanceof Decorations)) {
+ parent = parent.getParent();
+ }
+ try {
+ Menu[] menus = ReflectionsHelper.getPrivateFieldValue(
+ Decorations.class, "menus", parent, Menu[].class);
+ if (menus != null) {
+ MenuItem topMenuItem = null;
+ int index = menus.length - 1;
+ while (topMenuItem == null && index >= 0) {
+ if (menus[index] != null) {
+ MenuItem[] menuItems = menus[index].getItems();
+ int menuItemIndex = 0;
+ while (topMenuItem == null && menuItemIndex < menuItems.length) {
+ if (menuItems[menuItemIndex].getText().equals(menuLabel)) {
+ topMenuItem = menuItems[menuItemIndex];
}
+ menuItemIndex++;
}
- index--;
}
- if (topMenuItem != null){
- result = topMenuItem.getParent();
- }
+ index--;
}
- else{
- throw new WidgetNotFoundException("Unable to find MenuItem with label " + menuLabel);
+ if (topMenuItem != null) {
+ result = topMenuItem.getParent();
}
- } catch (SecurityException se) {
- throw new WidgetNotFoundException("Unable to find MenuItem with label " + menuLabel,se);
- } catch (NoSuchFieldException nsfe) {
- throw new WidgetNotFoundException("Unable to find MenuItem with label " + menuLabel,nsfe);
- } catch (IllegalArgumentException iae) {
- throw new WidgetNotFoundException("Unable to find MenuItem with label " + menuLabel,iae);
- } catch (IllegalAccessException iace) {
- throw new WidgetNotFoundException("Unable to find MenuItem with label " + menuLabel,iace);
+ } else {
+ throw new WidgetNotFoundException(
+ "Unable to find MenuItem with label " + menuLabel);
}
- return result;
- }});
- }
- /**
- * Simulate Right Click on treeItem
- * @param tree
- * @param treeItem
- */
- public static void treeRightClick(final Tree tree , final TreeItem treeItem) {
- Rectangle cellBounds = UIThreadRunnable.syncExec(new Result<Rectangle>() {
- public Rectangle run() {
- return treeItem.getBounds();
+ } catch (SecurityException se) {
+ throw new WidgetNotFoundException(
+ "Unable to find MenuItem with label " + menuLabel, se);
+ } catch (NoSuchFieldException nsfe) {
+ throw new WidgetNotFoundException(
+ "Unable to find MenuItem with label " + menuLabel, nsfe);
+ } catch (IllegalArgumentException iae) {
+ throw new WidgetNotFoundException(
+ "Unable to find MenuItem with label " + menuLabel, iae);
+ } catch (IllegalAccessException iace) {
+ throw new WidgetNotFoundException(
+ "Unable to find MenuItem with label " + menuLabel, iace);
}
- });
- clickXY(cellBounds.x + (cellBounds.width / 2), cellBounds.y + (cellBounds.height / 2), tree , treeItem);
- }
- /**
- * Simulate Right Click on treeItem on specified position
- * @param x
- * @param y
- * @param tree
- * @param treeItem
- */
- protected static void clickXY(int x, int y,final Tree tree , final TreeItem treeItem) {
- notifyTree(SWT.MouseEnter,tree,treeItem);
- notifyTree(SWT.MouseMove,tree,treeItem);
- notifyTree(SWT.Activate,tree,treeItem);
- notifyTree(SWT.FocusIn,tree,treeItem);
- notifyTree(SWT.MouseDown, createMouseEvent(x, y, 3, SWT.BUTTON3, 1, tree, treeItem),tree);
- notifyTree(SWT.MouseUp,createMouseEvent(x, y, 3, SWT.BUTTON3, 1, tree, treeItem),tree);
- notifyTree(SWT.Selection, createEvent(tree,treeItem),tree);
- notifyTree(SWT.MouseHover,tree,treeItem);
- notifyTree(SWT.MouseMove,tree,treeItem);
- notifyTree(SWT.MouseExit,tree,treeItem);
- notifyTree(SWT.Deactivate,tree,treeItem);
- notifyTree(SWT.FocusOut,tree,treeItem);
- }
- /**
- * Notify tree with Event of specified eventType
- * @param eventType
- * @param tree
- * @param treeItem
- */
- private static void notifyTree(int eventType , Tree tree , TreeItem treeItem) {
- Event event = new Event();
- event.time = (int) System.currentTimeMillis();
- event.widget = tree;
- event.display = tree.getDisplay();
- event.item = treeItem;
+ return result;
+ }
+ });
+ }
- notify(eventType, event, tree);
- }
- /**
- * Notify tree with Event of specified eventType
- * @param eventType
- * @param event
- * @param tree
- */
- private static void notifyTree(int eventType , Event event , Tree tree) {
- notify(eventType, event, tree);
- }
- /**
- * Sends a non-blocking notification of the specified type to the widget.
- *
- * @param eventType the type of event.
- * @param createEvent the event to be sent to the {@link #widget}.
- * @param widget the widget to send the event to.
- */
- protected static void notify(final int eventType, final Event createEvent, final Widget widget) {
- createEvent.type = eventType;
- widget.getDisplay().asyncExec(new Runnable() {
- public void run() {
- if ((widget == null) || widget.isDisposed()) {
- return;
- }
- widget.notifyListeners(eventType, createEvent);
+ /**
+ * Simulate Right Click on treeItem
+ *
+ * @param tree
+ * @param treeItem
+ */
+ public static void treeRightClick(final Tree tree, final TreeItem treeItem) {
+ Rectangle cellBounds = UIThreadRunnable.syncExec(new Result<Rectangle>() {
+ public Rectangle run() {
+ return treeItem.getBounds();
+ }
+ });
+ clickXY(cellBounds.x + (cellBounds.width / 2), cellBounds.y
+ + (cellBounds.height / 2), tree, treeItem);
+ }
+
+ /**
+ * Simulate Right Click on treeItem on specified position
+ *
+ * @param x
+ * @param y
+ * @param tree
+ * @param treeItem
+ */
+ protected static void clickXY(int x, int y, final Tree tree,
+ final TreeItem treeItem) {
+ notifyTree(SWT.MouseEnter, tree, treeItem);
+ notifyTree(SWT.MouseMove, tree, treeItem);
+ notifyTree(SWT.Activate, tree, treeItem);
+ notifyTree(SWT.FocusIn, tree, treeItem);
+ notifyTree(SWT.MouseDown,
+ createMouseEvent(x, y, 3, SWT.BUTTON3, 1, tree, treeItem), tree);
+ notifyTree(SWT.MouseUp,
+ createMouseEvent(x, y, 3, SWT.BUTTON3, 1, tree, treeItem), tree);
+ notifyTree(SWT.Selection, createEvent(tree, treeItem), tree);
+ notifyTree(SWT.MouseHover, tree, treeItem);
+ notifyTree(SWT.MouseMove, tree, treeItem);
+ notifyTree(SWT.MouseExit, tree, treeItem);
+ notifyTree(SWT.Deactivate, tree, treeItem);
+ notifyTree(SWT.FocusOut, tree, treeItem);
+ }
+
+ /**
+ * Notify tree with Event of specified eventType
+ *
+ * @param eventType
+ * @param tree
+ * @param treeItem
+ */
+ private static void notifyTree(int eventType, Tree tree, TreeItem treeItem) {
+ Event event = new Event();
+ event.time = (int) System.currentTimeMillis();
+ event.widget = tree;
+ event.display = tree.getDisplay();
+ event.item = treeItem;
+
+ notify(eventType, event, tree);
+ }
+
+ /**
+ * Notify tree with Event of specified eventType
+ *
+ * @param eventType
+ * @param event
+ * @param tree
+ */
+ private static void notifyTree(int eventType, Event event, Tree tree) {
+ notify(eventType, event, tree);
+ }
+
+ /**
+ * Sends a non-blocking notification of the specified type to the widget.
+ *
+ * @param eventType
+ * the type of event.
+ * @param createEvent
+ * the event to be sent to the {@link #widget}.
+ * @param widget
+ * the widget to send the event to.
+ */
+ protected static void notify(final int eventType, final Event createEvent,
+ final Widget widget) {
+ createEvent.type = eventType;
+ widget.getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ if ((widget == null) || widget.isDisposed()) {
+ return;
}
- });
+ widget.notifyListeners(eventType, createEvent);
+ }
+ });
- widget.getDisplay().syncExec(new Runnable() {
- public void run() {
- // do nothing, just wait for sync.
+ widget.getDisplay().syncExec(new Runnable() {
+ public void run() {
+ // do nothing, just wait for sync.
+ }
+ });
+ }
+
+ /**
+ * Create a mouse event
+ *
+ * @param x
+ * the x co-ordinate of the mouse event.
+ * @param y
+ * the y co-ordinate of the mouse event.
+ * @param button
+ * the mouse button that was clicked.
+ * @param stateMask
+ * the state of the keyboard modifier keys.
+ * @param count
+ * the number of times the mouse was clicked.
+ * @return an event that encapsulates {@link #widget} and {@link #display}
+ * @since 1.2
+ */
+ protected static Event createMouseEvent(int x, int y, int button,
+ int stateMask, int count, Tree tree, TreeItem treeItem) {
+ Event event = new Event();
+ event.time = (int) System.currentTimeMillis();
+ event.widget = tree;
+ event.display = tree.getDisplay();
+ event.x = x;
+ event.y = y;
+ event.button = button;
+ event.stateMask = stateMask;
+ event.count = count;
+ event.item = treeItem;
+ return event;
+ }
+
+ /**
+ * Create default Event for tree and treeItem
+ *
+ * @param tree
+ * @param treeItem
+ * @return
+ */
+ protected static Event createEvent(Tree tree, TreeItem treeItem) {
+ Event event = new Event();
+ event.time = (int) System.currentTimeMillis();
+ event.widget = tree;
+ event.display = tree.getDisplay();
+ event.item = treeItem;
+ return event;
+ }
+
+ /**
+ * Hide menu and all his parent menus and explicitly call
+ * menu.setVisible(false)
+ *
+ * @param menu
+ */
+ public static void hideMenuRecursively(final Menu menu) {
+ menu.getDisplay().syncExec(new Runnable() {
+ public void run() {
+ ContextMenuHelper.hide(menu, true);
+ menu.setVisible(false);
+ }
+ });
+ }
+
+ /**
+ * Hides one particular menu and explicitly call menu.setVisible(false)
+ *
+ * @param menu
+ */
+ public static void hideMenuNonRecursively(final Menu menu) {
+ menu.getDisplay().syncExec(new Runnable() {
+ public void run() {
+ ContextMenuHelper.hide(menu, false);
+ menu.setVisible(false);
+ }
+ });
+ }
+
+ /**
+ * Returns Menu Items Labels of menu
+ *
+ * @param menu
+ * @return
+ */
+ public static String[] getMenuItemLabels(final Menu menu) {
+
+ String[] result = null;
+
+ result = UIThreadRunnable.syncExec(new Result<String[]>() {
+ public String[] run() {
+ MenuItem[] items = menu.getItems();
+ String[] itemsLabels = new String[items.length];
+ for (int index = 0; index < items.length; index++) {
+ itemsLabels[index] = items[index].getText();
}
- });
- }
- /**
- * Create a mouse event
- *
- * @param x the x co-ordinate of the mouse event.
- * @param y the y co-ordinate of the mouse event.
- * @param button the mouse button that was clicked.
- * @param stateMask the state of the keyboard modifier keys.
- * @param count the number of times the mouse was clicked.
- * @return an event that encapsulates {@link #widget} and {@link #display}
- * @since 1.2
- */
- protected static Event createMouseEvent(int x, int y, int button, int stateMask, int count, Tree tree , TreeItem treeItem) {
- Event event = new Event();
- event.time = (int) System.currentTimeMillis();
- event.widget = tree;
- event.display = tree.getDisplay();
- event.x = x;
- event.y = y;
- event.button = button;
- event.stateMask = stateMask;
- event.count = count;
- event.item = treeItem;
- return event;
- }
- /**
- * Create default Event for tree and treeItem
- * @param tree
- * @param treeItem
- * @return
- */
- protected static Event createEvent(Tree tree, TreeItem treeItem) {
- Event event = new Event();
- event.time = (int) System.currentTimeMillis();
- event.widget = tree;
- event.display = tree.getDisplay();
- event.item = treeItem;
- return event;
- }
- /**
- * Hide menu and all his parent menus
- * @param menu
- */
- public static void hideMenuRecursively(final Menu menu){
- menu.getDisplay().syncExec(new Runnable() {
- public void run() {
- ContextMenuHelper.hide(menu);
- menu.setVisible(false);
+ return itemsLabels;
+ }
+ });
+
+ ContextMenuHelper.hideMenuRecursively(menu);
+
+ return result;
+
+ }
+
+ /**
+ * Shows menu of menuItem
+ *
+ * @param menuItem
+ * @return
+ */
+ public static Menu showMenuOfMenuItem(final MenuItem menuItem) {
+ Menu result = null;
+
+ result = UIThreadRunnable.syncExec(new Result<Menu>() {
+ public Menu run() {
+ Menu menu = menuItem.getMenu();
+ if (menu != null) {
+ menu.notifyListeners(SWT.Show, new Event());
+ menu.setVisible(true);
}
- });
- }
+ return menu;
+ }
+ });
+
+ return result;
+ }
+ /**
+ * Trim special characters from menu item label used before comparing menu item label
+ * @param menuItemLabel
+ * @return
+ */
+ public static String trimMenuItemLabel (String menuItemLabel){
+ String result = menuItemLabel.trim().replaceAll("\\&", "").split("\t")[0];
+
+ return result;
+
+ }
}
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/KeyboardHelper.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/KeyboardHelper.java 2010-08-25 08:06:59 UTC (rev 24408)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/KeyboardHelper.java 2010-08-25 08:18:54 UTC (rev 24409)
@@ -74,10 +74,21 @@
/**
* Simulate typing of key with keyCode via AWT
* @param awtKeyCode
+ * @param modifiers keyboard modifiers such CTRL, ALT, SHIFT ...
*/
- public static void typeKeyCodeUsingAWT (int awtKeyCode){
+ public static void typeKeyCodeUsingAWT (int awtKeyCode , int... modifiers){
+ if (modifiers != null){
+ for (int modifierCode : modifiers){
+ KeyboardHelper.pressKeyCodeUsingAWT(modifierCode);
+ }
+ }
KeyboardHelper.pressKeyCodeUsingAWT(awtKeyCode);
KeyboardHelper.releaseKeyCodeUsingAWT(awtKeyCode);
+ if (modifiers != null){
+ for (int modifierCode : modifiers){
+ KeyboardHelper.releaseKeyCodeUsingAWT(modifierCode);
+ }
+ }
}
/**
* Simulate typing of basic string via AWT
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 2010-08-25 08:06:59 UTC (rev 24408)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2010-08-25 08:18:54 UTC (rev 24409)
@@ -78,6 +78,9 @@
public static final String NAVIGATION = "Navigation";
public static final String MAXIMIZE_ACTIVE_VIEW_OR_EDITOR = "Maximize Active View or Editor";
public static final String REFRESH = "Refresh";
+ public static final String CUT = "Cut";
+ public static final String COPY = "Copy";
+ public static final String PASTE = "Paste";
}
public class Button {
@@ -205,6 +208,7 @@
public static final String GUVNOR_RESOURCE_HISTORY = "Guvnor Resource History";
public static final String PROPERTIES = "Properties";
public static final String JBOSS_TOOLS_PALETTE = "JBoss Tools Palette";
+ public static final String PALETTE = "Palette";
}
public class ViewGroup {
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/ViewType.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/ViewType.java 2010-08-25 08:06:59 UTC (rev 24408)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/ViewType.java 2010-08-25 08:18:54 UTC (rev 24409)
@@ -20,9 +20,8 @@
public enum ViewType {
PACKAGE_EXPLORER, PROJECT_EXPLORER, WELCOME, DATA_SOURCE_EXPLORER,
SERVERS,WEB_PROJECTS,PROBLEMS,DEBUG,GUVNOR_REPOSITORIES,PROPERTIES,
- GUVNOR_RESOURCE_HISTORY,JBOSS_TOOLS_PALETTE;
+ GUVNOR_RESOURCE_HISTORY,JBOSS_TOOLS_PALETTE, PALETTE;
-
public String getGroupLabel() {
String viewLabel = "";
switch (this) {
@@ -37,6 +36,7 @@
case PROPERTIES: viewLabel = IDELabel.ViewGroup.GENERAL; break;
case GUVNOR_RESOURCE_HISTORY: viewLabel = IDELabel.ViewGroup.GUVNOR; break;
case JBOSS_TOOLS_PALETTE: viewLabel = IDELabel.ViewGroup.JBOSS_TOOLS_WEB; break;
+ case PALETTE: viewLabel = IDELabel.ViewGroup.GENERAL; break;
default: fail("Unknown View Type");
}
return viewLabel;
@@ -56,6 +56,7 @@
case PROPERTIES: viewLabel = IDELabel.View.PROPERTIES; break;
case GUVNOR_RESOURCE_HISTORY: viewLabel = IDELabel.View.GUVNOR_RESOURCE_HISTORY; break;
case JBOSS_TOOLS_PALETTE: viewLabel = IDELabel.View.JBOSS_TOOLS_PALETTE; break;
+ case PALETTE: viewLabel = IDELabel.View.PALETTE; break;
default: fail("Unknown View Type");
}
return viewLabel;
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java 2010-08-25 08:06:59 UTC (rev 24408)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java 2010-08-25 08:18:54 UTC (rev 24409)
@@ -8,6 +8,7 @@
import org.jboss.tools.vpe.ui.bot.test.editor.ToggleCommentTest;
import org.jboss.tools.vpe.ui.bot.test.editor.VerificationOfNameSpacesTest;
import org.jboss.tools.vpe.ui.bot.test.editor.JspFileEditingTest;
+import org.jboss.tools.vpe.ui.bot.test.editor.VisualEditorContextMenuTest;
import org.jboss.tools.vpe.ui.bot.test.editor.XhtmlFilePerformanceTest;
import org.jboss.tools.vpe.ui.bot.test.editor.pagedesign.AddSubstitutedELExpressionFolderScopeTest;
import org.jboss.tools.vpe.ui.bot.test.editor.pagedesign.ToolbarTextFormattingTest;
@@ -65,6 +66,7 @@
suite.addTestSuite(ManagePaletteGroupsTest.class);
suite.addTestSuite(PaletteEditorTest.class);
suite.addTestSuite(ToolbarTextFormattingTest.class);
+ suite.addTestSuite(VisualEditorContextMenuTest.class);
return new TestSetup(suite);
}
Added: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/MenuItemEntity.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/MenuItemEntity.java (rev 0)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/MenuItemEntity.java 2010-08-25 08:18:54 UTC (rev 24409)
@@ -0,0 +1,115 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.ui.bot.test.editor;
+
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * Data Representation for Menu Entity
+ * @author vlado pakan
+ *
+ */
+public class MenuItemEntity {
+ private String label = null;
+ private List<MenuItemEntity> children = null;
+
+ public MenuItemEntity(String label) {
+ super();
+ this.label = label;
+ this.children = null;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((children == null) ? 0 : children.hashCode());
+ result = prime * result + ((label == null) ? 0 : label.hashCode());
+ return result;
+ }
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ MenuItemEntity other = (MenuItemEntity) obj;
+ if (children == null) {
+ if (other.children != null)
+ return false;
+ } else if(other.children == null){
+ return false;
+ }
+ else {
+ if (children.size() == other.children.size()){
+ Iterator<MenuItemEntity> it = children.iterator();
+ Iterator<MenuItemEntity> itOther = other.children.iterator();
+ while (it.hasNext()){
+ if (!it.next().equals(itOther.next())){
+ return false;
+ }
+ }
+ }
+ else {
+ return false;
+ }
+ }
+ if (label == null) {
+ if (other.label != null)
+ return false;
+ } else if (!label.equals(other.label))
+ return false;
+ return true;
+ }
+
+ public String getLabel() {
+ return label;
+ }
+
+ public void setLabel(String label) {
+ this.label = label;
+ }
+
+ public List<MenuItemEntity> getChildren() {
+ return children;
+ }
+
+ public void setChildren(List<MenuItemEntity> children) {
+ this.children = children;
+ }
+
+ @Override
+ public String toString() {
+ return "MenuItemEntity [label=" + label + "]\nChildren:" + childrenToString(0);
+ }
+
+ public String childrenToString (int level){
+ char[] fill = new char[level];
+ Arrays.fill(fill, ' ');
+ StringBuffer sb = new StringBuffer(new String(fill));
+ sb.append(getLabel());
+ sb.append("\n");
+ if (children != null){
+ level +=2;
+ for (MenuItemEntity child : children){
+ sb.append(child.childrenToString(level));
+ }
+ }
+
+ return sb.toString();
+
+ }
+
+}
Property changes on: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/MenuItemEntity.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/VisualEditorContextMenuTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/VisualEditorContextMenuTest.java (rev 0)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/VisualEditorContextMenuTest.java 2010-08-25 08:18:54 UTC (rev 24409)
@@ -0,0 +1,502 @@
+/*******************************************************************************
+
+ * Copyright (c) 2007-2010 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.ui.bot.test.editor;
+
+import java.awt.event.KeyEvent;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.eclipse.gef.palette.PaletteContainer;
+import org.eclipse.gef.palette.PaletteEntry;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
+import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
+import org.eclipse.swtbot.swt.finder.results.VoidResult;
+import org.jboss.tools.ui.bot.ext.SWTBotExt;
+import org.jboss.tools.ui.bot.ext.Timing;
+import org.jboss.tools.ui.bot.ext.helper.ContextMenuHelper;
+import org.jboss.tools.ui.bot.ext.helper.KeyboardHelper;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.jboss.tools.vpe.ui.bot.test.tools.SWTBotWebBrowser;
+import org.mozilla.interfaces.nsIDOMNode;
+/**
+ * Tests Visual Editor Context Menu
+ * @author vlado pakan
+ *
+ */
+public class VisualEditorContextMenuTest extends VPEEditorTestCase {
+
+ private static final String PAGE_TEXT = "<%@ taglib uri=\"http://java.sun.com/jsf/html\" prefix=\"h\" %>\n" +
+ "<%@ taglib uri=\"http://richfaces.org/rich\" prefix=\"rich\"%>\n" +
+ "<html>\n" +
+ " <body>\n" +
+ " plain text \n" +
+ " <h:outputText value=\"Studio\" />\n" +
+ " <rich:calendar></rich:calendar>\n" +
+ " <h:inputText/>\n" +
+ " <h:inputText/>\n" +
+ " </body>\n" +
+ "</html>";
+
+ private static final String TEST_PAGE_NAME = "VisualEditorContextMenuTest.jsp";
+
+ private SWTBotExt botExt = null;
+
+ public VisualEditorContextMenuTest() {
+ super();
+ botExt = new SWTBotExt();
+ }
+
+ public void testVisualEditorContextMenu(){
+ eclipse.maximizeActiveShell();
+ createJspPage(VisualEditorContextMenuTest.TEST_PAGE_NAME);
+ final SWTBotEclipseEditor jspTextEditor = botExt.editorByTitle(VisualEditorContextMenuTest.TEST_PAGE_NAME)
+ .toTextEditor();
+ final SWTBotWebBrowser webBrowser = new SWTBotWebBrowser(VisualEditorContextMenuTest.TEST_PAGE_NAME,botExt);
+ checkContextMenuOfEmptyPage(webBrowser, jspTextEditor);
+ checkContextMenuOfPlainText(webBrowser, jspTextEditor);
+ checkContextMenuOfComponent(webBrowser, jspTextEditor);
+ checkInsertMenuContent(webBrowser);
+ checkEditMenuFunctionality(webBrowser, jspTextEditor);
+ checkInsertMenuFunctionality(webBrowser, jspTextEditor);
+ jspTextEditor.close();
+ }
+ /**
+ * Checks Context Menu of Empty JSP Page
+ * @param webBrowser
+ * @param jspTextEditor
+ */
+ private void checkContextMenuOfEmptyPage(SWTBotWebBrowser webBrowser , SWTBotEclipseEditor jspTextEditor){
+ jspTextEditor.setText("");
+ jspTextEditor.save();
+ jspTextEditor.setFocus();
+ jspTextEditor.selectRange(0, 0, 0);
+ // Test Context menu for empty page
+ checkMenuContent(webBrowser,new String[] {"",
+ SWTBotWebBrowser.INSERT_AROUND_MENU_LABEL,
+ SWTBotWebBrowser.INSERT_BEFORE_MENU_LABEL,
+ SWTBotWebBrowser.INSERT_AFTER_MENU_LABEL,
+ SWTBotWebBrowser.INSERT_INTO_MENU_LABEL,
+ SWTBotWebBrowser.REPLACE_WITH_MENU_LABEL,
+ "",
+ SWTBotWebBrowser.ZOOM_MENU_LABEL,
+ "",
+ SWTBotWebBrowser.PASTE_MENU_LABEL});
+
+ }
+ /**
+ * Checks Context Menu of Plain Text selected within Visual Editor
+ * @param webBrowser
+ * @param jspTextEditor
+ */
+ private void checkContextMenuOfPlainText(SWTBotWebBrowser webBrowser , SWTBotEclipseEditor jspTextEditor){
+ jspTextEditor.setText(VisualEditorContextMenuTest.PAGE_TEXT);
+ jspTextEditor.save();
+ jspTextEditor.setFocus();
+ jspTextEditor.selectRange(4, 5, 0);
+ checkMenuContent(webBrowser,new String[] {SWTBotWebBrowser.PARENT_TAG_MENU_LABEL + " (body)",
+ "",
+ SWTBotWebBrowser.INSERT_AROUND_MENU_LABEL,
+ SWTBotWebBrowser.INSERT_BEFORE_MENU_LABEL,
+ SWTBotWebBrowser.INSERT_AFTER_MENU_LABEL,
+ SWTBotWebBrowser.INSERT_INTO_MENU_LABEL,
+ SWTBotWebBrowser.REPLACE_WITH_MENU_LABEL,
+ "",
+ SWTBotWebBrowser.ZOOM_MENU_LABEL,
+ "",
+ SWTBotWebBrowser.CUT_MENU_LABEL,
+ SWTBotWebBrowser.COPY_MENU_LABEL,
+ SWTBotWebBrowser.PASTE_MENU_LABEL});
+ }
+ /**
+ * Checks Context Menu of Component selected within Visual Editor
+ * @param webBrowser
+ * @param jspTextEditor
+ */
+ private void checkContextMenuOfComponent(SWTBotWebBrowser webBrowser , SWTBotEclipseEditor jspTextEditor){
+ jspTextEditor.setFocus();
+ jspTextEditor.selectRange(5, 23, 0);
+ checkMenuContent(webBrowser,new String[] {"<h:outputText> Attributes",
+ SWTBotWebBrowser.PARENT_TAG_MENU_LABEL + " (body)",
+ "",
+ SWTBotWebBrowser.INSERT_AROUND_MENU_LABEL,
+ SWTBotWebBrowser.INSERT_BEFORE_MENU_LABEL,
+ SWTBotWebBrowser.INSERT_AFTER_MENU_LABEL,
+ SWTBotWebBrowser.INSERT_INTO_MENU_LABEL,
+ SWTBotWebBrowser.REPLACE_WITH_MENU_LABEL,
+ SWTBotWebBrowser.STRIP_TAG_MENU_LABEL,
+ "",
+ SWTBotWebBrowser.ZOOM_MENU_LABEL,
+ "",
+ SWTBotWebBrowser.CUT_MENU_LABEL,
+ SWTBotWebBrowser.COPY_MENU_LABEL,
+ SWTBotWebBrowser.PASTE_MENU_LABEL});
+ }
+ @Override
+ protected void closeUnuseDialogs() {
+
+ }
+
+ @Override
+ protected boolean isUnuseDialogOpened() {
+ return false;
+ }
+ /**
+ * Check content of Visual Editor Context Menu
+ * @param jspTextEditor
+ * @param expectedMenuLabels
+ */
+ private void checkMenuContent(SWTBotWebBrowser webBrowser , String[] expectedMenuLabels){
+
+ webBrowser.setFocus();
+ bot.sleep(Timing.time1S());
+ String[] menuLabels = ContextMenuHelper.getMenuItemLabels(webBrowser.getTopMenu(webBrowser.getSelectedDomNode(),
+ SWTBotWebBrowser.INSERT_AROUND_MENU_LABEL));
+ assertMenuContent(menuLabels , expectedMenuLabels);
+ }
+ /**
+ * Asserts equality of arrays containing menu items labels and expected menu items labels
+ * @param menuItems
+ * @param expectedMenuItems
+ */
+ private void assertMenuContent (String[] menuItems , String[] expectedMenuItems){
+ assertTrue("Visual Editor Context Menu has wrong content:\n" +
+ "It has items:\n" +
+ VisualEditorContextMenuTest.displayFormattedArrayContent(menuItems) +
+ "Expected items are:\n" +
+ VisualEditorContextMenuTest.displayFormattedArrayContent(expectedMenuItems)
+ ,VisualEditorContextMenuTest.menuItemsLabelsEquals(menuItems, expectedMenuItems));
+ }
+ /**
+ * Returns formatted interpretation of stringArray used for displaying strinArray content
+ * @param stringArray
+ * @return
+ */
+ private static String displayFormattedArrayContent (String[] stringArray){
+ StringBuffer sb = new StringBuffer("");
+
+ if (stringArray != null){
+ if (stringArray.length > 0){
+ for (String item : stringArray){
+ sb.append(item);
+ sb.append("\n");
+ }
+ }
+ else{
+ sb.append("<empty>\n");
+ }
+ }
+ else{
+ sb.append("<null>\n");
+ }
+
+ return sb.toString();
+ }
+ /**
+ * Compare menu items labels stored in string arrays
+ * @param menuLabels1
+ * @param menuLabels2
+ * @return
+ */
+ private static boolean menuItemsLabelsEquals (String[] menuLabels1 , String[] menuLabels2){
+
+ boolean areEqual = false;
+
+ if (menuLabels1 == null && menuLabels2 == null){
+ areEqual = true;
+ }
+ else if (menuLabels1 != null
+ && menuLabels2 != null
+ && menuLabels1.length == menuLabels2.length){
+ boolean areEqualYet = true;
+ int index = 0;
+ while (areEqualYet && (index < menuLabels1.length)){
+ if (!ContextMenuHelper.trimMenuItemLabel(menuLabels1[index])
+ .equals(menuLabels2[index])){
+ areEqualYet = false;
+ }
+ index++;
+ }
+ if (areEqualYet){
+ areEqual = true;
+ }
+ }
+
+ return areEqual;
+
+ }
+
+ /**
+ * Checks Context Menu Content for Insert* Menus and synchronization of these
+ * menus with JBoss Tools Palette Menus
+ * @param webBrowser
+ */
+ private void checkInsertMenuContent(final SWTBotWebBrowser webBrowser){
+ // Gets Complete Palette Actions Structure
+ MenuItemEntity paletteRootEntity = new MenuItemEntity("root");
+ paletteRootEntity.setChildren(getPaletteActionsStructure());
+ MenuItemEntity contextMenuRootEntity = new MenuItemEntity("root");
+ // Gets Complete Context Menu Structure
+ contextMenuRootEntity.setChildren(getContextMenuStructure(SWTBotWebBrowser.INSERT_AROUND_MENU_LABEL,webBrowser));
+ MenuItemEntity filteredPaleteRootEntity = filterPaletteMenuForInsertAroundAction(paletteRootEntity);
+ assertTrue("Palette content is different than Context Menu Items for inserting\n" +
+ "Palette content:\n" + filteredPaleteRootEntity +
+ "\n Context Menu Content:\n" + contextMenuRootEntity,
+ filteredPaleteRootEntity.equals(contextMenuRootEntity));
+ // Gets Complete Context Menu Structure
+ contextMenuRootEntity.setChildren(getContextMenuStructure(SWTBotWebBrowser.INSERT_BEFORE_MENU_LABEL,webBrowser));
+ assertTrue("Palette content is different than Context Menu Items for inserting\n" +
+ "Palette content:\n" + paletteRootEntity +
+ "\n Context Menu Content:\n" + contextMenuRootEntity,
+ paletteRootEntity.equals(contextMenuRootEntity));
+ // Gets Complete Context Menu Structure
+ contextMenuRootEntity.setChildren(getContextMenuStructure(SWTBotWebBrowser.INSERT_AFTER_MENU_LABEL,webBrowser));
+ assertTrue("Palette content is different than Context Menu Items for inserting\n" +
+ "Palette content:\n" + paletteRootEntity +
+ "\n Context Menu Content:\n" + contextMenuRootEntity,
+ paletteRootEntity.equals(contextMenuRootEntity));
+ // Gets Complete Context Menu Structure
+ contextMenuRootEntity.setChildren(getContextMenuStructure(SWTBotWebBrowser.INSERT_INTO_MENU_LABEL,webBrowser));
+ assertTrue("Palette content is different than Context Menu Items for inserting\n" +
+ "Palette content:\n" + paletteRootEntity +
+ "\n Context Menu Content:\n" + contextMenuRootEntity,
+ paletteRootEntity.equals(contextMenuRootEntity));
+ // Gets Complete Context Menu Structure
+ contextMenuRootEntity.setChildren(getContextMenuStructure(SWTBotWebBrowser.REPLACE_WITH_MENU_LABEL,webBrowser));
+ assertTrue("Palette content is different than Context Menu Items for inserting\n" +
+ "Palette content:\n" + paletteRootEntity +
+ "\n Context Menu Content:\n" + contextMenuRootEntity,
+ paletteRootEntity.equals(contextMenuRootEntity));
+ }
+ /**
+ * Returns complete Palette Actions Structure in data structure
+ * which can be used for comparing with Context Menu Structure
+ * @return
+ */
+ private List<MenuItemEntity> getPaletteActionsStructure(){
+ LinkedList<MenuItemEntity> result = new LinkedList<MenuItemEntity>();
+ List<PaletteContainer> paletteContainers = SWTBotWebBrowser.getPaletteRootContainers(botExt);
+ MenuItemEntity mainGroup = null;
+ for (PaletteContainer pc : paletteContainers){
+ String[] containerLabelParts = pc.getLabel().split(" ");
+ if (mainGroup == null || !mainGroup.getLabel().equals(containerLabelParts[0])){
+ mainGroup = new MenuItemEntity(containerLabelParts[0]);
+ mainGroup.setChildren(new LinkedList<MenuItemEntity>());
+ result.add(mainGroup);
+ }
+ MenuItemEntity technologyGroup = new MenuItemEntity(containerLabelParts[1]);
+ mainGroup.getChildren().add(technologyGroup);
+ List<PaletteEntry> pes = SWTBotWebBrowser.getPaletteContainerItems(pc);
+ LinkedList<MenuItemEntity> paletteContainerEntries = new LinkedList<MenuItemEntity>();
+ for (PaletteEntry pe : pes){
+ paletteContainerEntries.add(new MenuItemEntity(pe.getLabel()));
+ }
+ technologyGroup.setChildren(paletteContainerEntries);
+ }
+ return result;
+ }
+ /**
+ * Returns complete Menu Items Structure in data structure
+ * which can be used for comparing with Context Menu Structure
+ * @param topMenuLabel
+ * @param webBrowser
+ * @return
+ */
+ private List<MenuItemEntity> getContextMenuStructure(final String topMenuLabel , SWTBotWebBrowser webBrowser){
+ final LinkedList<MenuItemEntity> result = new LinkedList<MenuItemEntity>();
+ final Menu topMenu = webBrowser.getTopMenu(webBrowser.getSelectedDomNode(), topMenuLabel);
+
+ UIThreadRunnable.syncExec(new VoidResult() {
+ public void run() {
+ ContextMenuHelper.clickContextMenu(topMenu, topMenuLabel);
+ MenuItem useMenuItem = ContextMenuHelper.getContextMenu(topMenu, topMenuLabel, false);
+ Menu useMenu = ContextMenuHelper.showMenuOfMenuItem(useMenuItem);
+ for (String firstLevelMenuItemLabel : ContextMenuHelper.getMenuItemLabels(useMenu)){
+ ContextMenuHelper.clickContextMenu(useMenu, firstLevelMenuItemLabel);
+ MenuItem firstLevelMenuItem = ContextMenuHelper.getContextMenu(useMenu, firstLevelMenuItemLabel, false);
+ MenuItemEntity firstLevelMenuItemEntity = new MenuItemEntity(firstLevelMenuItem.getText());
+ result.add(firstLevelMenuItemEntity);
+ Menu firstLevelMenu = ContextMenuHelper.showMenuOfMenuItem(firstLevelMenuItem);
+ LinkedList<MenuItemEntity> firstMenuItemEntities = new LinkedList<MenuItemEntity>();
+ firstLevelMenuItemEntity.setChildren(firstMenuItemEntities);
+ for (String secondLevelMenuItemLabel : ContextMenuHelper.getMenuItemLabels(firstLevelMenu)){
+ ContextMenuHelper.clickContextMenu(firstLevelMenu, secondLevelMenuItemLabel);
+ MenuItem secondLevelMenuItem = ContextMenuHelper.getContextMenu(firstLevelMenu, secondLevelMenuItemLabel, false);
+ MenuItemEntity secondLevelMenuItemEntity = new MenuItemEntity(secondLevelMenuItem.getText());
+ firstMenuItemEntities.add(secondLevelMenuItemEntity);
+ Menu secondLevelMenu = ContextMenuHelper.showMenuOfMenuItem(secondLevelMenuItem);
+ LinkedList<MenuItemEntity> secondMenuItemEntities = new LinkedList<MenuItemEntity>();
+ secondLevelMenuItemEntity.setChildren(secondMenuItemEntities);
+ for (String thirdLevelMenuItemLabel : ContextMenuHelper.getMenuItemLabels(secondLevelMenu)){
+ // trim name space and <,> characters
+ String trimedLabel = thirdLevelMenuItemLabel.split(":")[1].replaceFirst(">", "");
+ secondMenuItemEntities.add(new MenuItemEntity(trimedLabel));
+ }
+ }
+ }
+ ContextMenuHelper.hideMenuNonRecursively(useMenu);
+ ContextMenuHelper.hideMenuRecursively(topMenu);
+ }
+ });
+ return result;
+ }
+ /**
+ * Filter Menu Item Entities which are not added to Insert Around Context Menu Action
+ * @param rootMenuItemEntity
+ * @return
+ */
+ private MenuItemEntity filterPaletteMenuForInsertAroundAction(MenuItemEntity rootMenuItemEntity){
+ MenuItemEntity result = new MenuItemEntity(rootMenuItemEntity.getLabel());
+ LinkedList<MenuItemEntity> newRootChildren = new LinkedList<MenuItemEntity>();
+ result.setChildren(newRootChildren);
+ for (MenuItemEntity mieFirstLevel : rootMenuItemEntity.getChildren()){
+ String firstLevelMenuItemLabel = mieFirstLevel.getLabel();
+ MenuItemEntity mieNewFirstLevel = new MenuItemEntity(firstLevelMenuItemLabel);
+ newRootChildren.add(mieNewFirstLevel);
+ LinkedList<MenuItemEntity> newFirstLevelChildren = new LinkedList<MenuItemEntity>();
+ mieNewFirstLevel.setChildren(newFirstLevelChildren);
+ for (MenuItemEntity mieSecondLevel : mieFirstLevel.getChildren()){
+ String secondLevelMenuItemLabel = mieSecondLevel.getLabel();
+ MenuItemEntity mieNewSecondLevel = new MenuItemEntity(secondLevelMenuItemLabel);
+ newFirstLevelChildren.add(mieNewSecondLevel);
+ LinkedList<MenuItemEntity> newSecondLevelChildren = new LinkedList<MenuItemEntity>();
+ mieNewSecondLevel.setChildren(newSecondLevelChildren);
+ for (MenuItemEntity mieThirdLevel : mieSecondLevel.getChildren()){
+ String thirdLevelMenuItemLabel = mieThirdLevel.getLabel();
+ if (thirdLevelMenuItemLabel.endsWith(" taglib") ||
+ (firstLevelMenuItemLabel.equals("JBoss") && secondLevelMenuItemLabel.equals("Ajax4Jsf") && thirdLevelMenuItemLabel.equals("queue")) ||
+ (firstLevelMenuItemLabel.equals("JBoss") && secondLevelMenuItemLabel.equals("RichFaces") && thirdLevelMenuItemLabel.equals("menuSeparator")) ||
+ (firstLevelMenuItemLabel.equals("JBoss") && secondLevelMenuItemLabel.equals("Seam") && thirdLevelMenuItemLabel.equals("convertEnum")) ||
+ (firstLevelMenuItemLabel.equals("JBoss") && secondLevelMenuItemLabel.equals("Seam") && thirdLevelMenuItemLabel.equals("convertDateTime")) ||
+ (firstLevelMenuItemLabel.equals("JBoss") && secondLevelMenuItemLabel.equals("Seam") && thirdLevelMenuItemLabel.equals("enumItem")) ||
+ (firstLevelMenuItemLabel.equals("JBoss") && secondLevelMenuItemLabel.equals("Seam") && thirdLevelMenuItemLabel.equals("fileUpload")) ||
+ (firstLevelMenuItemLabel.equals("JBoss") && secondLevelMenuItemLabel.equals("Seam") && thirdLevelMenuItemLabel.equals("validate")) ||
+ (firstLevelMenuItemLabel.equals("JSF") && secondLevelMenuItemLabel.equals("HTML") && thirdLevelMenuItemLabel.equals("commandButton")) ||
+ (firstLevelMenuItemLabel.equals("JSF") && secondLevelMenuItemLabel.equals("HTML") && thirdLevelMenuItemLabel.equals("graphicImage")) ||
+ (firstLevelMenuItemLabel.equals("JSF") && secondLevelMenuItemLabel.equals("HTML") && thirdLevelMenuItemLabel.equals("inputHidden")) ||
+ (firstLevelMenuItemLabel.equals("JSF") && secondLevelMenuItemLabel.equals("HTML") && thirdLevelMenuItemLabel.equals("inputSecret")) ||
+ (firstLevelMenuItemLabel.equals("JSF") && secondLevelMenuItemLabel.equals("HTML") && thirdLevelMenuItemLabel.equals("inputText")) ||
+ (firstLevelMenuItemLabel.equals("JSF") && secondLevelMenuItemLabel.equals("HTML") && thirdLevelMenuItemLabel.equals("message")) ||
+ (firstLevelMenuItemLabel.equals("JSF") && secondLevelMenuItemLabel.equals("HTML") && thirdLevelMenuItemLabel.equals("messages")) ||
+ (firstLevelMenuItemLabel.equals("JSF") && secondLevelMenuItemLabel.equals("HTML") && thirdLevelMenuItemLabel.equals("outputText")) ||
+ (firstLevelMenuItemLabel.equals("JSF") && secondLevelMenuItemLabel.equals("HTML") && thirdLevelMenuItemLabel.equals("selectBooleanCheckbox"))){
+ // Skip these Menu Items
+ }
+ else{
+ MenuItemEntity mieNewThirdLevel = new MenuItemEntity(thirdLevelMenuItemLabel);
+ newSecondLevelChildren.add(mieNewThirdLevel);
+ }
+ }
+ }
+ }
+
+ return result;
+ }
+ /**
+ * Checks Edit Menu functionality i.e. Cut, Copy and Paste Actions
+ * @param webBrowser
+ * @param jspTextEditor
+ */
+ private void checkEditMenuFunctionality(SWTBotWebBrowser webBrowser , SWTBotEclipseEditor jspTextEditor){
+ jspTextEditor.setFocus();
+ jspTextEditor.selectRange(6, 9, 0);
+ webBrowser.setFocus();
+ // Test Cut
+ nsIDOMNode calendarNode = webBrowser.getDomNodeByTagName("INPUT",0);
+ webBrowser.selectDomNode(calendarNode,0);
+ botExt.sleep(Timing.time1S());
+ webBrowser.clickContextMenu(calendarNode, IDELabel.Menu.CUT);
+ botExt.sleep(Timing.time1S());
+ String sourceEditorText = jspTextEditor.getText();
+ assertTrue ("Source Editor should not contain text '<rich:calendar></rich:calendar>'\nSource Editor Text: " +
+ sourceEditorText,
+ !sourceEditorText.contains("<rich:calendar></rich:calendar>"));
+ // Test Paste
+ webBrowser.setFocus();
+ nsIDOMNode inputTextNode = webBrowser.getDomNodeByTagName("INPUT",0);
+ webBrowser.selectDomNode(inputTextNode,0);
+ webBrowser.clickContextMenu(inputTextNode, IDELabel.Menu.PASTE);
+ botExt.sleep(Timing.time1S());
+ sourceEditorText = jspTextEditor.getText();
+ assertTrue ("Source Editor should contain text '<rich:calendar></rich:calendar>'\nSource Editor Text: " +
+ sourceEditorText,
+ sourceEditorText.contains("<rich:calendar></rich:calendar>"));
+ // Test Copy
+ calendarNode = webBrowser.getDomNodeByTagName("INPUT",0);
+ webBrowser.setFocus();
+ calendarNode = webBrowser.getDomNodeByTagName("INPUT",0);
+ webBrowser.selectDomNode(calendarNode,0);
+ webBrowser.clickContextMenu(calendarNode, IDELabel.Menu.COPY);
+ inputTextNode = webBrowser.getDomNodeByTagName("INPUT",1);
+ webBrowser.selectDomNode(inputTextNode,0);
+ botExt.sleep(Timing.time1S());
+ webBrowser.clickContextMenu(inputTextNode, IDELabel.Menu.PASTE);
+ botExt.sleep(Timing.time1S());
+ sourceEditorText = jspTextEditor.getText();
+ assertTrue ("Source Editor should not contain text '<h:inputText/>'\nSource Editor Text: " +
+ sourceEditorText,
+ !sourceEditorText.contains("<h:inputText/>"));
+ // Test editing using keyboard shortcuts
+ jspTextEditor.setFocus();
+ jspTextEditor.setText(VisualEditorContextMenuTest.PAGE_TEXT);
+ jspTextEditor.save();
+ jspTextEditor.selectRange(6, 9, 0);
+ bot.sleep(Timing.time1S());
+ webBrowser.setFocus();
+ // Test Cut
+ calendarNode = webBrowser.getDomNodeByTagName("INPUT",0);
+ webBrowser.selectDomNode(calendarNode,0);
+ botExt.sleep(Timing.time1S());
+ webBrowser.setFocus();
+ KeyboardHelper.typeKeyCodeUsingAWT(KeyEvent.VK_X,KeyEvent.VK_CONTROL);
+ botExt.sleep(Timing.time1S());
+ sourceEditorText = jspTextEditor.getText();
+ assertTrue ("Source Editor should not contain text '<rich:calendar></rich:calendar>'\nSource Editor Text: " +
+ sourceEditorText,
+ !sourceEditorText.contains("<rich:calendar></rich:calendar>"));
+ // Test Paste
+ webBrowser.setFocus();
+ inputTextNode = webBrowser.getDomNodeByTagName("INPUT",0);
+ webBrowser.selectDomNode(inputTextNode,0);
+ KeyboardHelper.typeKeyCodeUsingAWT(KeyEvent.VK_V,KeyEvent.VK_CONTROL);
+ botExt.sleep(Timing.time1S());
+ sourceEditorText = jspTextEditor.getText();
+ assertTrue ("Source Editor should contain text '<rich:calendar></rich:calendar>'\nSource Editor Text: " +
+ sourceEditorText,
+ sourceEditorText.contains("<rich:calendar></rich:calendar>"));
+ // Test Copy
+ calendarNode = webBrowser.getDomNodeByTagName("INPUT",0);
+ webBrowser.setFocus();
+ calendarNode = webBrowser.getDomNodeByTagName("INPUT",0);
+ webBrowser.selectDomNode(calendarNode,0);
+ KeyboardHelper.typeKeyCodeUsingAWT(KeyEvent.VK_C,KeyEvent.VK_CONTROL);
+ inputTextNode = webBrowser.getDomNodeByTagName("INPUT",1);
+ webBrowser.selectDomNode(inputTextNode,0);
+ botExt.sleep(Timing.time1S());
+ KeyboardHelper.typeKeyCodeUsingAWT(KeyEvent.VK_V,KeyEvent.VK_CONTROL);
+ botExt.sleep(Timing.time1S());
+ sourceEditorText = jspTextEditor.getText();
+ assertTrue ("Source Editor should not contain text '<h:inputText/>'\nSource Editor Text: " +
+ sourceEditorText,
+ !sourceEditorText.contains("<h:inputText/>"));
+
+ }
+ /**
+ * Checks Insert Menu Functionality
+ * @param webBrowser
+ * @param jspTextEditor
+ */
+ private void checkInsertMenuFunctionality(SWTBotWebBrowser webBrowser , SWTBotEclipseEditor jspTextEditor){
+
+ }
+}
Property changes on: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/VisualEditorContextMenuTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/tools/SWTBotWebBrowser.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/tools/SWTBotWebBrowser.java 2010-08-25 08:06:59 UTC (rev 24408)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/tools/SWTBotWebBrowser.java 2010-08-25 08:18:54 UTC (rev 24409)
@@ -18,9 +18,11 @@
import java.util.List;
import org.eclipse.gef.EditDomain;
+import org.eclipse.gef.palette.PaletteContainer;
import org.eclipse.gef.palette.PaletteEntry;
import org.eclipse.gef.palette.ToolEntry;
import org.eclipse.gef.ui.palette.PaletteViewer;
+import org.eclipse.gef.ui.views.palette.PaletteView;
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Decorations;
@@ -37,9 +39,9 @@
import org.eclipse.ui.IViewReference;
import org.eclipse.ui.PlatformUI;
import org.jboss.tools.common.model.ui.views.palette.PaletteCreator;
-import org.jboss.tools.common.model.ui.views.palette.PaletteViewPart;
import org.jboss.tools.jst.jsp.editor.IVisualEditor;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.jst.jsp.jspeditor.PalettePageImpl;
import org.jboss.tools.ui.bot.ext.SWTBotExt;
import org.jboss.tools.ui.bot.ext.SWTEclipseExt;
import org.jboss.tools.ui.bot.ext.Timing;
@@ -72,12 +74,18 @@
*
*/
public class SWTBotWebBrowser {
+ public static final String PARENT_TAG_MENU_LABEL = "Parent Tag";
public static final String INSERT_AROUND_MENU_LABEL = "Insert around";
public static final String INSERT_BEFORE_MENU_LABEL = "Insert before";
public static final String INSERT_AFTER_MENU_LABEL = "Insert after";
public static final String INSERT_INTO_MENU_LABEL = "Insert into";
public static final String REPLACE_WITH_MENU_LABEL = "Replace with";
public static final String STRIP_TAG_MENU_LABEL = "Strip Tag";
+ public static final String ZOOM_MENU_LABEL = "Zoom";
+ public static final String CUT_MENU_LABEL = "Cut";
+ public static final String COPY_MENU_LABEL = "Copy";
+ public static final String PASTE_MENU_LABEL = "Paste";
+
public static final String JSF_MENU_LABEL = "JSF";
public static final String HTML_MENU_LABEL = "HTML";
public static final String H_OUTPUT_TEXT_TAG_MENU_LABEL = "<h:outputText>";
@@ -295,97 +303,8 @@
* @param menus
*/
public void clickContextMenu(final nsIDOMNode node , final String... menuLabels){
- // Create Context Menu Event
- final nsIDOMEvent domEvent = new nsIDOMEvent() {
-
- public nsISupports queryInterface(String arg0) {
- return XPCOM.queryInterface(node,nsISupports.class);
- }
- public void stopPropagation() {
- }
- public void preventDefault() {
- }
- public void initEvent(String arg0, boolean arg1, boolean arg2) {
- }
- public String getType() {
- return "contextmenu";
- }
- public double getTimeStamp() {
- return 0;
- }
- public nsIDOMEventTarget getTarget() {
- return XPCOM.queryInterface(node,nsIDOMEventTarget.class);
- }
- public int getEventPhase() {
- return 0;
- }
-
- public nsIDOMEventTarget getCurrentTarget() {
- return XPCOM.queryInterface(node,nsIDOMEventTarget.class);
- }
- public boolean getCancelable() {
- return false;
- }
- public boolean getBubbles() {
- return false;
- }
- };
- // Simulate Context Menu Event
- display.syncExec(new Runnable() {
- public void run() {
- getMozillaEventAdapter().handleEvent(domEvent);
- }
- });
- // Get Top Menu
- Menu topMenu = UIThreadRunnable.syncExec(new WidgetResult<Menu>() {
- public Menu run() {
- Menu result = null;
- Composite parent = mozillaEditor.getControl().getParent();
- while (!(parent instanceof Decorations)){
- parent = parent.getParent();
- }
- try {
- Menu[] menus = ReflectionsHelper.getPrivateFieldValue(Decorations.class,
- "menus",
- parent,
- Menu[].class);
- if (menus != null){
- MenuItem topMenuItem = null;
- int index = menus.length - 1;
- while (topMenuItem == null && index >= 0){
- if (menus[index] != null){
- MenuItem[] menuItems = menus[index].getItems();
- int menuItemIndex = 0;
- while (topMenuItem == null && menuItemIndex < menuItems.length){
- if (menuItems[menuItemIndex].getText().equals(menuLabels[0])){
- topMenuItem = menuItems[menuItemIndex];
- }
- menuItemIndex++;
- }
- }
- index--;
- }
- if (topMenuItem != null){
- result = topMenuItem.getParent();
- }
- }
- else{
- throw new WidgetNotFoundException("Unable to find MenuItem with label " + menuLabels[0]);
- }
- } catch (SecurityException se) {
- throw new WidgetNotFoundException("Unable to find MenuItem with label " + menuLabels[0],se);
- } catch (NoSuchFieldException nsfe) {
- throw new WidgetNotFoundException("Unable to find MenuItem with label " + menuLabels[0],nsfe);
- } catch (IllegalArgumentException iae) {
- throw new WidgetNotFoundException("Unable to find MenuItem with label " + menuLabels[0],iae);
- } catch (IllegalAccessException iace) {
- throw new WidgetNotFoundException("Unable to find MenuItem with label " + menuLabels[0],iace);
- }
- return result;
- }});
-
+ Menu topMenu = getTopMenu(node, menuLabels[0]);
ContextMenuHelper.clickContextMenu(topMenu, menuLabels);
-
}
/**
* Returns node corresponding to specified tagName
@@ -488,7 +407,7 @@
* @return
*/
private static PaletteViewer getPaletteViewer (SWTBotExt bot){
- SWTEclipseExt.showView(bot, ViewType.JBOSS_TOOLS_PALETTE);
+ SWTEclipseExt.showView(bot, ViewType.PALETTE);
IViewReference ref = UIThreadRunnable
.syncExec(new Result<IViewReference>() {
@@ -498,7 +417,7 @@
viewReferences = PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getActivePage().getViewReferences();
for (IViewReference reference : viewReferences) {
- if (reference.getTitle().equals("JBoss Tools Palette")) {
+ if (reference.getTitle().equals(ViewType.PALETTE.getViewLabel())) {
return reference;
}
}
@@ -506,15 +425,15 @@
}
});
// Find Palette Viewer dirty way
- PaletteViewPart pvp = (PaletteViewPart) ref.getPart(true);
+ PaletteView pv = (PaletteView)ref.getPart(true);
+ PalettePageImpl ppi = (PalettePageImpl)pv.getCurrentPage();
try {
PaletteCreator pc = ReflectionsHelper.getPrivateFieldValue(
- PaletteViewPart.class, "paletteCreator", pvp, PaletteCreator.class);
+ PalettePageImpl.class, "paletteCreator", ppi, PaletteCreator.class);
PaletteAdapter pa = ReflectionsHelper.getPrivateFieldValue(
PaletteCreator.class, "paletteAdapter", pc, PaletteAdapter.class);
PaletteViewer paletteViewer = ReflectionsHelper.getPrivateFieldValue(
PaletteAdapter.class, "viewer", pa, PaletteViewer.class);
-
return paletteViewer;
} catch (SecurityException e) {
throw new RuntimeException(e);
@@ -583,4 +502,145 @@
result = getSelectionController().getSelection(nsISelectionController.SELECTION_NORMAL);
return result;
}
+ /**
+ * Returns top context menu of Visual Editor
+ * @param node
+ * @param topMenuItemLabel
+ * @return
+ */
+ public Menu getTopMenu(final nsIDOMNode node , final String topMenuItemLabel){
+ // Create Context Menu Event
+ final nsIDOMEvent domEvent = new nsIDOMEvent() {
+
+ public nsISupports queryInterface(String arg0) {
+ return node != null ? XPCOM.queryInterface(node,nsISupports.class) : null;
+ }
+ public void stopPropagation() {
+ }
+ public void preventDefault() {
+ }
+ public void initEvent(String arg0, boolean arg1, boolean arg2) {
+ }
+ public String getType() {
+ return "contextmenu";
+ }
+ public double getTimeStamp() {
+ return 0;
+ }
+ public nsIDOMEventTarget getTarget() {
+ return node != null ? XPCOM.queryInterface(node,nsIDOMEventTarget.class) : null;
+ }
+ public int getEventPhase() {
+ return 0;
+ }
+
+ public nsIDOMEventTarget getCurrentTarget() {
+ return node != null ? XPCOM.queryInterface(node,nsIDOMEventTarget.class) : null;
+ }
+ public boolean getCancelable() {
+ return false;
+ }
+ public boolean getBubbles() {
+ return false;
+ }
+ };
+ // Simulate Context Menu Event
+ display.syncExec(new Runnable() {
+ public void run() {
+ getMozillaEventAdapter().handleEvent(domEvent);
+ }
+ });
+ // Get Top Menu
+ return UIThreadRunnable.syncExec(new WidgetResult<Menu>() {
+ public Menu run() {
+ Menu result = null;
+ Composite parent = mozillaEditor.getControl().getParent();
+ while (!(parent instanceof Decorations)){
+ parent = parent.getParent();
+ }
+ try {
+ Menu[] menus = ReflectionsHelper.getPrivateFieldValue(Decorations.class,
+ "menus",
+ parent,
+ Menu[].class);
+ if (menus != null){
+ MenuItem topMenuItem = null;
+ int index = menus.length - 1;
+ while (topMenuItem == null && index >= 0){
+ if (menus[index] != null){
+ MenuItem[] menuItems = menus[index].getItems();
+ int menuItemIndex = 0;
+ while (topMenuItem == null && menuItemIndex < menuItems.length){
+ if (ContextMenuHelper.trimMenuItemLabel(menuItems[menuItemIndex].getText())
+ .equals(topMenuItemLabel)){
+ topMenuItem = menuItems[menuItemIndex];
+ }
+ menuItemIndex++;
+ }
+ }
+ index--;
+ }
+ if (topMenuItem != null){
+ result = topMenuItem.getParent();
+ }
+ }
+ else{
+ throw new WidgetNotFoundException("Unable to find MenuItem with label " + topMenuItemLabel);
+ }
+ } catch (SecurityException se) {
+ throw new WidgetNotFoundException("Unable to find MenuItem with label " + topMenuItemLabel,se);
+ } catch (NoSuchFieldException nsfe) {
+ throw new WidgetNotFoundException("Unable to find MenuItem with label " + topMenuItemLabel,nsfe);
+ } catch (IllegalArgumentException iae) {
+ throw new WidgetNotFoundException("Unable to find MenuItem with label " + topMenuItemLabel,iae);
+ } catch (IllegalAccessException iace) {
+ throw new WidgetNotFoundException("Unable to find MenuItem with label " + topMenuItemLabel,iace);
+ }
+ return result;
+ }});
+
+ }
+ /**
+ * Returns Palette Containers
+ * @param bot
+ * @return
+ */
+ public static final List<PaletteContainer> getPaletteRootContainers (SWTBotExt bot) {
+ List<PaletteContainer> result = null;
+ final PaletteViewer paletteViewer = SWTBotWebBrowser.getPaletteViewer(bot);
+ result = UIThreadRunnable.syncExec(new Result<LinkedList<PaletteContainer>> (){
+ public LinkedList<PaletteContainer> run() {
+ LinkedList<PaletteContainer> paletteContainers = new LinkedList<PaletteContainer>();
+ for (Object o : paletteViewer.getPaletteRoot().getChildren()){
+ if (o instanceof PaletteContainer){
+ paletteContainers.add((PaletteContainer)o);
+ }
+ }
+ return paletteContainers;
+ }
+ });
+
+ return result;
+ }
+ /**
+ * Returns Palette Entries of paletteContainer
+ * @param paletteContainer
+ * @return
+ */
+ public static final List<PaletteEntry> getPaletteContainerItems (final PaletteContainer paletteContainer) {
+ List<PaletteEntry> result = null;
+ result = UIThreadRunnable.syncExec(new Result<LinkedList<PaletteEntry>> (){
+ public LinkedList<PaletteEntry> run() {
+ LinkedList<PaletteEntry> paletteEntries = new LinkedList<PaletteEntry>();
+ for (Object o : paletteContainer.getChildren()){
+ if (o instanceof PaletteEntry && !(o instanceof PaletteContainer)){
+ paletteEntries.add((PaletteEntry)o);
+ }
+ }
+ return paletteEntries;
+ }
+ });
+ return result;
+ }
+
}
15 years, 4 months
JBoss Tools SVN: r24408 - trunk/documentation/whatsnew.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2010-08-25 04:06:59 -0400 (Wed, 25 Aug 2010)
New Revision: 24408
Modified:
trunk/documentation/whatsnew/index.html
Log:
M2 added to index
Modified: trunk/documentation/whatsnew/index.html
===================================================================
--- trunk/documentation/whatsnew/index.html 2010-08-25 08:06:19 UTC (rev 24407)
+++ trunk/documentation/whatsnew/index.html 2010-08-25 08:06:59 UTC (rev 24408)
@@ -22,6 +22,25 @@
<tr>
<td valign="top" align="left">
+ <p align="right"><b>3.2.0.M2</b>
+ <td valign="top">
+ <p><a href="core/core-news-3.2.0.M2.html">Core/General</a></p>
+ <p><a href="hibernate/hibernate-news-3.4.0.M2.html">Hibernate Tools</a></p>
+ <p><a href="jst/jst-news-3.2.0.M2.html">JST/JSF Tools</a></p>
+ <p><a href="vpe/vpe-news-3.2.0.M2.html">Visual Page Editor</a></p>
+ <p><a href="cdi/cdi-news-3.2.0.M2.html">CDI (JSR-299) Tools</a></p>
+ <p><a href="seam/seam-news-3.2.0.M2.html">Seam Tools</a></p>
+ <p><a href="bpel/bpel-news-1.1.0.M2.html">BPEL Tools</a></p>
+ <p><a href="drools/guvnor-tools-news-5.1.0.M2.html">Drools/Guvnor Tools</a></p>
+ <p><a href="jbpm/jbpm-news-3.2.0.M2.html">jBPM Tools</a></p>
+ <p><a href="ws/ws-news-1.2.0.M2.html">JBoss Webservice Tools</a></p>
+ <p><a href="deltacloud/deltacloud-news-1.1.0.M2.html">Deltacloud Development Tools</a></p>
+ <p><a href="gwt/gwt-news-1.0.0.M2.html">GWT Integration</a></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td valign="top" align="left">
<p align="right"><b>3.2.0.M1</b>
<td valign="top">
<p><a href="core/core-news-3.2.0.M1.html">Core/General</a></p>
15 years, 4 months