JBoss Tools SVN: r27418 - in trunk/ws/plugins/org.jboss.tools.ws.ui: META-INF and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: bfitzpat
Date: 2010-12-13 16:04:34 -0500 (Mon, 13 Dec 2010)
New Revision: 27418
Added:
trunk/ws/plugins/org.jboss.tools.ws.ui/lib/axis.jar
trunk/ws/plugins/org.jboss.tools.ws.ui/lib/jaxrpc.jar
trunk/ws/plugins/org.jboss.tools.ws.ui/src/log4j.properties
Modified:
trunk/ws/plugins/org.jboss.tools.ws.ui/.classpath
trunk/ws/plugins/org.jboss.tools.ws.ui/META-INF/MANIFEST.MF
trunk/ws/plugins/org.jboss.tools.ws.ui/build.properties
Log:
[JBIDE-6450] Delivering fix for the javax.xml.soap 1.3 issue by wrapping the jars causing the problem in the lib directory. Once the 1.3 version of the plug-in is updated in the next Eclipse release, we should be able to go back to the simpler method of just referring to the jar wrapper and get rid of the extra overhead
Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/.classpath
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/.classpath 2010-12-13 17:41:25 UTC (rev 27417)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/.classpath 2010-12-13 21:04:34 UTC (rev 27418)
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
+ <classpathentry exported="true" kind="lib" path="lib/axis.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/jaxrpc.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jaxrs-api.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/META-INF/MANIFEST.MF 2010-12-13 17:41:25 UTC (rev 27417)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/META-INF/MANIFEST.MF 2010-12-13 21:04:34 UTC (rev 27418)
@@ -23,20 +23,17 @@
org.eclipse.wst.server.core,
org.eclipse.core.filesystem,
com.ibm.icu,
- org.apache.axis,
- javax.xml.rpc,
org.eclipse.wst.internet.monitor.core,
org.eclipse.wst.internet.monitor.ui,
javax.wsdl;bundle-version="1.6.2",
org.jdom,
- javax.xml.ws,
org.eclipse.ui.forms,
org.eclipse.emf.common,
org.eclipse.jdt.ui,
org.eclipse.osgi,
org.eclipse.jst.ws.annotations.core,
org.apache.commons.codec,
- javax.xml.soap;bundle-version="[1.2.0,1.3.0)"
+ org.apache.commons.discovery;bundle-version="[0.2.0,1.0.0)"
Bundle-ActivationPolicy: lazy
Export-Package: javax.ws.rs,
javax.ws.rs.core,
@@ -50,9 +47,17 @@
Bundle-Vendor: %PLUGIN_PROVIDER
Eclipse-RegisterBuddy: org.eclipse.jst.ws.annotations.core
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Import-Package: javax.xml.ws,
+Import-Package: javax.activation,
+ javax.mail,
+ javax.mail.internet,
+ javax.servlet;version="[2.4.0,3.0.0)",
+ javax.servlet.http;version="[2.4.0,3.0.0)",
+ org.apache.commons.logging;version="[1.0.4,2.0.0)",
+ org.apache.commons.logging.impl;version="[1.0.4,2.0.0)",
org.eclipse.jst.javaee.web,
org.jboss.tools.ws.creation.core.commands,
org.jboss.tools.ws.creation.core.data
-Bundle-ClassPath: lib/jaxrs-api.jar,
- .
+Bundle-ClassPath: .,
+ lib/jaxrs-api.jar,
+ lib/axis.jar,
+ lib/jaxrpc.jar
Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/build.properties
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/build.properties 2010-12-13 17:41:25 UTC (rev 27417)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/build.properties 2010-12-13 21:04:34 UTC (rev 27418)
@@ -10,5 +10,6 @@
about.properties,\
icons/,\
jboss_about.png,\
- lib/jaxrs-api.jar
+ lib/,\
+ plugin_ja.properties
additional.bundles = javax.xml.bind
Added: trunk/ws/plugins/org.jboss.tools.ws.ui/lib/axis.jar
===================================================================
(Binary files differ)
Property changes on: trunk/ws/plugins/org.jboss.tools.ws.ui/lib/axis.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/ws/plugins/org.jboss.tools.ws.ui/lib/jaxrpc.jar
===================================================================
(Binary files differ)
Property changes on: trunk/ws/plugins/org.jboss.tools.ws.ui/lib/jaxrpc.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/ws/plugins/org.jboss.tools.ws.ui/src/log4j.properties
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/log4j.properties (rev 0)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/log4j.properties 2010-12-13 21:04:34 UTC (rev 27418)
@@ -0,0 +1,20 @@
+# Set root category priority to INFO and its only appender to CONSOLE.
+log4j.rootCategory=INFO, CONSOLE
+#log4j.rootCategory=INFO, CONSOLE, LOGFILE
+
+# Set the enterprise logger category to FATAL and its only appender to CONSOLE.
+log4j.logger.org.apache.axis.enterprise=FATAL, CONSOLE
+
+# CONSOLE is set to be a ConsoleAppender using a PatternLayout.
+log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
+log4j.appender.CONSOLE.Threshold=INFO
+log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
+log4j.appender.CONSOLE.layout.ConversionPattern=- %m%n
+
+# LOGFILE is set to be a File appender using a PatternLayout.
+log4j.appender.LOGFILE=org.apache.log4j.FileAppender
+log4j.appender.LOGFILE.File=axis.log
+log4j.appender.LOGFILE.Append=true
+log4j.appender.LOGFILE.Threshold=INFO
+log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout
+log4j.appender.LOGFILE.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
Property changes on: trunk/ws/plugins/org.jboss.tools.ws.ui/src/log4j.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
14 years
JBoss Tools SVN: r27417 - trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/wizard.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-12-13 12:41:25 -0500 (Mon, 13 Dec 2010)
New Revision: 27417
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/wizard/NewCDIWizardTest.java
Log:
JBIDE-7875
https://issues.jboss.org/browse/JBIDE-7875
Modified: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/wizard/NewCDIWizardTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/wizard/NewCDIWizardTest.java 2010-12-13 17:40:07 UTC (rev 27416)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/wizard/NewCDIWizardTest.java 2010-12-13 17:41:25 UTC (rev 27417)
@@ -36,6 +36,7 @@
import org.jboss.tools.cdi.core.ICDIProject;
import org.jboss.tools.cdi.ui.CDIUIPlugin;
//import org.jboss.tools.cdi.ui.wizard.NewCDIAnnotationWizardPage;
+import org.jboss.tools.cdi.ui.wizard.NewAnnotationLiteralWizardPage;
import org.jboss.tools.cdi.ui.wizard.NewBeansXMLCreationWizard;
import org.jboss.tools.cdi.ui.wizard.NewDecoratorWizardPage;
import org.jboss.tools.cdi.ui.wizard.NewInterceptorBindingWizardPage;
@@ -290,6 +291,31 @@
}
}
+ public void testNewAnnotationLiteralWizard() {
+ WizardContext context = new WizardContext();
+ context.init("org.jboss.tools.cdi.ui.wizard.NewAnnotationLiteralCreationWizard",
+ PACK_NAME, QUALIFIER_NAME + "Literal");JobUtils.waitForIdle(2000);
+ JobUtils.waitForIdle(2000);
+ ICDIProject cdi = CDICorePlugin.getCDIProject(context.tck, true);
+
+ try {
+ NewAnnotationLiteralWizardPage page = (NewAnnotationLiteralWizardPage)context.page;
+
+ List<String> interfacesNames = new ArrayList<String>();
+ interfacesNames.add("java.util.Map<K,V>");
+ page.setQualifier(PACK_NAME + "." + QUALIFIER_NAME);
+
+ context.wizard.performFinish();
+
+ String text = context.getNewTypeContent();
+ System.out.println(text);
+
+ assertTrue(text.contains("AnnotationLiteral<" + QUALIFIER_NAME + ">"));
+ } finally {
+ context.close();
+ }
+ }
+
public void testNewBeansXMLWizard() throws CoreException {
NewBeansXMLWizardContext context = new NewBeansXMLWizardContext();
context.init("org.jboss.tools.cdi.ui.wizard.NewBeansXMLCreationWizard");
14 years
JBoss Tools SVN: r27416 - trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-12-13 12:40:07 -0500 (Mon, 13 Dec 2010)
New Revision: 27416
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewAnnotationLiteralWizardPage.java
Log:
JBIDE-7875
https://issues.jboss.org/browse/JBIDE-7875
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewAnnotationLiteralWizardPage.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewAnnotationLiteralWizardPage.java 2010-12-13 17:29:22 UTC (rev 27415)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewAnnotationLiteralWizardPage.java 2010-12-13 17:40:07 UTC (rev 27416)
@@ -118,7 +118,7 @@
interfacesNames.add(name);
setSuperInterfaces(interfacesNames, true);
superInterfacesChanged();
- setSuperClass("javax.enterprise.util.AnnotationLiteral<" + type.getElementName() + ">", false);
+ setSuperClass(CDIConstants.ANNOTATION_LITERAL_TYPE_NAME + "<" + type.getElementName() + ">", false);
setDefaultTypeName(name);
}
}
@@ -228,7 +228,7 @@
interfacesNames.add(name);
setSuperInterfaces(interfacesNames, true);
superInterfacesChanged();
- setSuperClass("javax.enterprise.util.AnnotationLiteral<" + selected.getSourceType().getElementName() + ">", false);
+ setSuperClass(CDIConstants.ANNOTATION_LITERAL_TYPE_NAME + "<" + selected.getSourceType().getElementName() + ">", false);
setDefaultTypeName(name);
done = true;
}
@@ -265,7 +265,7 @@
IProgressMonitor monitor, String lineDelimiter)
throws CoreException {
- imports.addImport("javax.enterprise.util.AnnotationLiteral");
+ imports.addImport(CDIConstants.ANNOTATION_LITERAL_TYPE_NAME);
IType fieldType = fieldType = selected.getSourceType();
@@ -396,4 +396,8 @@
return null;
}
+ public void setQualifier(String type) {
+ qualifiers.setValue(type);
+ }
+
}
\ No newline at end of file
14 years
JBoss Tools SVN: r27415 - trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-12-13 12:29:22 -0500 (Mon, 13 Dec 2010)
New Revision: 27415
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIConstants.java
Log:
JBIDE-7875
https://issues.jboss.org/browse/JBIDE-7875
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIConstants.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIConstants.java 2010-12-13 17:25:36 UTC (rev 27414)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIConstants.java 2010-12-13 17:29:22 UTC (rev 27415)
@@ -82,4 +82,7 @@
public String POST_CONSTRUCTOR_TYPE_NAME = "javax.annotation.PostConstruct";
public String EVENT_TYPE_NAME = "javax.enterprise.event.Event";
+
+ public String ANNOTATION_LITERAL_TYPE_NAME = "javax.enterprise.util.AnnotationLiteral";
+
}
\ No newline at end of file
14 years
JBoss Tools SVN: r27414 - in trunk/cdi/plugins/org.jboss.tools.cdi.ui: src/org/jboss/tools/cdi/ui and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-12-13 12:25:36 -0500 (Mon, 13 Dec 2010)
New Revision: 27414
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewAnnotationLiteralCreationWizard.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewAnnotationLiteralWizardPage.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/QualifierSelectionProvider.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.xml
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.properties
Log:
JBIDE-7875
https://issues.jboss.org/browse/JBIDE-7875
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.xml
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.xml 2010-12-13 16:43:24 UTC (rev 27413)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.xml 2010-12-13 17:25:36 UTC (rev 27414)
@@ -221,6 +221,21 @@
</keywordReference>
</wizard>
+ <wizard
+ category="org.jboss.tools.cdi.ui"
+ class="org.jboss.tools.cdi.ui.wizard.NewAnnotationLiteralCreationWizard"
+ icon="icons/cdi16.png"
+ id="org.jboss.tools.cdi.ui.wizard.NewAnnotationLiteralCreationWizard"
+ name="Annotation Literal Type"
+ project="false">
+ <description>
+ Create an Annotation Literal Java File
+ </description>
+ <keywordReference
+ id="org.jboss.tools.cdi.ui.newJava">
+ </keywordReference>
+ </wizard>
+
<wizard
name="%NewWizards.file"
icon="icons/cdi16.png"
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.java 2010-12-13 16:43:24 UTC (rev 27413)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.java 2010-12-13 17:25:36 UTC (rev 27414)
@@ -49,14 +49,20 @@
public static String NEW_BEANS_XML_WIZARD_TITLE;
public static String NEW_BEANS_XML_WIZARD_PAGE_NAME;
public static String NEW_BEANS_XML_WIZARD_DESCRIPTION;
-
+
+ public static String NEW_ANNOTATION_LITERAL_WIZARD_TITLE;
+ public static String NEW_ANNOTATION_LITERAL_WIZARD_PAGE_NAME;
+ public static String NEW_ANNOTATION_LITERAL_WIZARD_DESCRIPTION;
+
public static String SELECT_STEREOTYPE;
public static String SELECT_INTERCEPTOR_BINDING;
+ public static String SELECT_QUALIFIER;
public static String FIELD_EDITOR_SCOPE_LABEL;
public static String FIELD_EDITOR_TARGET_LABEL;
public static String FIELD_EDITOR_INTERCEPTOR_BINDINGS_LABEL;
public static String FIELD_EDITOR_STEREOTYPES_LABEL;
+ public static String FIELD_EDITOR_QUALIFIER_LABEL;
public static String MESSAGE_METHOD_NAME_EMPTY;
public static String MESSAGE_METHOD_NAME_NOT_VALID;
@@ -66,6 +72,8 @@
public static String MESSAGE_INTERCEPTOR_BINDINGS_EMPTY;
+ public static String MESSAGE_QUALIFIER_NOT_SET;
+
public static String MAKE_FIELD_STATIC_MARKER_RESOLUTION_TITLE;
public static String MAKE_METHOD_PUBLIC_MARKER_RESOLUTION_TITLE;
public static String MAKE_METHOD_BUSINESS_MARKER_RESOLUTION_TITLE;
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.properties
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.properties 2010-12-13 16:43:24 UTC (rev 27413)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.properties 2010-12-13 17:25:36 UTC (rev 27414)
@@ -34,13 +34,19 @@
NEW_DECORATOR_WIZARD_PAGE_NAME=Decorator Type
NEW_DECORATOR_WIZARD_DESCRIPTION=Create a new Decorator Java class
+NEW_ANNOTATION_LITERAL_WIZARD_TITLE=New Annotation Literal
+NEW_ANNOTATION_LITERAL_WIZARD_PAGE_NAME=Annotation Literal Type
+NEW_ANNOTATION_LITERAL_WIZARD_DESCRIPTION=Create a new Annotation Literal Java class
+
SELECT_STEREOTYPE=Select Stereotype Annotation Type
SELECT_INTERCEPTOR_BINDING=Select Interceptor Binding Annotation Type
+SELECT_QUALIFIER=Select Qualifier Annotation Type
FIELD_EDITOR_SCOPE_LABEL=Scope:
FIELD_EDITOR_TARGET_LABEL=Target:
FIELD_EDITOR_INTERCEPTOR_BINDINGS_LABEL=Interceptor Bindings:
FIELD_EDITOR_STEREOTYPES_LABEL=Stereotypes:
+FIELD_EDITOR_QUALIFIER_LABEL=Qualifier:
MESSAGE_METHOD_NAME_EMPTY=Method Name is empty.
MESSAGE_METHOD_NAME_NOT_VALID=Method Name is not valid. {0}
@@ -50,6 +56,8 @@
MESSAGE_INTERCEPTOR_BINDINGS_EMPTY=Interceptor Bindings list is empty
+MESSAGE_QUALIFIER_NOT_SET=Qualifier is not set
+
MAKE_FIELD_STATIC_MARKER_RESOLUTION_TITLE=Make ''{0}'' field static
MAKE_METHOD_PUBLIC_MARKER_RESOLUTION_TITLE=Make ''{0}'' method public
MAKE_METHOD_BUSINESS_MARKER_RESOLUTION_TITLE=Add ''{0}'' method to ''{1}'' interface
Added: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewAnnotationLiteralCreationWizard.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewAnnotationLiteralCreationWizard.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewAnnotationLiteralCreationWizard.java 2010-12-13 17:25:36 UTC (rev 27414)
@@ -0,0 +1,89 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.cdi.ui.wizard;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.internal.ui.wizards.NewElementWizard;
+import org.eclipse.jdt.ui.wizards.NewClassWizardPage;
+import org.jboss.tools.cdi.ui.CDIUIMessages;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class NewAnnotationLiteralCreationWizard extends NewElementWizard {
+ private NewClassWizardPage fPage;
+ private boolean fOpenEditorOnFinish = true;
+
+
+ public NewAnnotationLiteralCreationWizard() {
+ setWindowTitle(CDIUIMessages.NEW_ANNOTATION_LITERAL_WIZARD_TITLE);
+ }
+
+ /*
+ * @see Wizard#createPages
+ */
+ public void addPages() {
+ super.addPages();
+ if (fPage == null) {
+ fPage = new NewAnnotationLiteralWizardPage();
+ fPage.init(getSelection());
+ }
+ addPage(fPage);
+ }
+
+ /*(non-Javadoc)
+ * @see org.eclipse.jdt.internal.ui.wizards.NewElementWizard#canRunForked()
+ */
+ protected boolean canRunForked() {
+ return !fPage.isEnclosingTypeSelected();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jdt.internal.ui.wizards.NewElementWizard#finishPage(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ protected void finishPage(IProgressMonitor monitor) throws InterruptedException, CoreException {
+ fPage.createType(monitor); // use the full progress monitor
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.wizard.IWizard#performFinish()
+ */
+ public boolean performFinish() {
+ warnAboutTypeCommentDeprecation();
+ boolean res= super.performFinish();
+ if (res) {
+ IResource resource= fPage.getModifiedResource();
+ if (resource != null) {
+ selectAndReveal(resource);
+ if (fOpenEditorOnFinish) {
+ openResource((IFile) resource);
+ }
+ }
+ }
+ return res;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jdt.internal.ui.wizards.NewElementWizard#getCreatedElement()
+ */
+ public IJavaElement getCreatedElement() {
+ return fPage.getCreatedType();
+ }
+
+
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewAnnotationLiteralCreationWizard.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewAnnotationLiteralWizardPage.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewAnnotationLiteralWizardPage.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewAnnotationLiteralWizardPage.java 2010-12-13 17:25:36 UTC (rev 27414)
@@ -0,0 +1,399 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.cdi.ui.wizard;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.jdt.core.IBuffer;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IField;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IPackageFragmentRoot;
+import org.eclipse.jdt.core.ISourceRange;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.formatter.CodeFormatter;
+import org.eclipse.jdt.internal.corext.codemanipulation.CodeGenerationSettings;
+import org.eclipse.jdt.internal.corext.codemanipulation.StubUtility;
+import org.eclipse.jdt.internal.corext.util.JavaConventionsUtil;
+import org.eclipse.jdt.internal.corext.util.JavaModelUtil;
+import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
+import org.eclipse.jdt.internal.ui.dialogs.StatusInfo;
+import org.eclipse.jdt.internal.ui.dialogs.StatusUtil;
+import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings;
+import org.eclipse.jdt.ui.CodeGeneration;
+import org.eclipse.jdt.ui.wizards.NewClassWizardPage;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.FilteredItemsSelectionDialog;
+import org.jboss.tools.cdi.core.CDIConstants;
+import org.jboss.tools.cdi.core.CDICorePlugin;
+import org.jboss.tools.cdi.core.ICDIAnnotation;
+import org.jboss.tools.cdi.core.ICDIProject;
+import org.jboss.tools.cdi.core.IQualifier;
+import org.jboss.tools.cdi.ui.CDIUIMessages;
+import org.jboss.tools.common.java.generation.JavaBeanGenerator;
+import org.jboss.tools.common.ui.widget.editor.ButtonFieldEditor;
+import org.jboss.tools.common.ui.widget.editor.ButtonFieldEditor.ButtonPressedAction;
+import org.jboss.tools.common.ui.widget.editor.CompositeEditor;
+import org.jboss.tools.common.ui.widget.editor.IFieldEditor;
+import org.jboss.tools.common.ui.widget.editor.LabelFieldEditor;
+import org.jboss.tools.common.ui.widget.editor.TextFieldEditor;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class NewAnnotationLiteralWizardPage extends NewClassWizardPage {
+ protected QualifierSelectionProvider qualifiersProvider = new QualifierSelectionProvider();
+ CompositeEditor qualifiers = null;
+
+ protected StatusInfo qualifierStatus = new StatusInfo();
+
+ public NewAnnotationLiteralWizardPage() {
+ setTitle(CDIUIMessages.NEW_ANNOTATION_LITERAL_WIZARD_PAGE_NAME);
+ setDescription(CDIUIMessages.NEW_ANNOTATION_LITERAL_WIZARD_DESCRIPTION);
+ }
+
+ public void init(IStructuredSelection selection) {
+ super.init(selection);
+ if (!selection.isEmpty()) {
+ Object o = selection.iterator().next();
+ IType type = null;
+ if (o instanceof IType) {
+ type = (IType) o;
+ } else if (o instanceof ICompilationUnit) {
+ ICompilationUnit cu = (ICompilationUnit) o;
+ try {
+ IType[] ts = cu.getTypes();
+ if (ts != null && ts.length > 0)
+ type = ts[0];
+ } catch (JavaModelException e) {
+ CDICorePlugin.getDefault().logError(e);
+ }
+
+ }
+ boolean isInterface = false;
+ try {
+ isInterface = type != null && type.isInterface();
+ } catch (JavaModelException e) {
+ CDICorePlugin.getDefault().logError(e);
+ }
+ if (isInterface) {
+ String name = "";
+ try {
+ name = type.getFullyQualifiedParameterizedName();
+ } catch (JavaModelException e) {
+ name = type.getFullyQualifiedName();
+ }
+ IPackageFragmentRoot r = getPackageFragmentRoot();
+ if(r != null) {
+ ICDIProject cdi = NewCDIAnnotationWizardPage.getCDIProject(r.getJavaProject());
+ IQualifier q = cdi != null ? cdi.getQualifier(name) : null;
+ if(q != null) {
+ selected = q;
+ ArrayList<String> interfacesNames = new ArrayList<String>();
+ interfacesNames.add(name);
+ setSuperInterfaces(interfacesNames, true);
+ superInterfacesChanged();
+ setSuperClass("javax.enterprise.util.AnnotationLiteral<" + type.getElementName() + ">", false);
+ setDefaultTypeName(name);
+ }
+ }
+ }
+ }
+
+ doStatusUpdate();
+ }
+
+ void setDefaultTypeName(String interfaceName) {
+ int d = interfaceName.lastIndexOf('.');
+ int b = interfaceName.indexOf('<');
+ if (b < 0)
+ b = interfaceName.length();
+ String elementName = interfaceName.substring(d + 1, b);
+ String typeName = elementName + "Literal";
+ typeName += interfaceName.substring(b);
+ setTypeName(typeName, true);
+ typeNameChanged();
+ }
+
+ public void createControl(Composite parent) {
+ initializeDialogUnits(parent);
+
+ Composite composite = new Composite(parent, SWT.NONE);
+ composite.setFont(parent.getFont());
+
+ int nColumns = 4;
+
+ GridLayout layout = new GridLayout();
+ layout.numColumns = nColumns;
+ composite.setLayout(layout);
+
+ // pick & choose the wanted UI components
+
+ createContainerControls(composite, nColumns);
+ createPackageControls(composite, nColumns);
+ // createEnclosingTypeControls(composite, nColumns);
+
+ createSeparator(composite, nColumns);
+
+ createTypeNameControls(composite, nColumns);
+ createModifierControls(composite, nColumns);
+
+ // createSuperClassControls(composite, nColumns);
+// createSuperInterfacesControls(composite, nColumns);
+
+ // createMethodStubSelectionControls(composite, nColumns);
+
+ createCustomFields(composite);
+
+ createCommentControls(composite, nColumns);
+ enableCommentControl(true);
+
+ setControl(composite);
+
+ Dialog.applyDialogFont(composite);
+ PlatformUI.getWorkbench().getHelpSystem()
+ .setHelp(composite, IJavaHelpContextIds.NEW_CLASS_WIZARD_PAGE);
+
+ onQualifiersChange();
+ doStatusUpdate();
+ }
+
+ protected void createTypeMembers(IType newType,
+ final ImportsManager imports, IProgressMonitor monitor)
+ throws CoreException {
+ createInheritedMethods(newType, true, true, imports,
+ new SubProgressMonitor(monitor, 1));
+
+ ISourceRange range = newType.getSourceRange();
+ IBuffer buf = newType.getCompilationUnit().getBuffer();
+ String lineDelimiter = StubUtility.getLineDelimiterUsed(newType
+ .getJavaProject());
+ StringBuffer sb = new StringBuffer();
+ buf.replace(range.getOffset(), 0, sb.toString());
+ createInstanceField(newType, imports, monitor, lineDelimiter);
+ }
+
+ protected void createCustomFields(Composite composite) {
+ createQualifierField(composite);
+ }
+
+ protected void createQualifierField(Composite composite) {
+ qualifiers = (CompositeEditor)createQualifierCompositeEditor("qualifiers", CDIUIMessages.FIELD_EDITOR_QUALIFIER_LABEL, "");
+// qualifiers.setProvider(qualifiersProvider);
+// qualifiersProvider.setEditorField(qualifiers);
+ qualifiers.doFillIntoGrid(composite);
+ setQualifiers(getPackageFragmentRoot());
+ qualifiers.addPropertyChangeListener(new PropertyChangeListener() {
+ public void propertyChange(PropertyChangeEvent evt) {
+ Object o = evt.getNewValue();
+ validateQualifierSelection(o);
+ }});
+ }
+
+ void validateQualifierSelection(Object value) {
+ boolean done = false;
+ if(value != null) {
+ String name = value.toString();
+ IPackageFragmentRoot r = getPackageFragmentRoot();
+ if(r != null) {
+ ICDIProject cdi = NewCDIAnnotationWizardPage.getCDIProject(r.getJavaProject());
+ selected = cdi != null ? cdi.getQualifier(name) : null;
+ if(selected != null) {
+ ArrayList<String> interfacesNames = new ArrayList<String>();
+ interfacesNames.add(name);
+ setSuperInterfaces(interfacesNames, true);
+ superInterfacesChanged();
+ setSuperClass("javax.enterprise.util.AnnotationLiteral<" + selected.getSourceType().getElementName() + ">", false);
+ setDefaultTypeName(name);
+ done = true;
+ }
+ }
+ }
+ if(!done) {
+ selected = null;
+ setSuperInterfaces(new ArrayList<String>(), true);
+ superInterfacesChanged();
+ }
+
+ }
+
+ public void setPackageFragmentRoot(IPackageFragmentRoot root, boolean canBeModified) {
+ super.setPackageFragmentRoot(root, canBeModified);
+ setQualifiers(root);
+ if(qualifiers != null) {
+ validateQualifierSelection(qualifiers.getValue());
+ }
+ }
+
+ void setQualifiers(IPackageFragmentRoot root) {
+ qualifiersProvider.setProject(null);
+ if(root != null) {
+ IJavaProject jp = root.getJavaProject();
+ ICDIProject cdi = NewCDIAnnotationWizardPage.getCDIProject(jp);
+ if(cdi != null) {
+ qualifiersProvider.setProject(cdi);
+ }
+ }
+ }
+
+ protected IField createInstanceField(IType type, ImportsManager imports,
+ IProgressMonitor monitor, String lineDelimiter)
+ throws CoreException {
+
+ imports.addImport("javax.enterprise.util.AnnotationLiteral");
+
+ IType fieldType = fieldType = selected.getSourceType();
+
+ imports.addImport(fieldType.getFullyQualifiedName());
+
+ ICompilationUnit cu = type.getCompilationUnit();
+ JavaModelUtil.reconcile(cu);
+ CodeGenerationSettings settings = JavaPreferencesSettings
+ .getCodeGenerationSettings(type.getJavaProject());
+ settings.createComments = isAddComments();
+ String access = "public static final ";
+
+ String fieldHeader = access + " " + fieldType.getElementName() + " " + "INSTANCE" +
+ "= new " + type.getElementName() + "()" + ";" + lineDelimiter; //$NON-NLS-1$ //$NON-NLS-2$
+ IJavaElement[] cs = type.getChildren();
+ IJavaElement sibling = cs == null || cs.length == 0 ? null : cs[0];
+ IField m = type.createField(fieldHeader, sibling, true, null);
+
+ editField(cu, m, fieldType.getElementName(), fieldHeader, lineDelimiter);
+ return m;
+ }
+
+ void editField(ICompilationUnit cu, IField m, String javatype, String fieldHeader,
+ String lineDelimiter) throws CoreException {
+ synchronized (cu) {
+ cu.reconcile(ICompilationUnit.NO_AST, true, null, null);
+ }
+ ISourceRange range = m.getSourceRange();
+ IBuffer buf = cu.getBuffer();
+ StringBuffer sb = new StringBuffer(lineDelimiter);
+ if (isAddComments()) {
+ String fieldComment = CodeGeneration.getFieldComment(cu,
+ javatype, m.getElementName(), lineDelimiter);
+ sb.append(fieldComment).append(lineDelimiter);
+ }
+ sb.append(fieldHeader);
+ String formattedContent = JavaBeanGenerator.codeFormat2(
+ CodeFormatter.K_CLASS_BODY_DECLARATIONS, sb.toString(), 1,
+ lineDelimiter, cu.getJavaProject());
+ if (formattedContent != null && formattedContent.startsWith("\t")) { //$NON-NLS-1$
+ formattedContent = formattedContent.substring(1);
+ }
+ buf.replace(range.getOffset(), range.getLength(), formattedContent);
+ }
+
+ protected IStatus superInterfacesChanged() {
+ List list = getSuperInterfaces();
+ if(list != null && !list.isEmpty()) {
+ setDefaultTypeName(list.get(0).toString());
+ }
+ StatusInfo result = (StatusInfo) super.superInterfacesChanged();
+ if (!result.isError()) {
+ if (list == null || list.isEmpty()) {
+ result.setError("Please select qualifier.");
+ }
+ }
+ return result;
+ }
+
+ private void doStatusUpdate() {
+ // status of all used components
+ IStatus[] status = new IStatus[] {
+ fContainerStatus,
+ isEnclosingTypeSelected() ? fEnclosingTypeStatus
+ : fPackageStatus, fTypeNameStatus, fModifierStatus,
+ fSuperClassStatus, fSuperInterfacesStatus };
+
+ // the mode severe status will be displayed and the OK button
+ // enabled/disabled.
+ updateStatus(status);
+ }
+
+ protected void updateStatus(IStatus[] status) {
+// IStatus[] ns = new IStatus[status.length + 1];
+// System.arraycopy(status, 0, ns, 0, status.length);
+// ns[status.length] = qualifierStatus;
+// status = ns;
+ updateStatus(StatusUtil.getMostSevere(status));
+ }
+
+ void onQualifiersChange() {
+// qualifierStatus = new StatusInfo();
+// if(((List)qualifiers.getValue()).isEmpty()) {
+// qualifierStatus.setWarning(CDIUIMessages.MESSAGE_QUALIFIER_NOT_SET);
+// }
+ }
+
+ public IFieldEditor createQualifierCompositeEditor(String name, String label, String defaultValue) {
+ if(selected != null) {
+ defaultValue = selected.getSourceType().getFullyQualifiedName();
+ }
+ CompositeEditor editor = new CompositeEditor(name, label, defaultValue);
+ editor.addFieldEditors(new IFieldEditor[]{new LabelFieldEditor(name,label),
+ new TextFieldEditor(name,label, defaultValue),
+ new ButtonFieldEditor(name,createSelectAction(), "")});
+ return editor;
+ }
+
+ ButtonPressedAction createSelectAction() {
+ return new ButtonPressedAction("Browse") {
+ public void run() {
+ selected = (ICDIAnnotation)runAddAction();
+ if(selected != null) {
+ qualifiers.setValue(selected.getSourceType().getFullyQualifiedName());
+ }
+ }
+ };
+ }
+
+ ICDIAnnotation selected = null;
+
+ protected Object runAddAction() {
+ if(qualifiersProvider != null) {
+ FilteredItemsSelectionDialog dialog = qualifiersProvider.createSelectionDialog();
+ int result = dialog.open();
+ if(result == FilteredItemsSelectionDialog.OK) {
+ Object[] os = dialog.getResult();
+ if(os != null) {
+ for (Object o: os) {
+ Object v = qualifiersProvider.getSelected(o);
+ if(v != null) {
+ return v;
+ }
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewAnnotationLiteralWizardPage.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/QualifierSelectionProvider.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/QualifierSelectionProvider.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/QualifierSelectionProvider.java 2010-12-13 17:25:36 UTC (rev 27414)
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.cdi.ui.wizard;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jdt.core.Flags;
+import org.eclipse.jdt.core.IPackageFragment;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
+import org.jboss.tools.cdi.core.CDICorePlugin;
+import org.jboss.tools.cdi.core.ICDIAnnotation;
+import org.jboss.tools.cdi.core.IInterceptorBinding;
+import org.jboss.tools.cdi.core.IQualifier;
+import org.jboss.tools.cdi.ui.CDIUIMessages;
+
+public class QualifierSelectionProvider extends CDIAnnotationSelectionProvider {
+
+ public QualifierSelectionProvider() {}
+
+ public ICDIAnnotation[] getSelectableObjects() {
+ if(project == null) return new ICDIAnnotation[0];
+ List<ICDIAnnotation> as = new ArrayList<ICDIAnnotation>();
+ IQualifier[] ss = project.getQualifiers();
+ List c = editor == null ? null : (List)editor.getValue();
+ for (IQualifier s: ss) {
+ if(c != null && c.contains(s)) continue;
+ as.add(s);
+ }
+ return as.toArray(new ICDIAnnotation[0]);
+ }
+
+ @Override
+ protected String getDialogTitle() {
+ return CDIUIMessages.SELECT_QUALIFIER;
+ }
+
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/QualifierSelectionProvider.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
14 years
JBoss Tools SVN: r27413 - in trunk/jst/plugins/org.jboss.tools.jst.css/src/org/jboss/tools/jst/css: view and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2010-12-13 11:43:24 -0500 (Mon, 13 Dec 2010)
New Revision: 27413
Added:
trunk/jst/plugins/org.jboss.tools.jst.css/src/org/jboss/tools/jst/css/browser/CSSBrowserEmptyImplementation.java
trunk/jst/plugins/org.jboss.tools.jst.css/src/org/jboss/tools/jst/css/browser/CSSBrowserInterface.java
trunk/jst/plugins/org.jboss.tools.jst.css/src/org/jboss/tools/jst/css/browser/CSSBrowserMozillaImplementation.java
Modified:
trunk/jst/plugins/org.jboss.tools.jst.css/src/org/jboss/tools/jst/css/browser/CSSBrowser.java
trunk/jst/plugins/org.jboss.tools.jst.css/src/org/jboss/tools/jst/css/view/CSSPreview.java
Log:
https://issues.jboss.org/browse/JBIDE-7741
Modified: trunk/jst/plugins/org.jboss.tools.jst.css/src/org/jboss/tools/jst/css/browser/CSSBrowser.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.css/src/org/jboss/tools/jst/css/browser/CSSBrowser.java 2010-12-13 15:43:46 UTC (rev 27412)
+++ trunk/jst/plugins/org.jboss.tools.jst.css/src/org/jboss/tools/jst/css/browser/CSSBrowser.java 2010-12-13 16:43:24 UTC (rev 27413)
@@ -15,22 +15,22 @@
import org.eclipse.swt.SWTError;
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.TypedEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
import org.jboss.tools.jst.css.CSSPlugin;
/**
* @author mareshkau
*
*/
-public class CSSBrowser extends Composite {
+public class CSSBrowser extends Composite implements CSSBrowserInterface {
- private Browser browser;
+ private CSSBrowserInterface browser;
- public Browser getBrowser() {
- return browser;
- }
/**
* If in system not installed xulrunner, than
* browser will be null
@@ -57,15 +57,20 @@
browser.setLayoutData(gridData);
browser.pack();
} catch(SWTError er){
- CSSPlugin.getDefault().logError(er);
+ CSSPlugin.getDefault().logWarning("Xulrunner implementation hasn't been founded, so browser based preview " +
+ "will be not available");
}
- cssBrowser.setBrowser(browser);
+ if(browser!=null) {
+ cssBrowser.setBrowser(new CSSBrowserMozillaImplementation(browser));
+ } else {
+ Label label = new Label(cssBrowser,SWT.CENTER);
+ label.setText("Browser based preview not availabe,"+System.getProperty("line.separator")+" see log for more details");
+ label.setBounds(cssBrowser.getClientArea());
+ cssBrowser.setBrowser(new CSSBrowserEmptyImplementation());
+ }
return cssBrowser;
}
- public void setBrowser(Browser browser) {
- this.browser = browser;
- }
public void setLayoutData(GridData layoutData) {
super.setLayoutData(layoutData);
}
@@ -81,4 +86,13 @@
public void addMouseListener(MouseAdapter mouseAdapter) {
getBrowser().addMouseListener(mouseAdapter);
}
+ public boolean isBrowserEvent(TypedEvent e){
+ return getBrowser().isBrowserEvent(e);
+ }
+ private CSSBrowserInterface getBrowser() {
+ return this.browser;
+ }
+ private void setBrowser(CSSBrowserInterface browser) {
+ this.browser = browser;
+ }
}
Added: trunk/jst/plugins/org.jboss.tools.jst.css/src/org/jboss/tools/jst/css/browser/CSSBrowserEmptyImplementation.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.css/src/org/jboss/tools/jst/css/browser/CSSBrowserEmptyImplementation.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.css/src/org/jboss/tools/jst/css/browser/CSSBrowserEmptyImplementation.java 2010-12-13 16:43:24 UTC (rev 27413)
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.css.browser;
+
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.TypedEvent;
+
+/**
+ * @author mareshkau
+ *
+ */
+public class CSSBrowserEmptyImplementation implements CSSBrowserInterface {
+
+ public boolean setFocus() {
+ return false;
+ }
+ public void setText(String generateBrowserPage) {
+ }
+ public void setEnabled(boolean isEnabled) {
+ }
+ public void addMouseListener(MouseAdapter mouseAdapter) {
+ }
+ public boolean isBrowserEvent(TypedEvent e){
+ return false;
+ }
+}
Added: trunk/jst/plugins/org.jboss.tools.jst.css/src/org/jboss/tools/jst/css/browser/CSSBrowserInterface.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.css/src/org/jboss/tools/jst/css/browser/CSSBrowserInterface.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.css/src/org/jboss/tools/jst/css/browser/CSSBrowserInterface.java 2010-12-13 16:43:24 UTC (rev 27413)
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.css.browser;
+
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.TypedEvent;
+
+/**
+ * @author mareshkau
+ *
+ */
+public interface CSSBrowserInterface {
+
+ public boolean setFocus();
+ public void setText(String generateBrowserPage);
+ public void setEnabled(boolean isEnabled);
+ public void addMouseListener(MouseAdapter mouseAdapter);
+ public boolean isBrowserEvent(TypedEvent e);
+
+}
Added: trunk/jst/plugins/org.jboss.tools.jst.css/src/org/jboss/tools/jst/css/browser/CSSBrowserMozillaImplementation.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.css/src/org/jboss/tools/jst/css/browser/CSSBrowserMozillaImplementation.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.css/src/org/jboss/tools/jst/css/browser/CSSBrowserMozillaImplementation.java 2010-12-13 16:43:24 UTC (rev 27413)
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.css.browser;
+
+import org.eclipse.swt.browser.Browser;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.TypedEvent;
+
+/**
+ * @author mareshkau
+ *
+ */
+class CSSBrowserMozillaImplementation implements CSSBrowserInterface {
+ final private Browser browser;
+
+ public CSSBrowserMozillaImplementation(Browser browser) {
+ super();
+ this.browser = browser;
+ }
+ public boolean setFocus() {
+ return getBrowser().setFocus();
+ }
+ public void setText(String generateBrowserPage) {
+ getBrowser().setText(generateBrowserPage);
+ }
+ public void setEnabled(boolean isEnabled) {
+ getBrowser().setEnabled(isEnabled);
+ }
+ public void addMouseListener(MouseAdapter mouseAdapter) {
+ getBrowser().addMouseListener(mouseAdapter);
+ }
+ public boolean isBrowserEvent(TypedEvent e){
+ return e.widget==getBrowser();
+ }
+
+ private Browser getBrowser() {
+ return this.browser;
+ }
+
+}
Modified: trunk/jst/plugins/org.jboss.tools.jst.css/src/org/jboss/tools/jst/css/view/CSSPreview.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.css/src/org/jboss/tools/jst/css/view/CSSPreview.java 2010-12-13 15:43:46 UTC (rev 27412)
+++ trunk/jst/plugins/org.jboss.tools.jst.css/src/org/jboss/tools/jst/css/view/CSSPreview.java 2010-12-13 16:43:24 UTC (rev 27413)
@@ -87,7 +87,7 @@
browser.setLayoutData(gridData);
browser.addMouseListener(new MouseAdapter() {
public void mouseDoubleClick(MouseEvent e) {
- if (e.widget == browser.getBrowser()) {
+ if (browser.isBrowserEvent(e)) {
browser.setEnabled(false);
previewComposite.setMaximizedControl(previewText);
previewText.setFocus();
14 years
JBoss Tools SVN: r27412 - trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2010-12-13 10:43:46 -0500 (Mon, 13 Dec 2010)
New Revision: 27412
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java
Log:
https://issues.jboss.org/browse/JBIDE-7672
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java 2010-12-13 14:21:27 UTC (rev 27411)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java 2010-12-13 15:43:46 UTC (rev 27412)
@@ -80,7 +80,7 @@
IMethod method = findMethod(file, start);
if(method != null){
List<IType> types = findLocalAnnotattedInterfaces(method);
- if(types.size() == 0 && !isMethodPublic(method)){
+ if(types.size() == 0 && !Flags.isPublic(method.getFlags())){
return new IMarkerResolution[] {
new MakeMethodPublicMarkerResolution(method, file)
};
@@ -165,12 +165,6 @@
return null;
}
- private boolean isMethodPublic(IMethod method) throws JavaModelException{
- if(Flags.isPublic(method.getFlags()))
- return true;
- return false;
- }
-
public boolean hasResolutions(IMarker marker) {
try {
if (findResolutions(marker).length != 0)
14 years
JBoss Tools SVN: r27411 - trunk/jst/plugins/org.jboss.tools.jst.css/src/org/jboss/tools/jst/css/dialog.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2010-12-13 09:21:27 -0500 (Mon, 13 Dec 2010)
New Revision: 27411
Modified:
trunk/jst/plugins/org.jboss.tools.jst.css/src/org/jboss/tools/jst/css/dialog/AbstractCSSDialog.java
Log:
https://issues.jboss.org/browse/JBIDE-7741
Modified: trunk/jst/plugins/org.jboss.tools.jst.css/src/org/jboss/tools/jst/css/dialog/AbstractCSSDialog.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.css/src/org/jboss/tools/jst/css/dialog/AbstractCSSDialog.java 2010-12-13 14:00:33 UTC (rev 27410)
+++ trunk/jst/plugins/org.jboss.tools.jst.css/src/org/jboss/tools/jst/css/dialog/AbstractCSSDialog.java 2010-12-13 14:21:27 UTC (rev 27411)
@@ -23,7 +23,6 @@
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.TitleAreaDialog;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.custom.SashForm;
import org.eclipse.swt.events.FocusAdapter;
import org.eclipse.swt.events.FocusEvent;
@@ -37,6 +36,7 @@
import org.eclipse.swt.widgets.Text;
import org.jboss.tools.common.model.ui.ModelUIImages;
import org.jboss.tools.common.model.ui.widgets.Split;
+import org.jboss.tools.jst.css.browser.CSSBrowser;
import org.jboss.tools.jst.css.dialog.common.StyleAttributes;
import org.jboss.tools.jst.jsp.messages.JstUIMessages;
import org.jboss.tools.jst.jsp.util.Constants;
@@ -47,7 +47,7 @@
*/
public abstract class AbstractCSSDialog extends TitleAreaDialog {
- private Browser browser;
+ private CSSBrowser browser;
private Text previewText;
@@ -162,7 +162,7 @@
true);
previewComposite.setLayoutData(gridData);
- browser = new Browser(previewComposite, SWT.BORDER | SWT.MOZILLA);
+ browser = CSSBrowser.createCSSBrowser(previewComposite, SWT.BORDER | SWT.MOZILLA);
browser.setText(generateBrowserPage());
browser.setLayoutData(gridData);
browser.addMouseListener(new MouseAdapter() {
@@ -255,10 +255,6 @@
return super.close();
}
- public Browser getBrowser() {
- return browser;
- }
-
public StyleAttributes getStyleAttributes() {
return styleAttributes;
}
14 years
JBoss Tools SVN: r27410 - in trunk/jst/plugins/org.jboss.tools.jst.css/src/org/jboss/tools/jst/css: browser and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2010-12-13 09:00:33 -0500 (Mon, 13 Dec 2010)
New Revision: 27410
Added:
trunk/jst/plugins/org.jboss.tools.jst.css/src/org/jboss/tools/jst/css/browser/
trunk/jst/plugins/org.jboss.tools.jst.css/src/org/jboss/tools/jst/css/browser/CSSBrowser.java
Modified:
trunk/jst/plugins/org.jboss.tools.jst.css/src/org/jboss/tools/jst/css/view/CSSPreview.java
Log:
https://issues.jboss.org/browse/JBIDE-7741
Added: trunk/jst/plugins/org.jboss.tools.jst.css/src/org/jboss/tools/jst/css/browser/CSSBrowser.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.css/src/org/jboss/tools/jst/css/browser/CSSBrowser.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.css/src/org/jboss/tools/jst/css/browser/CSSBrowser.java 2010-12-13 14:00:33 UTC (rev 27410)
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.css.browser;
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTError;
+import org.eclipse.swt.browser.Browser;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.jboss.tools.jst.css.CSSPlugin;
+
+/**
+ * @author mareshkau
+ *
+ */
+public class CSSBrowser extends Composite {
+
+ private Browser browser;
+
+ public Browser getBrowser() {
+ return browser;
+ }
+ /**
+ * If in system not installed xulrunner, than
+ * browser will be null
+ * @param browser, can be a null
+ */
+ private CSSBrowser(Composite parent, int style) {
+ super(parent, style);
+ }
+ /**
+ * Factory method which creates browser instance
+ * @return
+ */
+ public static CSSBrowser createCSSBrowser(Composite parent, int style){
+ CSSBrowser cssBrowser = new CSSBrowser(parent,style);
+ cssBrowser.setLayout(new GridLayout());
+ Browser browser=null;
+ try {
+ browser = new Browser(cssBrowser, SWT.BORDER | SWT.MOZILLA);
+ GridData gridData = new GridData();
+ gridData.horizontalAlignment = SWT.FILL;
+ gridData.verticalAlignment = SWT.FILL;
+ gridData.grabExcessHorizontalSpace = true;
+ gridData.grabExcessVerticalSpace = true;
+ browser.setLayoutData(gridData);
+ browser.pack();
+ } catch(SWTError er){
+ CSSPlugin.getDefault().logError(er);
+ }
+ cssBrowser.setBrowser(browser);
+ return cssBrowser;
+ }
+
+ public void setBrowser(Browser browser) {
+ this.browser = browser;
+ }
+ public void setLayoutData(GridData layoutData) {
+ super.setLayoutData(layoutData);
+ }
+ public boolean setFocus() {
+ return getBrowser().setFocus();
+ }
+ public void setText(String generateBrowserPage) {
+ getBrowser().setText(generateBrowserPage);
+ }
+ public void setEnabled(boolean isEnabled) {
+ getBrowser().setEnabled(isEnabled);
+ }
+ public void addMouseListener(MouseAdapter mouseAdapter) {
+ getBrowser().addMouseListener(mouseAdapter);
+ }
+}
Modified: trunk/jst/plugins/org.jboss.tools.jst.css/src/org/jboss/tools/jst/css/view/CSSPreview.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.css/src/org/jboss/tools/jst/css/view/CSSPreview.java 2010-12-13 13:54:07 UTC (rev 27409)
+++ trunk/jst/plugins/org.jboss.tools.jst.css/src/org/jboss/tools/jst/css/view/CSSPreview.java 2010-12-13 14:00:33 UTC (rev 27410)
@@ -18,7 +18,6 @@
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.custom.SashForm;
import org.eclipse.swt.events.FocusAdapter;
import org.eclipse.swt.events.FocusEvent;
@@ -32,6 +31,7 @@
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.part.ViewPart;
+import org.jboss.tools.jst.css.browser.CSSBrowser;
import org.jboss.tools.jst.css.common.CSSStyleListener;
import org.jboss.tools.jst.css.common.ICSSViewListner;
import org.jboss.tools.jst.css.common.StyleContainer;
@@ -44,7 +44,7 @@
*/
public class CSSPreview extends ViewPart implements ICSSViewListner {
- private Browser browser;
+ private CSSBrowser browser;
private Text previewText;
@@ -83,11 +83,11 @@
true);
previewComposite.setLayoutData(gridData);
- browser = new Browser(previewComposite, SWT.BORDER | SWT.MOZILLA);
+ browser = CSSBrowser.createCSSBrowser(previewComposite, SWT.BORDER | SWT.MOZILLA);
browser.setLayoutData(gridData);
browser.addMouseListener(new MouseAdapter() {
public void mouseDoubleClick(MouseEvent e) {
- if (e.widget == browser) {
+ if (e.widget == browser.getBrowser()) {
browser.setEnabled(false);
previewComposite.setMaximizedControl(previewText);
previewText.setFocus();
14 years
JBoss Tools SVN: r27409 - trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2010-12-13 08:54:07 -0500 (Mon, 13 Dec 2010)
New Revision: 27409
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java
Log:
https://issues.jboss.org/browse/JBIDE-7672
Modified: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java 2010-12-13 13:09:26 UTC (rev 27408)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java 2010-12-13 13:54:07 UTC (rev 27409)
@@ -29,7 +29,7 @@
*/
public class CDIMarkerResolutionTest extends ValidationTest {
public static final String MARKER_TYPE = "org.jboss.tools.cdi.core.cdiproblem";
-
+
public void testMakeFieldStaticResolution() throws CoreException {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/NonStaticProducerOfSessionBeanBroken.java");
@@ -108,5 +108,59 @@
}
assertTrue("Quick fix: \"Make method public\" doesn't exist.", found);
}
+
+ public void testMakeMethodBusinessResolution2() throws CoreException {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/event/broken/observer/notBusinessMethod/TibetanTerrier_Broken.java");
+
+ assertTrue("File - "+file.getFullPath()+" must be exist",file.exists());
+
+ IMarker[] markers = file.findMarkers(MARKER_TYPE, true, IResource.DEPTH_INFINITE);
+
+ boolean found1 = false;
+ boolean found2 = false;
+ for (int i = 0; i < markers.length; i++) {
+ IMarker marker = markers[i];
+ IMarkerResolution[] resolutions = IDE.getMarkerHelpRegistry()
+ .getResolutions(marker);
+ for (int j = 0; j < resolutions.length; j++) {
+ IMarkerResolution resolution = resolutions[j];
+ if (resolution instanceof MakeMethodBusinessMarkerResolution) {
+ found1 = true;
+ }
+ if (resolution instanceof AddLocalBeanMarkerResolution) {
+ found2 = true;
+ }
+ }
+ }
+ assertTrue("Quick fix: \"Make method business\" doesn't exist.", found1);
+ assertTrue("Quick fix: \"Add @LocalBean annotation\" doesn't exist.", found2);
+ }
+ public void testMakeMethodBusinessResolution3() throws CoreException {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/disposers/NotBusinessMethod_Broken.java");
+
+ assertTrue("File - "+file.getFullPath()+" must be exist",file.exists());
+
+ IMarker[] markers = file.findMarkers(MARKER_TYPE, true, IResource.DEPTH_INFINITE);
+
+ boolean found1 = false;
+ boolean found2 = false;
+ for (int i = 0; i < markers.length; i++) {
+ IMarker marker = markers[i];
+ IMarkerResolution[] resolutions = IDE.getMarkerHelpRegistry()
+ .getResolutions(marker);
+ for (int j = 0; j < resolutions.length; j++) {
+ IMarkerResolution resolution = resolutions[j];
+ if (resolution instanceof MakeMethodBusinessMarkerResolution) {
+ found1 = true;
+ }
+ if (resolution instanceof AddLocalBeanMarkerResolution) {
+ found2 = true;
+ }
+ }
+ }
+ assertTrue("Quick fix: \"Make method business\" doesn't exist.", found1);
+ assertTrue("Quick fix: \"Add @LocalBean annotation\" doesn't exist.", found2);
+ }
+
}
14 years