JBoss Tools SVN: r42425 - in trunk/forge/docs/reference/en-US: images and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: irooskov(a)redhat.com
Date: 2012-07-05 19:35:06 -0400 (Thu, 05 Jul 2012)
New Revision: 42425
Added:
trunk/forge/docs/reference/en-US/Using_Forge.xml
trunk/forge/docs/reference/en-US/images/using_forge/
trunk/forge/docs/reference/en-US/images/using_forge/using_forge_01.png
trunk/forge/docs/reference/en-US/images/using_forge/using_forge_02.png
trunk/forge/docs/reference/en-US/images/using_forge/using_forge_03.png
trunk/forge/docs/reference/en-US/images/using_forge/using_forge_04.png
trunk/forge/docs/reference/en-US/images/using_forge/using_forge_05.png
trunk/forge/docs/reference/en-US/images/using_forge/using_forge_06.png
trunk/forge/docs/reference/en-US/images/using_forge/using_forge_07.png
Modified:
trunk/forge/docs/reference/en-US/Forge_Reference_Guide.xml
trunk/forge/docs/reference/en-US/master.xml
Log:
updated with new content
Modified: trunk/forge/docs/reference/en-US/Forge_Reference_Guide.xml
===================================================================
--- trunk/forge/docs/reference/en-US/Forge_Reference_Guide.xml 2012-07-05 23:32:51 UTC (rev 42424)
+++ trunk/forge/docs/reference/en-US/Forge_Reference_Guide.xml 2012-07-05 23:35:06 UTC (rev 42425)
@@ -5,6 +5,7 @@
<xi:include href="Book_Info.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="Preface.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="Introduction.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="Using_Forge.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="Preferences.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="Feedback.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="Revision_History.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
Added: trunk/forge/docs/reference/en-US/Using_Forge.xml
===================================================================
--- trunk/forge/docs/reference/en-US/Using_Forge.xml (rev 0)
+++ trunk/forge/docs/reference/en-US/Using_Forge.xml 2012-07-05 23:35:06 UTC (rev 42425)
@@ -0,0 +1,121 @@
+<?xml version='1.0' encoding='utf-8' ?>
+
+<chapter id="chap-Forge_Reference_Guide-Using_Forge">
+ <title>Using Forge</title>
+ <para>
+ To begin using Forge, launch the <guilabel>Forge Console</guilabel> view by navigating to <menuchoice><guimenuitem>Window</guimenuitem><guimenuitem>Show View</guimenuitem><guimenuitem>Other</guimenuitem><guimenuitem>Forge</guimenuitem><guimenuitem>Forge Console</guimenuitem></menuchoice>.
+ </para>
+ <figure id="using_forge_01">
+ <title>Forge Console selection</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/using_forge/using_forge_01.png" format="PNG" />
+ </imageobject>
+ <textobject>
+ <phrase>
+ Selecting the Forge Console from the Views menu.
+ </phrase>
+ </textobject>
+ </mediaobject>
+ </figure>
+ <para>
+ The <guilabel>Forge Console</guilabel> will launch in an inactive state. How and when Forge starts can be changed, see <xref linkend="chap-Forge_Reference_Guide-Preferences"/>.
+ </para>
+ <figure id="using_forge_02">
+ <title>The Forge Console</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/using_forge/using_forge_02.png" format="PNG" />
+ </imageobject>
+ <textobject>
+ <phrase>
+ Forge in an inactive state.
+ </phrase>
+ </textobject>
+ </mediaobject>
+ </figure>
+ <para>
+ To start Forge, click the green arrow in the <guilabel>Forge Console</guilabel>.
+ </para>
+ <figure id="using_forge_03">
+ <title>Starting Forge</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/using_forge/using_forge_03.png" format="PNG" />
+ </imageobject>
+ <textobject>
+ <phrase>
+ Starting Forge.
+ </phrase>
+ </textobject>
+ </mediaobject>
+ </figure>
+ <para>
+ Once Forge starts you will notice the name <emphasis>Forge</emphasis> appear in the <guilabel>Forge Console</guilabel> view and a command line currently in your root workspace directory, without a project selected.
+ </para>
+ <figure id="using_forge_04">
+ <title>Started Forge</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/using_forge/using_forge_04.png" format="PNG" />
+ </imageobject>
+ <textobject>
+ <phrase>
+ Started Forge.
+ </phrase>
+ </textobject>
+ </mediaobject>
+ </figure>
+ <para>
+ From the <guilabel>Forge Console</guilabel> command line you can type the command <code>cd</code> (change directory) followed by the directory to change to, and if a navigator view is opened, the navigator view will also change to the specified directory. If the resource is not in the local workspace and the <guilabel>Remote Systems</guilabel> view is open, the directory will be selected in the <guilabel>Remote Systems</guilabel> explorer.
+ </para>
+ <figure id="using_forge_05">
+ <title>Remote Systems view with the Forge Console</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/using_forge/using_forge_05.png" format="PNG" />
+ </imageobject>
+ <textobject>
+ <phrase>
+ Showing that the Remote Systems view is linked to what occurs in the Forge Console view.
+ </phrase>
+ </textobject>
+ </mediaobject>
+ </figure>
+ <para>
+ Through the <guilabel>Forge Console</guilabel> you can also link the console output to the currently open editor by clicking on the <guibutton>Link with Editor</guibutton> button.
+ </para>
+ <figure id="using_forge_06">
+ <title>Link with Editor button</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/using_forge/using_forge_06.png" format="PNG" />
+ </imageobject>
+ <textobject>
+ <phrase>
+ The button to link the Forge Console output with the currently open Editor.
+ </phrase>
+ </textobject>
+ </mediaobject>
+ </figure>
+ <para>
+ If you close the <guilabel>Forge Console</guilabel> view, Forge will continue to run in the background. Re-opeing the <guilabel>Forge Console</guilabel> view will display the latest Forge state.
+ </para>
+ <para>
+ To stop Forge, click on the red square in the <guilabel>Forge Console</guilabel>.
+ </para>
+ <figure id="using_forge_07">
+ <title>Stopping Forge</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/using_forge/using_forge_07.png" format="PNG" />
+ </imageobject>
+ <textobject>
+ <phrase>
+ Stopping the Forge runtime.
+ </phrase>
+ </textobject>
+ </mediaobject>
+ </figure>
+</chapter>
+
Added: trunk/forge/docs/reference/en-US/images/using_forge/using_forge_01.png
===================================================================
(Binary files differ)
Property changes on: trunk/forge/docs/reference/en-US/images/using_forge/using_forge_01.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/forge/docs/reference/en-US/images/using_forge/using_forge_02.png
===================================================================
(Binary files differ)
Property changes on: trunk/forge/docs/reference/en-US/images/using_forge/using_forge_02.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/forge/docs/reference/en-US/images/using_forge/using_forge_03.png
===================================================================
(Binary files differ)
Property changes on: trunk/forge/docs/reference/en-US/images/using_forge/using_forge_03.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/forge/docs/reference/en-US/images/using_forge/using_forge_04.png
===================================================================
(Binary files differ)
Property changes on: trunk/forge/docs/reference/en-US/images/using_forge/using_forge_04.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/forge/docs/reference/en-US/images/using_forge/using_forge_05.png
===================================================================
(Binary files differ)
Property changes on: trunk/forge/docs/reference/en-US/images/using_forge/using_forge_05.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/forge/docs/reference/en-US/images/using_forge/using_forge_06.png
===================================================================
(Binary files differ)
Property changes on: trunk/forge/docs/reference/en-US/images/using_forge/using_forge_06.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/forge/docs/reference/en-US/images/using_forge/using_forge_07.png
===================================================================
(Binary files differ)
Property changes on: trunk/forge/docs/reference/en-US/images/using_forge/using_forge_07.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: trunk/forge/docs/reference/en-US/master.xml
===================================================================
--- trunk/forge/docs/reference/en-US/master.xml 2012-07-05 23:32:51 UTC (rev 42424)
+++ trunk/forge/docs/reference/en-US/master.xml 2012-07-05 23:35:06 UTC (rev 42425)
@@ -4,6 +4,8 @@
[
<!ENTITY Introduction SYSTEM "Introduction.xml">
+<!ENTITY UsingForge SYSTEM "Using_Forge.xml">
+<!ENTITY Preferences SYSTEM "Preferences.xml">
]>
<book>
@@ -38,5 +40,7 @@
<toc/>
&Introduction;
+ &UsingForge;
+ &Preferences;
</book>
13 years, 9 months
JBoss Tools SVN: r42424 - trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2012-07-05 19:32:51 -0400 (Thu, 05 Jul 2012)
New Revision: 42424
Added:
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/IJavaElementValidator.java
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/IStringValidator.java
Modified:
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/AsYouTypeValidatorManager.java
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/EditorValidationContext.java
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/IAsYouTypeValidator.java
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/ValidationContext.java
Log:
https://issues.jboss.org/browse/JBIDE-10611 As-you-type CDI validation
Modified: trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/AsYouTypeValidatorManager.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/AsYouTypeValidatorManager.java 2012-07-05 22:38:27 UTC (rev 42423)
+++ trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/AsYouTypeValidatorManager.java 2012-07-05 23:32:51 UTC (rev 42424)
@@ -148,23 +148,51 @@
return true;
}
+ private void validate(Set<? extends IAsYouTypeValidator> validators, IRegion dirtyRegion, IValidationContext helper, IReporter reporter) {
+ for (IAsYouTypeValidator validator : validators) {
+ IProject rootProject = rootProjects.get(validator);
+ IValidatingProjectSet projectBrunch = context.getValidatingProjectTree(validator).getBrunches().get(rootProject);
+ if(projectBrunch!=null) {
+ validator.validate(this, rootProject, dirtyRegion, helper, reporter, context, projectBrunch.getRootContext(), file);
+ }
+ }
+ }
+
+ /**
+ * Validate the string
+ *
+ * @param dirtyRegion
+ * @param helper
+ * @param reporter
+ */
+ public void validateString(IRegion dirtyRegion, IValidationContext helper, IReporter reporter) {
+ if(!init(helper, reporter)) {
+ return;
+ }
+ validate(context.getStringValidators(), dirtyRegion, helper, reporter);
+ }
+
+ /**
+ * Validate the java element
+ *
+ * @param dirtyRegion
+ * @param helper
+ * @param reporter
+ */
+ public void validateJavaElement(IRegion dirtyRegion, IValidationContext helper, IReporter reporter) {
+ if(!init(helper, reporter)) {
+ return;
+ }
+ validate(context.getJavaElementValidators(), dirtyRegion, helper, reporter);
+ }
+
/*
* (non-Javadoc)
* @see org.eclipse.wst.sse.ui.internal.reconcile.validator.ISourceValidator#validate(org.eclipse.jface.text.IRegion, org.eclipse.wst.validation.internal.provisional.core.IValidationContext, org.eclipse.wst.validation.internal.provisional.core.IReporter)
*/
@Override
public void validate(IRegion dirtyRegion, IValidationContext helper, IReporter reporter) {
- if(!init(helper, reporter)) {
- return;
- }
- for (IValidator validator : context.getValidators()) {
- IProject rootProject = rootProjects.get(validator);
- IValidatingProjectSet projectBrunch = context.getValidatingProjectTree(validator).getBrunches().get(rootProject);
- if(projectBrunch!=null) {
- ((IAsYouTypeValidator)validator).validate(this, rootProject, dirtyRegion, helper, reporter, context, projectBrunch.getRootContext(), file);
- }
- }
-// reporter.removeAllMessages(AsYouTypeValidatorManager.this, file);
+ validateString(dirtyRegion, helper, reporter);
}
@Override
Modified: trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/EditorValidationContext.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/EditorValidationContext.java 2012-07-05 22:38:27 UTC (rev 42423)
+++ trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/EditorValidationContext.java 2012-07-05 23:32:51 UTC (rev 42424)
@@ -10,6 +10,9 @@
******************************************************************************/
package org.jboss.tools.common.validation;
+import java.util.HashSet;
+import java.util.Set;
+
import org.eclipse.core.resources.IProject;
import org.eclipse.jface.text.IDocument;
@@ -20,10 +23,22 @@
public class EditorValidationContext extends ValidationContext {
private IDocument document;
+ private Set<IStringValidator> stringValidators;
+ private Set<IJavaElementValidator> javaElementValidators;
public EditorValidationContext(IProject project, IDocument document) {
super(project);
this.document = document;
+ stringValidators = new HashSet<IStringValidator>();
+ javaElementValidators = new HashSet<IJavaElementValidator>();
+ for (IValidator validator : validators) {
+ if(validator instanceof IStringValidator) {
+ stringValidators.add((IStringValidator)validator);
+ }
+ if(validator instanceof IJavaElementValidator) {
+ javaElementValidators.add((IJavaElementValidator)validator);
+ }
+ }
}
/*
@@ -41,4 +56,18 @@
public IDocument getDocument() {
return document;
}
+
+ /**
+ * @return the stringValidators
+ */
+ public Set<IStringValidator> getStringValidators() {
+ return stringValidators;
+ }
+
+ /**
+ * @return the javaElementValidators
+ */
+ public Set<IJavaElementValidator> getJavaElementValidators() {
+ return javaElementValidators;
+ }
}
\ No newline at end of file
Modified: trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/IAsYouTypeValidator.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/IAsYouTypeValidator.java 2012-07-05 22:38:27 UTC (rev 42423)
+++ trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/IAsYouTypeValidator.java 2012-07-05 23:32:51 UTC (rev 42424)
@@ -21,7 +21,7 @@
* Interface to allow for "partial document" as you type validation.
* @author Alexey Kazakov
*/
-public interface IAsYouTypeValidator {
+public interface IAsYouTypeValidator extends org.jboss.tools.common.validation.IValidator {
/**
* Validates the region.
Added: trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/IJavaElementValidator.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/IJavaElementValidator.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/IJavaElementValidator.java 2012-07-05 23:32:51 UTC (rev 42424)
@@ -0,0 +1,19 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.common.validation;
+
+/**
+ * As-you-type validator which is supposed to validate java elements
+ * @author Alexey Kazakov
+ */
+public interface IJavaElementValidator extends IAsYouTypeValidator {
+
+}
\ No newline at end of file
Property changes on: trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/IJavaElementValidator.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/IStringValidator.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/IStringValidator.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/IStringValidator.java 2012-07-05 23:32:51 UTC (rev 42424)
@@ -0,0 +1,19 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.common.validation;
+
+/**
+ * As-you-type validator which is supposed to validate strings
+ * @author Alexey Kazakov
+ */
+public interface IStringValidator extends IAsYouTypeValidator {
+
+}
\ No newline at end of file
Property changes on: trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/IStringValidator.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/ValidationContext.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/ValidationContext.java 2012-07-05 22:38:27 UTC (rev 42423)
+++ trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/ValidationContext.java 2012-07-05 23:32:51 UTC (rev 42424)
@@ -36,7 +36,7 @@
private ValidationResourceRegister validationResourceRegister;
private Map<IValidator, IValidatingProjectTree> projectTree = new HashMap<IValidator, IValidatingProjectTree>();
static List<IConfigurationElement> ALL_VALIDATORS;
- private List<IValidator> validators = new ArrayList<IValidator>();
+ protected List<IValidator> validators = new ArrayList<IValidator>();
private Map<IValidator, Set<IProject>> validatedProjects = new HashMap<IValidator, Set<IProject>>();
public ValidationContext(IProject project) {
13 years, 9 months
JBoss Tools SVN: r42423 - trunk/jst/plugins/org.jboss.tools.jst.web.ui.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2012-07-05 18:38:27 -0400 (Thu, 05 Jul 2012)
New Revision: 42423
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml
Log:
Make Quick Fix "Configure Problem Severity" work on Temporary annotations https://issues.jboss.org/browse/JBIDE-12232
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml 2012-07-05 22:36:51 UTC (rev 42422)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml 2012-07-05 22:38:27 UTC (rev 42423)
@@ -794,7 +794,7 @@
</page>
</extension>
- <extension point="org.jboss.tools.common.text.xml.quickFix">
+ <extension point="org.jboss.tools.common.quickFix">
<quick-fix-generator generator-class="org.jboss.tools.jst.web.ui.action.JSPProblemMarkerResolutionGenerator" id="org.jboss.tools.jst.web.ui.action.JSPProblemMarkerResolutionGenerator" />
</extension>
</plugin>
13 years, 9 months
JBoss Tools SVN: r42422 - trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/action.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2012-07-05 18:36:51 -0400 (Thu, 05 Jul 2012)
New Revision: 42422
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/action/AddTLDMarkerResolution.java
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/action/JSPProblemMarkerResolutionGenerator.java
Log:
Make Quick Fix "Configure Problem Severity" work on Temporary annotations https://issues.jboss.org/browse/JBIDE-12232
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/action/AddTLDMarkerResolution.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/action/AddTLDMarkerResolution.java 2012-07-05 22:35:58 UTC (rev 42421)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/action/AddTLDMarkerResolution.java 2012-07-05 22:36:51 UTC (rev 42422)
@@ -30,7 +30,7 @@
import org.eclipse.ui.texteditor.DocumentProviderRegistry;
import org.eclipse.ui.texteditor.IDocumentProvider;
import org.jboss.tools.common.model.ui.views.palette.PaletteInsertHelper;
-import org.jboss.tools.common.text.xml.quickfix.IBaseMarkerResolution;
+import org.jboss.tools.common.quickfix.IBaseMarkerResolution;
import org.jboss.tools.jst.jsp.jspeditor.dnd.JSPPaletteInsertHelper;
import org.jboss.tools.jst.jsp.jspeditor.dnd.PaletteTaglibInserter;
import org.jboss.tools.jst.web.ui.Messages;
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/action/JSPProblemMarkerResolutionGenerator.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/action/JSPProblemMarkerResolutionGenerator.java 2012-07-05 22:35:58 UTC (rev 42421)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/action/JSPProblemMarkerResolutionGenerator.java 2012-07-05 22:36:51 UTC (rev 42422)
@@ -40,7 +40,7 @@
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
import org.jboss.tools.common.model.ui.views.palette.PaletteInsertHelper;
-import org.jboss.tools.common.text.xml.quickfix.IQuickFixGenerator;
+import org.jboss.tools.common.quickfix.IQuickFixGenerator;
import org.jboss.tools.jst.jsp.jspeditor.dnd.JSPPaletteInsertHelper;
import org.jboss.tools.jst.jsp.jspeditor.dnd.PaletteTaglibInserter;
import org.jboss.tools.jst.web.ui.WebUiPlugin;
13 years, 9 months
JBoss Tools SVN: r42421 - trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2012-07-05 18:35:58 -0400 (Thu, 05 Jul 2012)
New Revision: 42421
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JSPProblemMarkerResolutionTest.java
Log:
Make Quick Fix "Configure Problem Severity" work on Temporary annotations https://issues.jboss.org/browse/JBIDE-12232
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JSPProblemMarkerResolutionTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JSPProblemMarkerResolutionTest.java 2012-07-05 22:28:12 UTC (rev 42420)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JSPProblemMarkerResolutionTest.java 2012-07-05 22:35:58 UTC (rev 42421)
@@ -37,7 +37,7 @@
import org.eclipse.wst.validation.internal.core.Message;
import org.eclipse.wst.validation.internal.provisional.core.IMessage;
import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-import org.jboss.tools.common.text.xml.quickfix.QuickFixManager;
+import org.jboss.tools.common.quickfix.QuickFixManager;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
import org.jboss.tools.jst.web.ui.action.AddTLDMarkerResolution;
import org.jboss.tools.jst.web.ui.action.JSPProblemMarkerResolutionGenerator;
13 years, 9 months
JBoss Tools SVN: r42420 - trunk/documentation/guides/JBDS_Release_Notes/en-US.
by jbosstools-commits@lists.jboss.org
Author: irooskov(a)redhat.com
Date: 2012-07-05 18:28:12 -0400 (Thu, 05 Jul 2012)
New Revision: 42420
Modified:
trunk/documentation/guides/JBDS_Release_Notes/en-US/Article_Info.xml
trunk/documentation/guides/JBDS_Release_Notes/en-US/Fixed_Issues.xml
Log:
updated for jbds 5.0.1
Modified: trunk/documentation/guides/JBDS_Release_Notes/en-US/Article_Info.xml
===================================================================
--- trunk/documentation/guides/JBDS_Release_Notes/en-US/Article_Info.xml 2012-07-05 21:59:55 UTC (rev 42419)
+++ trunk/documentation/guides/JBDS_Release_Notes/en-US/Article_Info.xml 2012-07-05 22:28:12 UTC (rev 42420)
@@ -8,7 +8,7 @@
<productname>JBoss Developer Studio</productname>
<productnumber>5.0</productnumber>
<edition>5.0.1</edition>
- <pubsnumber>1</pubsnumber>
+ <pubsnumber>2</pubsnumber>
<abstract>
<para>
These release notes contain important information related to the JBoss Developer Studio. New features, known issues, resources, and other current issues are addressed here.
Modified: trunk/documentation/guides/JBDS_Release_Notes/en-US/Fixed_Issues.xml
===================================================================
--- trunk/documentation/guides/JBDS_Release_Notes/en-US/Fixed_Issues.xml 2012-07-05 21:59:55 UTC (rev 42419)
+++ trunk/documentation/guides/JBDS_Release_Notes/en-US/Fixed_Issues.xml 2012-07-05 22:28:12 UTC (rev 42420)
@@ -3,28 +3,39 @@
<title>
Enhancements and fixed issues in version 5.0.1
</title>
-<variablelist>
-
- <!-- JBIDE-12177 -->
+ <variablelist>
+ <!-- JBIDE-12177 -->
+ <varlistentry>
+ <term>
+ <ulink url="https://issues.jboss.org/jira/browse/JBIDE-12177">JBIDE-12177</ulink>
+ </term>
+ <listitem>
+ <para>
+ The feature to auto-complete code tags was broken in the Visual Editor. When attempting to auto-complete a code tag, invalid code would be generated. This has been corrected by modifying the content assist file XmlTagCompletionProposalComputer.java to ensure partner code tags are generated correctly when using auto-completion.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <!-- JBIDE-12158 -->
<varlistentry>
<term>
- <ulink url="https://issues.jboss.org/jira/browse/JBIDE-12177">JBIDE-12177</ulink>
+ <ulink url="https://issues.jboss.org/jira/browse/JBIDE-12158">JBIDE-12158</ulink>
</term>
<listitem>
<para>
- The feature to auto-complete code tags was broken in the Visual Editor. When attempting to auto-complete a code tag, invalid code would be generated. This has been corrected by modifying the content assist file XmlTagCompletionProposalComputer.java to ensure partner code tags are generated correctly when using auto-completion.
+ An issue existed when creating a Dynamic Web Project and modifying the project to include the JBoss Core Portlet facet to the project. The portlet-api library was not detected in the target runtime, forcing the user to manually specify it via the user library. This has been corrected by adding the option, Portlet Target Runtime Provider, to the combo-box on the JBoss Portlet Capabilities wizard page.
</para>
</listitem>
</varlistentry>
- <!-- JBIDE-12158 -->
+ <!-- JBIDE-12071 -->
<varlistentry>
<term>
- <ulink url="https://issues.jboss.org/jira/browse/JBIDE-12158">JBIDE-12158</ulink>
+ <ulink url="https://issues.jboss.org/jira/browse/JBIDE-12071">JBIDE-12071</ulink>
</term>
<listitem>
<para>
- An issue existed when creating a Dynamic Web Project and modifying the project to include the JBoss Core Portlet facet to the project. The portlet-api library was not detected in the target runtime, forcing the user to manually specify it via the user library. This has been corrected by adding the option, Portlet Target Runtime Provider, to the combo-box on the JBoss Portlet Capabilities wizard page.
+ Previously, when a user performed a drag-and-drop action to publish a project it was ignored. This occurred because the code to publish a project only accepted direct user-initiated actions and not those considered to be a shell action. The ExpressPublishMethod.java and ExpressBehaviour.java files have been updated to handle shell actions correctly. As a result, incremental publishes initiated by the user are now also handled correctly.
</para>
</listitem>
</varlistentry>
13 years, 9 months
JBoss Tools SVN: r42419 - trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/module.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2012-07-05 17:59:55 -0400 (Thu, 05 Jul 2012)
New Revision: 42419
Modified:
trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/module/BPELDeployable.java
Log:
changed visibility for IFlattenParticipant[] getParticipants() to public
Modified: trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/module/BPELDeployable.java
===================================================================
--- trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/module/BPELDeployable.java 2012-07-05 21:35:05 UTC (rev 42418)
+++ trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/module/BPELDeployable.java 2012-07-05 21:59:55 UTC (rev 42419)
@@ -24,7 +24,7 @@
* (non-Javadoc)
* @see org.eclipse.bpel.runtimes.module.FlatComponentDeployable#getParticipants()
*/
- protected IFlattenParticipant[] getParticipants() {
+ public IFlattenParticipant[] getParticipants() {
/*
* No work really needs to be done here. The BPEL project
* doesn't need to map source in instead, it doesn't need to
13 years, 9 months
JBoss Tools SVN: r42418 - trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/quickfix.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2012-07-05 17:35:05 -0400 (Thu, 05 Jul 2012)
New Revision: 42418
Modified:
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/quickfix/BaseJavaHover.java
Log:
Make Quick Fix "Configure Problem Severity" work on Temporary annotations https://issues.jboss.org/browse/JBIDE-12232
Modified: trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/quickfix/BaseJavaHover.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/quickfix/BaseJavaHover.java 2012-07-05 20:05:15 UTC (rev 42417)
+++ trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/quickfix/BaseJavaHover.java 2012-07-05 21:35:05 UTC (rev 42418)
@@ -37,7 +37,8 @@
}
protected static class ProblemInfo extends AnnotationInfo {
-
+ ICompletionProposal[] propArray = null;
+
public ProblemInfo(Annotation annotation, Position position, ITextViewer textViewer) {
super(annotation, position, textViewer);
}
@@ -47,13 +48,16 @@
*/
@Override
public ICompletionProposal[] getCompletionProposals() {
- ArrayList<IJavaCompletionProposal> proposals= new ArrayList<IJavaCompletionProposal>();
-
- if(QuickFixManager.getInstance().hasProposals(annotation)){
- List<IJavaCompletionProposal> pp = QuickFixManager.getInstance().getProposals(annotation);
- proposals.addAll(pp);
+ if(propArray == null){
+ ArrayList<IJavaCompletionProposal> proposals= new ArrayList<IJavaCompletionProposal>();
+
+ if(QuickFixManager.getInstance().hasProposals(annotation)){
+ List<IJavaCompletionProposal> pp = QuickFixManager.getInstance().getProposals(annotation);
+ proposals.addAll(pp);
+ }
+ propArray = proposals.toArray(new ICompletionProposal[proposals.size()]);
}
- return proposals.toArray(new ICompletionProposal[proposals.size()]);
+ return propArray;
}
}
}
13 years, 9 months
JBoss Tools SVN: r42417 - in trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb: include and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2012-07-05 16:05:15 -0400 (Thu, 05 Jul 2012)
New Revision: 42417
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/include/IncludeModel.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/include/PageInclude.java
Log:
JBIDE-3526
https://issues.jboss.org/browse/JBIDE-3526
ui:decorate, ui:composition.
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java 2012-07-05 19:53:28 UTC (rev 42416)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java 2012-07-05 20:05:15 UTC (rev 42417)
@@ -10,7 +10,6 @@
******************************************************************************/
package org.jboss.tools.jst.web.kb;
-import java.io.File;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
@@ -98,7 +97,6 @@
import org.jboss.tools.common.validation.ValidationELReference;
import org.jboss.tools.jst.web.WebUtils;
import org.jboss.tools.jst.web.kb.include.IncludeContextBuilder;
-import org.jboss.tools.jst.web.kb.include.IncludeModel;
import org.jboss.tools.jst.web.kb.include.PageInclude;
import org.jboss.tools.jst.web.kb.internal.FaceletPageContextImpl;
import org.jboss.tools.jst.web.kb.internal.JspContextImpl;
@@ -649,63 +647,77 @@
}
}
+ static String TAG_COMPOSITION = "composition"; //$NON-NLS-1$
+ static String TAG_DECORATE = "decorate"; //$NON-NLS-1$
+ static String ATTR_TEMPLATE = "template"; //$NON-NLS-1$
static String ATTR_SRC = "src"; //$NON-NLS-1$
static String NODE_PARAM = "param"; //$NON-NLS-1$
static String ATTR_NAME = "name"; //$NON-NLS-1$
static String ATTR_VALUE = "value"; //$NON-NLS-1$
+ static Map<String, String> PATH_ATTRIBUTES = new HashMap<String, String>();
+ static {
+ PATH_ATTRIBUTES.put(TAG_COMPOSITION, ATTR_TEMPLATE);
+ PATH_ATTRIBUTES.put(TAG_DECORATE, ATTR_TEMPLATE);
+ PATH_ATTRIBUTES.put(IncludeContextBuilder.TAG_INCLUDE, ATTR_SRC);
+ }
private static void fillUIParamsForNode(IDOMElement node, ELContextImpl context) {
- if(IncludeContextBuilder.TAG_INCLUDE.equals(node.getLocalName()) && CustomTagLibManager.FACELETS_UI_TAG_LIB_URI.equals(node.getNamespaceURI())) {
- String src = node.getAttribute(ATTR_SRC);
- if(src == null || src.trim().length() == 0) {
- return;
- }
- IFile includedFile = getFile(src, context.getResource());
- if(includedFile == null) return;
- NodeList list = node.getElementsByTagNameNS (CustomTagLibManager.FACELETS_UI_TAG_LIB_URI, NODE_PARAM);
- List<Var> vars = null;
- for (int i = 0; i < list.getLength(); i++) {
- Node n = list.item(i);
- if(n instanceof IDOMElement) {
- IDOMElement element = (IDOMElement)n;
- synchronized (element) {
- if(element.hasAttribute(ATTR_NAME)) {
- String var = element.getAttribute(ATTR_NAME);
- int declOffset = 0;
- int declLength = 0;
- Node varAttr = element.getAttributeNode(ATTR_NAME);
- if (varAttr instanceof IDOMAttr) {
- int varNameStart = ((IDOMAttr)varAttr).getNameRegionStartOffset();
- int varNameEnd = ((IDOMAttr)varAttr).getNameRegionEndOffset();
- declOffset = varNameStart;
- declLength = varNameEnd - varNameStart;
- }
- var = var.trim();
- if(!"".equals(var)) { //$NON-NLS-1$
- if(element.hasAttribute(ATTR_VALUE)) {
- String value = element.getAttribute(ATTR_VALUE);
- value = value.trim();
- Var newVar = new Var(ELParserUtil.getJbossFactory(), var, value, declOffset, declLength);
- if(newVar.getElToken()!=null) {
- if(vars == null) {
- vars = new ArrayList<Var>();
- }
- vars.add(newVar);
+ if(!CustomTagLibManager.FACELETS_UI_TAG_LIB_URI.equals(node.getNamespaceURI())) {
+ return;
+ }
+ String pathAttr = PATH_ATTRIBUTES.get(node.getLocalName());
+ if(pathAttr == null) {
+ return;
+ }
+ String src = node.getAttribute(pathAttr);
+ if(src == null || src.trim().length() == 0) {
+ return;
+ }
+ IFile includedFile = getFile(src, context.getResource());
+ if(includedFile == null) return;
+ NodeList list = node.getElementsByTagNameNS (CustomTagLibManager.FACELETS_UI_TAG_LIB_URI, NODE_PARAM);
+ List<Var> vars = null;
+ for (int i = 0; i < list.getLength(); i++) {
+ Node n = list.item(i);
+ if(n instanceof IDOMElement) {
+ IDOMElement element = (IDOMElement)n;
+ synchronized (element) {
+ if(element.hasAttribute(ATTR_NAME)) {
+ String var = element.getAttribute(ATTR_NAME);
+ int declOffset = 0;
+ int declLength = 0;
+ Node varAttr = element.getAttributeNode(ATTR_NAME);
+ if (varAttr instanceof IDOMAttr) {
+ int varNameStart = ((IDOMAttr)varAttr).getNameRegionStartOffset();
+ int varNameEnd = ((IDOMAttr)varAttr).getNameRegionEndOffset();
+ declOffset = varNameStart;
+ declLength = varNameEnd - varNameStart;
+ }
+ var = var.trim();
+ if(!"".equals(var)) { //$NON-NLS-1$
+ if(element.hasAttribute(ATTR_VALUE)) {
+ String value = element.getAttribute(ATTR_VALUE);
+ value = value.trim();
+ Var newVar = new Var(ELParserUtil.getJbossFactory(), var, value, declOffset, declLength);
+ if(newVar.getElToken()!=null) {
+ if(vars == null) {
+ vars = new ArrayList<Var>();
}
+ vars.add(newVar);
}
}
}
}
}
}
- if(vars != null && !vars.isEmpty()) {
- IKbProject kbProject = KbProjectFactory.getKbProject(context.getResource().getProject(), true);
- if(kbProject != null) {
- PageInclude include = new PageInclude(context.getResource().getFullPath(), includedFile.getFullPath(), vars);
- kbProject.getIncludeModel().addInclude(context.getResource().getFullPath(), include);
- }
+ }
+ if(vars != null && !vars.isEmpty()) {
+ IKbProject kbProject = KbProjectFactory.getKbProject(context.getResource().getProject(), true);
+ if(kbProject != null) {
+ PageInclude include = new PageInclude(context.getResource().getFullPath(), includedFile.getFullPath(), vars);
+ kbProject.getIncludeModel().addInclude(context.getResource().getFullPath(), include);
}
- }
+ }
}
public static IFile getFile(String fileName, IFile includeFile) {
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/include/IncludeModel.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/include/IncludeModel.java 2012-07-05 19:53:28 UTC (rev 42416)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/include/IncludeModel.java 2012-07-05 20:05:15 UTC (rev 42417)
@@ -90,7 +90,7 @@
* (non-Javadoc)
* @see org.jboss.tools.jst.web.kb.validation.IValidationContext#store(org.w3c.dom.Element)
*/
- public void store(Element root) {
+ public synchronized void store(Element root) {
Map<String, String> pathAliases = loadAliases(root);
Element includes = XMLUtilities.createElement(root, STORE_ELEMENT_INCLUDES);
for (IPath path : directReferences.keySet()) {
@@ -127,7 +127,7 @@
* (non-Javadoc)
* @see org.jboss.tools.jst.web.kb.validation.IValidationContext#load(org.w3c.dom.Element)
*/
- public void load(Element root) {
+ public synchronized void load(Element root) {
Map<String, String> pathAliases = loadAliases(root);
Element includes = XMLUtilities.getUniqueChild(root, STORE_ELEMENT_INCLUDES);
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/include/PageInclude.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/include/PageInclude.java 2012-07-05 19:53:28 UTC (rev 42416)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/include/PageInclude.java 2012-07-05 20:05:15 UTC (rev 42417)
@@ -16,6 +16,7 @@
import org.jboss.tools.common.el.core.resolver.Var;
/**
+ * Parameters defined within elements <ui:include>, <ui:composition>, <ui:decorate>
*
* @author Viacheslav Kabanovich
*
13 years, 9 months
JBoss Tools SVN: r42416 - in trunk/common/plugins: org.jboss.tools.common/META-INF and 15 other directories.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2012-07-05 15:53:28 -0400 (Thu, 05 Jul 2012)
New Revision: 42416
Added:
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/quickfix/
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/quickfix/BaseJavaHover.java
trunk/common/plugins/org.jboss.tools.common/schema/
trunk/common/plugins/org.jboss.tools.common/schema/quickFix.exsd
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/quickfix/
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/quickfix/IBaseMarkerResolution.java
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/quickfix/IQuickFixGenerator.java
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/quickfix/MarkerAnnotationInfo.java
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/quickfix/QuickFixExtension.java
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/quickfix/QuickFixManager.java
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/quickfix/QuickFixProposal.java
Removed:
trunk/common/plugins/org.jboss.tools.common.text.xml/schema/quickFix.exsd
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/quickfix/
Modified:
trunk/common/plugins/org.jboss.tools.common.text.xml/META-INF/MANIFEST.MF
trunk/common/plugins/org.jboss.tools.common.text.xml/plugin.xml
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/BaseQuickAssistProcessor.java
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/xpl/MarkerProblemAnnotationHoverProcessor.java
trunk/common/plugins/org.jboss.tools.common.ui/META-INF/MANIFEST.MF
trunk/common/plugins/org.jboss.tools.common.ui/plugin.xml
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/marker/ConfigureProblemSeverityResolutionGenerator.java
trunk/common/plugins/org.jboss.tools.common.validation/META-INF/MANIFEST.MF
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/java/JavaDirtyRegionProcessor.java
trunk/common/plugins/org.jboss.tools.common/META-INF/MANIFEST.MF
trunk/common/plugins/org.jboss.tools.common/plugin.xml
Log:
Make Quick Fix "Configure Problem Severity" work on Temporary annotations https://issues.jboss.org/browse/JBIDE-12232
Modified: trunk/common/plugins/org.jboss.tools.common/META-INF/MANIFEST.MF
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/META-INF/MANIFEST.MF 2012-07-05 18:43:26 UTC (rev 42415)
+++ trunk/common/plugins/org.jboss.tools.common/META-INF/MANIFEST.MF 2012-07-05 19:53:28 UTC (rev 42416)
@@ -12,6 +12,7 @@
org.jboss.tools.common.jobs,
org.jboss.tools.common.log,
org.jboss.tools.common.preferences,
+ org.jboss.tools.common.quickfix,
org.jboss.tools.common.refactoring,
org.jboss.tools.common.reporting,
org.jboss.tools.common.text,
@@ -40,7 +41,8 @@
org.apache.commons.httpclient;bundle-version="3.1.0",
org.eclipse.ui.editors;bundle-version="3.7.0",
org.eclipse.jpt.common.core;bundle-version="1.0.0",
- org.eclipse.ltk.core.refactoring;bundle-version="3.5.200"
+ org.eclipse.ltk.core.refactoring;bundle-version="3.5.200",
+ org.eclipse.wst.sse.ui;bundle-version="1.3.100"
Bundle-Version: 3.4.0.qualifier
Bundle-ActivationPolicy: lazy
Bundle-ManifestVersion: 2
Modified: trunk/common/plugins/org.jboss.tools.common/plugin.xml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/plugin.xml 2012-07-05 18:43:26 UTC (rev 42415)
+++ trunk/common/plugins/org.jboss.tools.common/plugin.xml 2012-07-05 19:53:28 UTC (rev 42416)
@@ -2,6 +2,8 @@
<?eclipse version="3.0"?>
<plugin>
+<extension-point id="quickFix" name="Quick Fix Generator" schema="schema/quickFix.exsd"/>
+
<extension point="org.eclipse.wst.xml.core.catalogContributions">
<catalogContribution id="default">
Copied: trunk/common/plugins/org.jboss.tools.common/schema/quickFix.exsd (from rev 42411, trunk/common/plugins/org.jboss.tools.common.text.xml/schema/quickFix.exsd)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/schema/quickFix.exsd (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common/schema/quickFix.exsd 2012-07-05 19:53:28 UTC (rev 42416)
@@ -0,0 +1,129 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.jboss.tools.common.text.xml" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.jboss.tools.common.text.xml" id="quickFix" name="Quick Fix Generator"/>
+ </appInfo>
+ <documentation>
+ This extenion point is used to send information about Quick fix generators to QuickFixManager.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appInfo>
+ <meta.element />
+ </appInfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="quick-fix-generator" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="quick-fix-generator">
+ <complexType>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="identifier"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ <attribute name="generator-class" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn=":org.jboss.tools.common.text.xml.quickfix.IQuickFixGenerator"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ JBoss Tools 3.4
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ <extension point="org.jboss.tools.common.text.xml.quickFix">
+ <quick-fix-generator id="seam.searcher" generator-class="org.jboss.tools.jst.web.ui.action.JSPProblemMarkerResolutionGenerator" />
+</extension>
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiinfo"/>
+ </appInfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="copyright"/>
+ </appInfo>
+ <documentation>
+ Copyright (c) 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
+
+Contributors:
+Red Hat, Inc. - initial API and implementation
+ </documentation>
+ </annotation>
+
+</schema>
Property changes on: trunk/common/plugins/org.jboss.tools.common/schema/quickFix.exsd
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Copied: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/quickfix/IBaseMarkerResolution.java (from rev 42411, trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/quickfix/IBaseMarkerResolution.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/quickfix/IBaseMarkerResolution.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/quickfix/IBaseMarkerResolution.java 2012-07-05 19:53:28 UTC (rev 42416)
@@ -0,0 +1,17 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.common.quickfix;
+
+import org.eclipse.ui.IMarkerResolution2;
+
+public interface IBaseMarkerResolution extends IMarkerResolution2 {
+
+}
Property changes on: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/quickfix/IBaseMarkerResolution.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Copied: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/quickfix/IQuickFixGenerator.java (from rev 42411, trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/quickfix/IQuickFixGenerator.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/quickfix/IQuickFixGenerator.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/quickfix/IQuickFixGenerator.java 2012-07-05 19:53:28 UTC (rev 42416)
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.common.quickfix;
+
+import java.util.List;
+
+import org.eclipse.jdt.ui.text.java.IJavaCompletionProposal;
+import org.eclipse.jface.text.source.Annotation;
+
+public interface IQuickFixGenerator {
+
+ /**
+ * Returns whether there are any proposals for the given annotation.
+ *
+ * @param annotation the annotation
+ * @return <code>true</code> if there are proposals for the given annotation,
+ * <code>false</code> if not
+ */
+ public boolean hasProposals(Annotation annotation);
+
+ /**
+ * Returns list of proposals for the given annotation (may
+ * be empty).
+ *
+ * @param annotation the annotation
+ * @return list of proposals for the given annotation
+ */
+ public List<IJavaCompletionProposal> getProposals(Annotation annotation);
+}
Property changes on: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/quickfix/IQuickFixGenerator.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Copied: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/quickfix/MarkerAnnotationInfo.java (from rev 42411, trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/quickfix/MarkerAnnotationInfo.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/quickfix/MarkerAnnotationInfo.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/quickfix/MarkerAnnotationInfo.java 2012-07-05 19:53:28 UTC (rev 42416)
@@ -0,0 +1,166 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.common.quickfix;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.jdt.ui.text.java.IJavaCompletionProposal;
+import org.eclipse.jface.text.Position;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.quickassist.IQuickAssistInvocationContext;
+import org.eclipse.jface.text.quickassist.IQuickAssistProcessor;
+import org.eclipse.jface.text.quickassist.IQuickFixableAnnotation;
+import org.eclipse.jface.text.source.Annotation;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IMarkerResolution;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.ide.IDE;
+import org.eclipse.ui.texteditor.SimpleMarkerAnnotation;
+import org.eclipse.wst.sse.ui.StructuredTextInvocationContext;
+import org.eclipse.wst.sse.ui.internal.correction.QuickFixRegistry;
+import org.eclipse.wst.sse.ui.internal.reconcile.TemporaryAnnotation;
+
+public class MarkerAnnotationInfo {
+ public final List<AnnotationInfo> infos;
+ public final ISourceViewer viewer;
+
+ public MarkerAnnotationInfo(List<AnnotationInfo> infos, ISourceViewer textViewer) {
+ this.infos = infos;
+ this.viewer = textViewer;
+ }
+
+ public List<ICompletionProposal> getCompletionProposals(AnnotationInfo info) {
+
+ if(info.isTop())
+ return getMarkerProposals(info);
+ else
+ return getProposals(info);
+
+ }
+
+ public List<ICompletionProposal> getMarkerProposals(AnnotationInfo info) {
+ SimpleMarkerAnnotation annotation = (SimpleMarkerAnnotation)info.annotation;
+
+ ArrayList<ICompletionProposal> proposals = new ArrayList<ICompletionProposal>();
+
+ IMarker marker = annotation.getMarker();
+ IMarkerResolution[] resolutions = IDE.getMarkerHelpRegistry().getResolutions(marker);
+ for (IMarkerResolution resolution : resolutions) {
+ if(!isDirty() || !(resolution instanceof IBaseMarkerResolution)){
+ proposals.add(new QuickFixProposal(resolution, marker));
+ }
+ }
+
+ return proposals;
+ }
+
+ public List<ICompletionProposal> getProposals(AnnotationInfo info) {
+ TemporaryAnnotation annotation = (TemporaryAnnotation)info.annotation;
+
+ List<ICompletionProposal> allProposals = new ArrayList<ICompletionProposal>();
+ List<IQuickAssistProcessor> processors = new ArrayList<IQuickAssistProcessor>();
+ if (canFix(annotation)) {
+ Object o = annotation.getAdditionalFixInfo();
+ if (o instanceof IQuickAssistProcessor) {
+ processors.add((IQuickAssistProcessor)o);
+ }
+
+ // get all relevant quick fixes for this annotation
+
+ if(isDirty() && QuickFixManager.getInstance().hasProposals(annotation)){
+ annotation.setAdditionalFixInfo(viewer.getDocument());
+ List<IJavaCompletionProposal> proposals = QuickFixManager.getInstance().getProposals(annotation);
+ allProposals.addAll(proposals);
+ }
+
+ QuickFixRegistry registry = QuickFixRegistry.getInstance();
+ processors.addAll(Arrays.asList(registry.getQuickFixProcessors(annotation)));
+
+ // set up context
+ Map attributes = null;
+ attributes = annotation.getAttributes();
+ StructuredTextInvocationContext sseContext = new StructuredTextInvocationContext(viewer, info.position.getOffset(), info.position.getLength(), attributes);
+
+ // call each processor
+ for (int i = 0; i < processors.size(); ++i) {
+ List<ICompletionProposal> proposals = new ArrayList<ICompletionProposal>();
+ collectProposals((IQuickAssistProcessor) processors.get(i), annotation, sseContext, proposals);
+
+ if (proposals.size() > 0) {
+ allProposals.addAll(proposals);
+ }
+ }
+
+ }
+
+ return allProposals;
+ }
+
+ private static boolean isDirty(){
+ IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+ if(window != null){
+ IWorkbenchPage page = window.getActivePage();
+ if(page != null){
+ IEditorPart editor = page.getActiveEditor();
+ if(editor != null){
+ return editor.isDirty();
+ }
+ }
+ }
+ return true;
+ }
+
+ private void collectProposals(IQuickAssistProcessor processor, Annotation annotation, IQuickAssistInvocationContext invocationContext, List<ICompletionProposal> proposalsList) {
+ ICompletionProposal[] proposals = processor.computeQuickAssistProposals(invocationContext);
+ if (proposals != null && proposals.length > 0) {
+ proposalsList.addAll(Arrays.asList(proposals));
+ }
+ }
+
+ public boolean canFix(Annotation annotation) {
+ if (annotation instanceof IQuickFixableAnnotation) {
+ if (((IQuickFixableAnnotation) annotation).isQuickFixableStateSet()) {
+ return ((IQuickFixableAnnotation) annotation).isQuickFixable();
+ }
+ }else if(annotation instanceof TemporaryAnnotation){
+ if (((TemporaryAnnotation) annotation).isQuickFixableStateSet()) {
+ return ((TemporaryAnnotation) annotation).isQuickFixable();
+ }
+ }
+ return false;
+ }
+
+ public static class AnnotationInfo {
+ public Annotation annotation;
+ public Position position;
+
+ public AnnotationInfo(Annotation annotation, Position position){
+ this.annotation = annotation;
+ this.position = position;
+ }
+
+ public boolean isTop(){
+ return annotation instanceof SimpleMarkerAnnotation;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return null;
+ }
+}
\ No newline at end of file
Property changes on: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/quickfix/MarkerAnnotationInfo.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Copied: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/quickfix/QuickFixExtension.java (from rev 42411, trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/quickfix/QuickFixExtension.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/quickfix/QuickFixExtension.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/quickfix/QuickFixExtension.java 2012-07-05 19:53:28 UTC (rev 42416)
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.common.quickfix;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.Platform;
+import org.jboss.tools.common.CommonPlugin;
+
+public class QuickFixExtension {
+ public static String EXTENSION_POINT = "org.jboss.tools.common.quickFix"; //$NON-NLS-1$
+
+ String id;
+ IQuickFixGenerator generator;
+
+ public QuickFixExtension() {}
+
+ public String getId() {
+ return id;
+ }
+
+ public IQuickFixGenerator getQuickFixGenerator() {
+ return generator;
+ }
+
+ static QuickFixExtension[] INSTANCES;
+
+ public static QuickFixExtension[] getInstances() {
+ if(INSTANCES != null) return INSTANCES;
+ List<QuickFixExtension> list = new ArrayList<QuickFixExtension>();
+ IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(EXTENSION_POINT);
+ IConfigurationElement[] es = point.getConfigurationElements();
+ for (IConfigurationElement e: es) {
+ QuickFixExtension n = new QuickFixExtension();
+ n.id = e.getAttribute("id"); //$NON-NLS-1$
+ try{
+ n.generator = (IQuickFixGenerator)e.createExecutableExtension("generator-class"); //$NON-NLS-1$
+ }catch(CoreException ex){
+ CommonPlugin.getDefault().logError(ex);
+ }
+ list.add(n);
+ }
+ return INSTANCES = list.toArray(new QuickFixExtension[0]);
+ }
+}
Property changes on: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/quickfix/QuickFixExtension.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Copied: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/quickfix/QuickFixManager.java (from rev 42411, trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/quickfix/QuickFixManager.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/quickfix/QuickFixManager.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/quickfix/QuickFixManager.java 2012-07-05 19:53:28 UTC (rev 42416)
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.common.quickfix;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import org.eclipse.jdt.ui.text.java.IJavaCompletionProposal;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.source.Annotation;
+
+public class QuickFixManager {
+ private static QuickFixManager instance = null;
+
+ private HashMap<String, IQuickFixGenerator> generators = new HashMap<String, IQuickFixGenerator>();
+
+ public static QuickFixManager getInstance(){
+ if(instance == null){
+ instance = new QuickFixManager();
+ }
+ return instance;
+ }
+
+ public QuickFixManager(){
+ QuickFixExtension[] extensions = QuickFixExtension.getInstances();
+ for(QuickFixExtension extension : extensions){
+ IQuickFixGenerator generator = extension.getQuickFixGenerator();
+ if(generator != null){
+ addQuickFixGenerator(generator);
+ }
+ }
+ }
+
+ public void addQuickFixGenerator(IQuickFixGenerator generator){
+ if(!generators.containsKey(generator.getClass().toString())){
+ generators.put(generator.getClass().toString(), generator);
+ }
+ }
+
+ public void removeQuickFixGenerator(IQuickFixGenerator generator){
+ generators.remove(generator);
+ }
+
+ public boolean hasProposals(Annotation annotation){
+ for(IQuickFixGenerator generator : generators.values()){
+ if(generator.hasProposals(annotation)){
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public List<IJavaCompletionProposal> getProposals(Annotation annotation){
+ ArrayList<IJavaCompletionProposal> proposals = new ArrayList<IJavaCompletionProposal>();
+ for(IQuickFixGenerator generator : generators.values()){
+ List<IJavaCompletionProposal> pp = generator.getProposals(annotation);
+ proposals.addAll(pp);
+ }
+
+ return proposals;
+ }
+}
Property changes on: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/quickfix/QuickFixManager.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Copied: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/quickfix/QuickFixProposal.java (from rev 42411, trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/quickfix/QuickFixProposal.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/quickfix/QuickFixProposal.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/quickfix/QuickFixProposal.java 2012-07-05 19:53:28 UTC (rev 42416)
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.common.quickfix;
+
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.contentassist.IContextInformation;
+import org.eclipse.ui.IMarkerResolution;
+import org.eclipse.ui.IMarkerResolution2;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+
+public class QuickFixProposal implements ICompletionProposal{
+ private IMarkerResolution resolution;
+ private IMarker marker;
+
+ public QuickFixProposal(IMarkerResolution resolution, IMarker marker){
+ this.resolution = resolution;
+ this.marker = marker;
+ }
+
+ public void apply(IDocument document) {
+ resolution.run(marker);
+ }
+
+ public Point getSelection(IDocument document) {
+ return null;
+ }
+
+ public String getAdditionalProposalInfo() {
+ if (resolution instanceof IMarkerResolution2)
+ return ((IMarkerResolution2) resolution).getDescription();
+
+ return (String)marker.getAttribute(IMarker.MESSAGE, ""); //$NON-NLS-1$
+ }
+
+ public String getDisplayString() {
+ return resolution.getLabel();
+ }
+
+ public Image getImage() {
+ if (resolution instanceof IMarkerResolution2)
+ return ((IMarkerResolution2)resolution).getImage();
+ return null;
+ }
+
+ public IContextInformation getContextInformation() {
+ return null;
+ }
+}
Property changes on: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/quickfix/QuickFixProposal.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/common/plugins/org.jboss.tools.common.text.xml/META-INF/MANIFEST.MF
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.xml/META-INF/MANIFEST.MF 2012-07-05 18:43:26 UTC (rev 42415)
+++ trunk/common/plugins/org.jboss.tools.common.text.xml/META-INF/MANIFEST.MF 2012-07-05 19:53:28 UTC (rev 42416)
@@ -10,7 +10,6 @@
org.jboss.tools.common.text.xml.contentassist,
org.jboss.tools.common.text.xml.info,
org.jboss.tools.common.text.xml.internal.ui.preferencies,
- org.jboss.tools.common.text.xml.quickfix,
org.jboss.tools.common.text.xml.ui,
org.jboss.tools.common.text.xml.ui.xpl,
org.jboss.tools.common.text.xml.xpl,
Modified: trunk/common/plugins/org.jboss.tools.common.text.xml/plugin.xml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.xml/plugin.xml 2012-07-05 18:43:26 UTC (rev 42415)
+++ trunk/common/plugins/org.jboss.tools.common.text.xml/plugin.xml 2012-07-05 19:53:28 UTC (rev 42416)
@@ -3,7 +3,6 @@
<plugin>
<extension-point id="contentAssistProcessor" name="Content Assist Processor Extension Point Extension" schema="schema/contentAssistProcessor.exsd"/>
- <extension-point id="quickFix" name="Quick Fix Generator" schema="schema/quickFix.exsd"/>
<!--
<extension-point id="foldingStructureProviders" name="%foldingStructureProvidersExtensionPoint" schema="schema/foldingStructureProviders.exsd"/>
Deleted: trunk/common/plugins/org.jboss.tools.common.text.xml/schema/quickFix.exsd
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.xml/schema/quickFix.exsd 2012-07-05 18:43:26 UTC (rev 42415)
+++ trunk/common/plugins/org.jboss.tools.common.text.xml/schema/quickFix.exsd 2012-07-05 19:53:28 UTC (rev 42416)
@@ -1,129 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.jboss.tools.common.text.xml" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.jboss.tools.common.text.xml" id="quickFix" name="Quick Fix Generator"/>
- </appInfo>
- <documentation>
- This extenion point is used to send information about Quick fix generators to QuickFixManager.
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appInfo>
- <meta.element />
- </appInfo>
- </annotation>
- <complexType>
- <sequence>
- <element ref="quick-fix-generator" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="quick-fix-generator">
- <complexType>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute kind="identifier"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="generator-class" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn=":org.jboss.tools.common.text.xml.quickfix.IQuickFixGenerator"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- JBoss Tools 3.4
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- <extension point="org.jboss.tools.common.text.xml.quickFix">
- <quick-fix-generator id="seam.searcher" generator-class="org.jboss.tools.jst.web.ui.action.JSPProblemMarkerResolutionGenerator" />
-</extension>
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiinfo"/>
- </appInfo>
- <documentation>
- [Enter API information here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
- [Enter information about supplied implementation of this extension point.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 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
-
-Contributors:
-Red Hat, Inc. - initial API and implementation
- </documentation>
- </annotation>
-
-</schema>
Modified: trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/BaseQuickAssistProcessor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/BaseQuickAssistProcessor.java 2012-07-05 18:43:26 UTC (rev 42415)
+++ trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/BaseQuickAssistProcessor.java 2012-07-05 19:53:28 UTC (rev 42416)
@@ -22,8 +22,8 @@
import org.eclipse.jface.text.source.IAnnotationModel;
import org.eclipse.ui.texteditor.SimpleMarkerAnnotation;
import org.eclipse.wst.sse.ui.internal.reconcile.TemporaryAnnotation;
-import org.jboss.tools.common.text.xml.quickfix.MarkerAnnotationInfo;
-import org.jboss.tools.common.text.xml.quickfix.MarkerAnnotationInfo.AnnotationInfo;
+import org.jboss.tools.common.quickfix.MarkerAnnotationInfo;
+import org.jboss.tools.common.quickfix.MarkerAnnotationInfo.AnnotationInfo;
public class BaseQuickAssistProcessor implements IQuickAssistProcessor {
Modified: trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/xpl/MarkerProblemAnnotationHoverProcessor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/xpl/MarkerProblemAnnotationHoverProcessor.java 2012-07-05 18:43:26 UTC (rev 42415)
+++ trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/xpl/MarkerProblemAnnotationHoverProcessor.java 2012-07-05 19:53:28 UTC (rev 42416)
@@ -63,8 +63,8 @@
import org.eclipse.ui.texteditor.SimpleMarkerAnnotation;
import org.eclipse.wst.sse.ui.internal.reconcile.TemporaryAnnotation;
import org.eclipse.wst.sse.ui.internal.taginfo.ProblemAnnotationHoverProcessor;
-import org.jboss.tools.common.text.xml.quickfix.MarkerAnnotationInfo;
-import org.jboss.tools.common.text.xml.quickfix.MarkerAnnotationInfo.AnnotationInfo;
+import org.jboss.tools.common.quickfix.MarkerAnnotationInfo;
+import org.jboss.tools.common.quickfix.MarkerAnnotationInfo.AnnotationInfo;
import org.jboss.tools.common.text.xml.TextXMLMessages;
public class MarkerProblemAnnotationHoverProcessor extends ProblemAnnotationHoverProcessor implements ITextHoverExtension, ITextHoverExtension2{
Modified: trunk/common/plugins/org.jboss.tools.common.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.ui/META-INF/MANIFEST.MF 2012-07-05 18:43:26 UTC (rev 42415)
+++ trunk/common/plugins/org.jboss.tools.common.ui/META-INF/MANIFEST.MF 2012-07-05 19:53:28 UTC (rev 42416)
@@ -39,6 +39,7 @@
org.jboss.tools.common.ui.marker,
org.jboss.tools.common.ui.preferences,
org.jboss.tools.common.ui.preferencevalue,
+ org.jboss.tools.common.ui.quickfix,
org.jboss.tools.common.ui.refactoring,
org.jboss.tools.common.ui.ssh,
org.jboss.tools.common.ui.widget.editor,
Modified: trunk/common/plugins/org.jboss.tools.common.ui/plugin.xml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.ui/plugin.xml 2012-07-05 18:43:26 UTC (rev 42415)
+++ trunk/common/plugins/org.jboss.tools.common.ui/plugin.xml 2012-07-05 19:53:28 UTC (rev 42416)
@@ -39,7 +39,16 @@
<actionSet id="org.eclipse.wst.server.ui.internal.webbrowser.actionSet"/>
</perspectiveExtension>
</extension>
- <extension point="org.jboss.tools.common.text.xml.quickFix">
+ <extension point="org.jboss.tools.common.quickFix">
<quick-fix-generator generator-class="org.jboss.tools.common.ui.marker.ConfigureProblemSeverityResolutionGenerator" id="org.jboss.tools.common.ui.marker.ConfigureProblemSeverityResolutionGenerator" />
</extension>
+ <extension
+ point="org.eclipse.jdt.ui.javaEditorTextHovers">
+ <hover
+ activate="true"
+ class="org.jboss.tools.common.ui.quickfix.BaseJavaHover"
+ id="org.jboss.tools.common.ui.quickfix.BaseJavaHover"
+ label="Base Java Hover">
+ </hover>
+</extension>
</plugin>
Modified: trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/marker/ConfigureProblemSeverityResolutionGenerator.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/marker/ConfigureProblemSeverityResolutionGenerator.java 2012-07-05 18:43:26 UTC (rev 42415)
+++ trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/marker/ConfigureProblemSeverityResolutionGenerator.java 2012-07-05 19:53:28 UTC (rev 42416)
@@ -27,9 +27,10 @@
import org.eclipse.ui.IMarkerResolutionGenerator2;
import org.eclipse.wst.sse.ui.internal.reconcile.TemporaryAnnotation;
import org.jboss.tools.common.EclipseUtil;
-import org.jboss.tools.common.text.xml.quickfix.IQuickFixGenerator;
+import org.jboss.tools.common.quickfix.IQuickFixGenerator;
import org.jboss.tools.common.ui.CommonUIPlugin;
import org.jboss.tools.common.validation.ValidationErrorManager;
+import org.jboss.tools.common.validation.java.JavaDirtyRegionProcessor.JavaProblemAnnotation;
/**
* @author Daniel Azarov
@@ -114,39 +115,48 @@
return attribute;
}
- private String getPreferenceKey(TemporaryAnnotation annotation){
- if(annotation.getAttributes() != null){
- String attribute = (String)annotation.getAttributes().get(ValidationErrorManager.PREFERENCE_KEY_ATTRIBUTE_NAME);
- return attribute;
+ private String getPreferenceKey(Annotation annotation){
+ if(annotation instanceof TemporaryAnnotation){
+ if(((TemporaryAnnotation)annotation).getAttributes() != null){
+ String attribute = (String)((TemporaryAnnotation)annotation).getAttributes().get(ValidationErrorManager.PREFERENCE_KEY_ATTRIBUTE_NAME);
+ return attribute;
+ }
+ }else if(annotation instanceof JavaProblemAnnotation){
+ if(((JavaProblemAnnotation)annotation).getAttributes() != null){
+ String attribute = (String)((JavaProblemAnnotation)annotation).getAttributes().get(ValidationErrorManager.PREFERENCE_KEY_ATTRIBUTE_NAME);
+ return attribute;
+ }
}
return null;
}
- private String getPreferencePageId(TemporaryAnnotation annotation){
- if(annotation.getAttributes() != null){
- String attribute = (String)annotation.getAttributes().get(ValidationErrorManager.PREFERENCE_PAGE_ID_NAME);
- return attribute;
+ private String getPreferencePageId(Annotation annotation){
+ if(annotation instanceof TemporaryAnnotation){
+ if(((TemporaryAnnotation)annotation).getAttributes() != null){
+ String attribute = (String)((TemporaryAnnotation)annotation).getAttributes().get(ValidationErrorManager.PREFERENCE_PAGE_ID_NAME);
+ return attribute;
+ }
+ }else if(annotation instanceof JavaProblemAnnotation){
+ if(((JavaProblemAnnotation)annotation).getAttributes() != null){
+ String attribute = (String)((JavaProblemAnnotation)annotation).getAttributes().get(ValidationErrorManager.PREFERENCE_PAGE_ID_NAME);
+ return attribute;
+ }
}
return null;
}
@Override
public boolean hasProposals(Annotation annotation) {
- if(annotation instanceof TemporaryAnnotation){
- return getPreferenceKey((TemporaryAnnotation)annotation) != null && getPreferencePageId((TemporaryAnnotation)annotation) != null;
- }
- return false;
+ return getPreferenceKey(annotation) != null && getPreferencePageId(annotation) != null;
}
@Override
public List<IJavaCompletionProposal> getProposals(Annotation annotation) {
ArrayList<IJavaCompletionProposal> proposals = new ArrayList<IJavaCompletionProposal>();
- if(annotation instanceof TemporaryAnnotation){
- String preferenceKey = getPreferenceKey((TemporaryAnnotation)annotation);
- String preferencePageId = getPreferencePageId((TemporaryAnnotation)annotation);
- if(preferenceKey != null && preferencePageId != null){
- proposals.add(new ConfigureProblemSeverityMarkerResolution(preferencePageId, preferenceKey));
- }
+ String preferenceKey = getPreferenceKey(annotation);
+ String preferencePageId = getPreferencePageId(annotation);
+ if(preferenceKey != null && preferencePageId != null){
+ proposals.add(new ConfigureProblemSeverityMarkerResolution(preferencePageId, preferenceKey));
}
return proposals;
}
Added: trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/quickfix/BaseJavaHover.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/quickfix/BaseJavaHover.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/quickfix/BaseJavaHover.java 2012-07-05 19:53:28 UTC (rev 42416)
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.common.ui.quickfix;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jdt.internal.ui.text.java.hover.AbstractAnnotationHover;
+import org.eclipse.jdt.ui.text.java.IJavaCompletionProposal;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.Position;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.source.Annotation;
+import org.jboss.tools.common.quickfix.QuickFixManager;
+
+@SuppressWarnings("restriction")
+public class BaseJavaHover extends AbstractAnnotationHover{
+ public BaseJavaHover() {
+ super(true);
+ }
+
+ @Override
+ protected AnnotationInfo createAnnotationInfo(Annotation annotation, Position position, ITextViewer textViewer) {
+ AnnotationInfo info = new ProblemInfo(annotation, position, textViewer);
+ if(info.getCompletionProposals().length > 0){
+ return info;
+ }
+ return null;
+ }
+
+ protected static class ProblemInfo extends AnnotationInfo {
+
+ public ProblemInfo(Annotation annotation, Position position, ITextViewer textViewer) {
+ super(annotation, position, textViewer);
+ }
+
+ /*
+ * @see org.eclipse.jdt.internal.ui.text.java.hover.AbstractAnnotationHover.AnnotationInfo#getCompletionProposals()
+ */
+ @Override
+ public ICompletionProposal[] getCompletionProposals() {
+ ArrayList<IJavaCompletionProposal> proposals= new ArrayList<IJavaCompletionProposal>();
+
+ if(QuickFixManager.getInstance().hasProposals(annotation)){
+ List<IJavaCompletionProposal> pp = QuickFixManager.getInstance().getProposals(annotation);
+ proposals.addAll(pp);
+ }
+ return proposals.toArray(new ICompletionProposal[proposals.size()]);
+ }
+ }
+}
Property changes on: trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/quickfix/BaseJavaHover.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/common/plugins/org.jboss.tools.common.validation/META-INF/MANIFEST.MF
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.validation/META-INF/MANIFEST.MF 2012-07-05 18:43:26 UTC (rev 42415)
+++ trunk/common/plugins/org.jboss.tools.common.validation/META-INF/MANIFEST.MF 2012-07-05 19:53:28 UTC (rev 42416)
@@ -24,4 +24,5 @@
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-Vendor: %providerName
Export-Package: org.jboss.tools.common.validation,
- org.jboss.tools.common.validation.internal
+ org.jboss.tools.common.validation.internal,
+ org.jboss.tools.common.validation.java
Modified: trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/java/JavaDirtyRegionProcessor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/java/JavaDirtyRegionProcessor.java 2012-07-05 18:43:26 UTC (rev 42415)
+++ trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/java/JavaDirtyRegionProcessor.java 2012-07-05 19:53:28 UTC (rev 42416)
@@ -57,7 +57,7 @@
*
*/
@SuppressWarnings("restriction")
-final class JavaDirtyRegionProcessor extends
+final public class JavaDirtyRegionProcessor extends
DirtyRegionProcessor {
/**
@@ -213,7 +213,7 @@
CoreELProblem problem= new CoreELProblem(valMessage,
editorInput.getName());
if (fCompilationUnit != null) {
- ProblemAnnotation problemAnnotation = new ProblemAnnotation(problem, fCompilationUnit);
+ JavaProblemAnnotation problemAnnotation = new JavaProblemAnnotation(problem, fCompilationUnit);
addAnnotation(problemAnnotation, position, cleanAllAnnotations);
}
}
@@ -226,6 +226,19 @@
fInRewriteSession = event != null && event.getChangeType().equals(DocumentRewriteSessionEvent.SESSION_START);
}
}
+
+ public class JavaProblemAnnotation extends ProblemAnnotation{
+ CoreELProblem problem;
+
+ public JavaProblemAnnotation(CoreELProblem problem, ICompilationUnit cu) {
+ super(problem, cu);
+ this.problem = problem;
+ }
+
+ public Map getAttributes() {
+ return problem.getAttributes();
+ }
+ }
class CoreELProblem extends CategorizedProblem {
/** The end offset of the problem */
@@ -244,6 +257,8 @@
/** The originating file name */
private String fOrigin;
+
+ private ValidationMessage vMessage;
public static final int EL_PROBLEM_ID= 0x88000000;
@@ -262,6 +277,7 @@
fMessage= message.getText();
fOrigin= origin;
fIsError = (IMessage.NORMAL_SEVERITY != message.getSeverity());
+ vMessage = message;
}
/*
@@ -363,6 +379,10 @@
public String getMarkerType() {
return MARKER_TYPE;
}
+
+ public Map getAttributes(){
+ return vMessage.getAttributes();
+ }
}
public JavaDirtyRegionProcessor(ITextEditor editor) {
13 years, 9 months