JBoss Tools SVN: r37582 - in trunk: common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/refactoring and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2011-12-29 19:35:28 -0500 (Thu, 29 Dec 2011)
New Revision: 37582
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/refactoring/JBDSFileChange.java
trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests/AbstractRefactorTest.java
Log:
Java Seam and CDI quick fixes: after quick fix, editor is scrolled to the beginning. If Undo/Redo commands are used, the entire file content gets selected https://issues.jboss.org/browse/JBIDE-10536
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 2011-12-29 23:00:25 UTC (rev 37581)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java 2011-12-30 00:35:28 UTC (rev 37582)
@@ -131,11 +131,11 @@
CompositeChange rootChange = (CompositeChange)processor.createChange(new NullProgressMonitor());
- for(Change fileChange : rootChange.getChildren()){
- if(fileChange instanceof JBDSFileChange){
- ((JBDSFileChange)fileChange).setSaveMode(TextFileChange.FORCE_SAVE);
- }
- }
+// for(Change fileChange : rootChange.getChildren()){
+// if(fileChange instanceof JBDSFileChange){
+// ((JBDSFileChange)fileChange).setSaveMode(TextFileChange.FORCE_SAVE);
+// }
+// }
rootChange.perform(new NullProgressMonitor());
} else if(resolution instanceof TestableResolutionWithDialog){
Modified: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/refactoring/JBDSFileChange.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/refactoring/JBDSFileChange.java 2011-12-29 23:00:25 UTC (rev 37581)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/refactoring/JBDSFileChange.java 2011-12-30 00:35:28 UTC (rev 37582)
@@ -13,7 +13,10 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility;
import org.eclipse.jface.text.IDocument;
import org.eclipse.ltk.core.refactoring.Change;
import org.eclipse.ltk.core.refactoring.MultiStateTextFileChange;
@@ -22,6 +25,15 @@
import org.eclipse.ltk.core.refactoring.TextFileChange;
import org.eclipse.text.edits.TextEdit;
import org.eclipse.text.edits.UndoEdit;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IEditorReference;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.progress.UIJob;
+import org.jboss.tools.common.CommonPlugin;
public class JBDSFileChange extends MultiStateTextFileChange{
private IFile file;
@@ -30,9 +42,44 @@
public JBDSFileChange(IFile file) {
super(file.getName(), file);
this.file = file;
- setSaveMode(TextFileChange.LEAVE_DIRTY);
+
+ setSaveMode();
}
+ private void setSaveMode(){
+ UIJob job = new UIJob("setSaveMode"){ //$NON-NLS-1$
+ public IStatus runInUIThread(IProgressMonitor monitor) {
+ try {
+ if(isOpenInEditor(file)){
+ setSaveMode(TextFileChange.LEAVE_DIRTY);
+ }else{
+ setSaveMode(TextFileChange.FORCE_SAVE);
+ }
+ } catch (PartInitException e) {
+ CommonPlugin.getDefault().logError(e);
+ }
+ return Status.OK_STATUS;
+ }};
+
+ job.setSystem(true);
+ job.schedule();
+ }
+
+ private static boolean isOpenInEditor(IFile file) throws PartInitException{
+ IEditorInput input = EditorUtility.getEditorInput(file);
+ for(IWorkbenchWindow window : PlatformUI.getWorkbench().getWorkbenchWindows()){
+ for(IWorkbenchPage page : window.getPages()){
+ for(IEditorReference editorReference : page.getEditorReferences()){
+ IEditorPart editor = editorReference.getEditor(true);
+ if(editor != null && editor.getEditorInput().equals(input)){
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
public IFile getFile(){
return file;
}
Modified: trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests/AbstractRefactorTest.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests/AbstractRefactorTest.java 2011-12-29 23:00:25 UTC (rev 37581)
+++ trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests/AbstractRefactorTest.java 2011-12-30 00:35:28 UTC (rev 37582)
@@ -152,7 +152,7 @@
if(fileChange instanceof JBDSFileChange){
edit = (MultiTextEdit)((JBDSFileChange)fileChange).getEdit();
file = ((JBDSFileChange)fileChange).getFile();
- ((JBDSFileChange)fileChange).setSaveMode(TextFileChange.FORCE_SAVE);
+ //((JBDSFileChange)fileChange).setSaveMode(TextFileChange.FORCE_SAVE);
}else if(fileChange instanceof TextFileChange){
edit = (MultiTextEdit)((TextFileChange)fileChange).getEdit();
file = ((TextFileChange)fileChange).getFile();
12 years, 12 months
JBoss Tools SVN: r37581 - trunk/download.jboss.org/jbosstools/examples.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2011-12-29 18:00:25 -0500 (Thu, 29 Dec 2011)
New Revision: 37581
Modified:
trunk/download.jboss.org/jbosstools/examples/project-examples-community-3...
trunk/download.jboss.org/jbosstools/examples/project-examples-jbds40.xml
Log:
JBIDE-10566 Portlet example in JBDS references GateIn
Modified: trunk/download.jboss.org/jbosstools/examples/project-examples-community-3...
===================================================================
--- trunk/download.jboss.org/jbosstools/examples/project-examples-community-3... 2011-12-29 22:55:23 UTC (rev 37580)
+++ trunk/download.jboss.org/jbosstools/examples/project-examples-community-3... 2011-12-29 23:00:25 UTC (rev 37581)
@@ -576,11 +576,15 @@
<fixes>
<fix type="wtpruntime">
<property name="allowed-types">org.jboss.ide.eclipse.as.runtime.eap.50, org.jboss.ide.eclipse.as.runtime.51</property>
- <property name="eclipse-projects">seam-portlet-ejb,seam-portlet-web</property>
+ <property name="eclipse-projects">seam-portlet-ejb,seam-portlet-web,seam-portlet-ear</property>
<property name="required-components">portlet</property>
<property name="description">This project example requires the JBoss EPP 5.x or GateIn 3.1</property>
</fix>
-
+ <fix type="seam">
+ <property name="allowed-versions">2.2.0</property>
+ <property name="eclipse-projects">seam-portlet-web</property>
+ <property name="description">This project example requires Seam version 2.2.0</property>
+ </fix>
</fixes>
</project>
Modified: trunk/download.jboss.org/jbosstools/examples/project-examples-jbds40.xml
===================================================================
--- trunk/download.jboss.org/jbosstools/examples/project-examples-jbds40.xml 2011-12-29 22:55:23 UTC (rev 37580)
+++ trunk/download.jboss.org/jbosstools/examples/project-examples-jbds40.xml 2011-12-29 23:00:25 UTC (rev 37581)
@@ -961,11 +961,15 @@
<fixes>
<fix type="wtpruntime">
<property name="allowed-types">org.jboss.ide.eclipse.as.runtime.eap.50, org.jboss.ide.eclipse.as.runtime.51</property>
- <property name="eclipse-projects">seam-portlet-ejb,seam-portlet-web</property>
+ <property name="eclipse-projects">seam-portlet-ejb,seam-portlet-web,seam-portlet-ear</property>
<property name="required-components">portlet</property>
<property name="description">This project example requires the JBoss EPP 5.x or GateIn 3.1</property>
</fix>
-
+ <fix type="seam">
+ <property name="allowed-versions">2.2.0</property>
+ <property name="eclipse-projects">seam-portlet-web</property>
+ <property name="description">This project example requires Seam version 2.2.0</property>
+ </fix>
</fixes>
</project>
12 years, 12 months
JBoss Tools SVN: r37580 - in trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central: editors and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2011-12-29 17:55:23 -0500 (Thu, 29 Dec 2011)
New Revision: 37580
Modified:
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/JBossCentralActivator.java
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/JBossCentralEditor.java
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/xpl/DiscoveryViewer.java
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/jobs/AbstractRefreshJob.java
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/jobs/RefreshDiscoveryJob.java
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/jobs/RefreshTutorialsJob.java
Log:
JBIDE-10332 central refresh job still running after shutdown started
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/JBossCentralActivator.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/JBossCentralActivator.java 2011-12-29 22:37:16 UTC (rev 37579)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/JBossCentralActivator.java 2011-12-29 22:55:23 UTC (rev 37580)
@@ -25,8 +25,10 @@
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.jface.dialogs.MessageDialog;
@@ -71,6 +73,8 @@
*/
public class JBossCentralActivator extends AbstractUIPlugin {
+ public static final Object JBOSS_CENTRAL_FAMILY = new Object();
+
public static final String JBOSS_DISCOVERY_DIRECTORY = "jboss.discovery.directory.url";
public static final String ICON = "icon";
@@ -171,6 +175,9 @@
* )
*/
public void stop(BundleContext context) throws Exception {
+ Job.getJobManager().cancel(JBOSS_CENTRAL_FAMILY);
+ Job.getJobManager().join(JBOSS_CENTRAL_FAMILY, new NullProgressMonitor());
+
plugin = null;
bundleContext = null;
tutorialCategories = null;
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/JBossCentralEditor.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/JBossCentralEditor.java 2011-12-29 22:37:16 UTC (rev 37579)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/JBossCentralEditor.java 2011-12-29 22:55:23 UTC (rev 37580)
@@ -17,6 +17,9 @@
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.action.ControlContribution;
import org.eclipse.jface.action.GroupMarker;
import org.eclipse.jface.action.IToolBarManager;
@@ -45,6 +48,9 @@
import org.jboss.tools.central.actions.OpenJBossBlogsHandler;
import org.jboss.tools.central.editors.xpl.TextSearchControl;
import org.jboss.tools.central.jobs.RefreshBlogsJob;
+import org.jboss.tools.central.jobs.RefreshDiscoveryJob;
+import org.jboss.tools.central.jobs.RefreshNewsJob;
+import org.jboss.tools.central.jobs.RefreshTutorialsJob;
/**
*
@@ -86,7 +92,14 @@
softwareImage.dispose();
softwareImage = null;
}
- RefreshBlogsJob.INSTANCE.cancel();
+ Job.getJobManager().cancel(JBossCentralActivator.JBOSS_CENTRAL_FAMILY);
+ try {
+ Job.getJobManager().join(JBossCentralActivator.JBOSS_CENTRAL_FAMILY, new NullProgressMonitor());
+ } catch (OperationCanceledException e) {
+ // ignore
+ } catch (InterruptedException e) {
+ // ignore
+ }
super.dispose();
}
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/xpl/DiscoveryViewer.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/xpl/DiscoveryViewer.java 2011-12-29 22:37:16 UTC (rev 37579)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/xpl/DiscoveryViewer.java 2011-12-29 22:55:23 UTC (rev 37580)
@@ -583,6 +583,9 @@
public void createBodyContents() {
// remove any existing contents
+ if (body == null || body.isDisposed()) {
+ return;
+ }
for (Control child : body.getChildren()) {
child.dispose();
}
@@ -1050,11 +1053,17 @@
}
private void discoveryUpdated(final boolean wasCancelled) {
+ if (body == null || body.isDisposed()) {
+ return;
+ }
Display.getDefault().syncExec(new Runnable() {
@Override
public void run() {
createBodyContents();
+ if (body == null || body.isDisposed()) {
+ return;
+ }
if (discovery != null && !wasCancelled) {
int categoryWithConnectorCount = 0;
for (DiscoveryCategory category : discovery.getCategories()) {
@@ -1499,6 +1508,9 @@
try {
result[0] = connectorDiscovery.performDiscovery(monitor);
} finally {
+ if (monitor.isCanceled()) {
+ return;
+ }
DiscoveryViewer.this.discovery = connectorDiscovery;
postDiscovery(connectorDiscovery);
@@ -1516,9 +1528,11 @@
} catch (InvocationTargetException e) {
IStatus status = computeStatus(e, Messages.ConnectorDiscoveryWizardMainPage_unexpectedException);
StatusManager.getManager().handle(status, StatusManager.SHOW | StatusManager.BLOCK | StatusManager.LOG);
+ return;
} catch (InterruptedException e) {
// cancelled by user so nothing to do here.
wasCancelled = true;
+ return;
}
if (discovery != null) {
discoveryUpdated(wasCancelled);
@@ -1537,6 +1551,7 @@
} catch (InterruptedException e) {
// cancelled by user so nothing to do here.
wasCancelled = true;
+ return;
}
}
// createBodyContents() shouldn't be necessary but for some
@@ -1555,6 +1570,9 @@
Display.getDefault().syncExec(new Runnable() {
@Override
public void run() {
+ if (body == null || body.isDisposed()) {
+ return;
+ }
body.setData("discoveryComplete", "true"); //$NON-NLS-1$ //$NON-NLS-2$
}
});
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/jobs/AbstractRefreshJob.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/jobs/AbstractRefreshJob.java 2011-12-29 22:37:16 UTC (rev 37579)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/jobs/AbstractRefreshJob.java 2011-12-29 22:55:23 UTC (rev 37580)
@@ -271,5 +271,10 @@
public void setNeedsRefresh(boolean needRefresh) {
this.needsRefresh = needRefresh;
}
+
+ @Override
+ public boolean belongsTo(Object family) {
+ return family == JBossCentralActivator.JBOSS_CENTRAL_FAMILY;
+ }
}
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/jobs/RefreshDiscoveryJob.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/jobs/RefreshDiscoveryJob.java 2011-12-29 22:37:16 UTC (rev 37579)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/jobs/RefreshDiscoveryJob.java 2011-12-29 22:55:23 UTC (rev 37580)
@@ -50,5 +50,10 @@
}
return Status.OK_STATUS;
}
+
+ @Override
+ public boolean belongsTo(Object family) {
+ return family == JBossCentralActivator.JBOSS_CENTRAL_FAMILY;
+ }
}
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/jobs/RefreshTutorialsJob.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/jobs/RefreshTutorialsJob.java 2011-12-29 22:37:16 UTC (rev 37579)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/jobs/RefreshTutorialsJob.java 2011-12-29 22:55:23 UTC (rev 37580)
@@ -119,4 +119,8 @@
return tutorialCategories;
}
+ @Override
+ public boolean belongsTo(Object family) {
+ return family == JBossCentralActivator.JBOSS_CENTRAL_FAMILY;
+ }
}
12 years, 12 months
JBoss Tools SVN: r37579 - trunk/common/plugins/org.jboss.tools.common/META-INF.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-12-29 17:37:16 -0500 (Thu, 29 Dec 2011)
New Revision: 37579
Modified:
trunk/common/plugins/org.jboss.tools.common/META-INF/MANIFEST.MF
Log:
JBIDE-10536
Modified: trunk/common/plugins/org.jboss.tools.common/META-INF/MANIFEST.MF
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/META-INF/MANIFEST.MF 2011-12-29 21:54:07 UTC (rev 37578)
+++ trunk/common/plugins/org.jboss.tools.common/META-INF/MANIFEST.MF 2011-12-29 22:37:16 UTC (rev 37579)
@@ -40,7 +40,7 @@
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.201"
+ org.eclipse.ltk.core.refactoring;bundle-version="3.5.200"
Bundle-Version: 3.3.0.qualifier
Bundle-ActivationPolicy: lazy
Bundle-ManifestVersion: 2
12 years, 12 months
JBoss Tools SVN: r37578 - in trunk: cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard and 8 other directories.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2011-12-29 16:54:07 -0500 (Thu, 29 Dec 2011)
New Revision: 37578
Added:
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/refactoring/
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/refactoring/JBDSRefactoringWizard.java
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/refactoring/JBDSFileChange.java
Removed:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/CDIFileChange.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/CDIRefactoringWizard.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/AddQualifiersToBeanProcessor.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/CDIRefactoringProcessor.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/CDIRenameProcessor.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/AbstractModifyInjectionPointWizard.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/DeletePreviewWizard.java
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java
trunk/common/plugins/org.jboss.tools.common.ui/META-INF/MANIFEST.MF
trunk/common/plugins/org.jboss.tools.common/META-INF/MANIFEST.MF
trunk/tests/plugins/org.jboss.tools.tests/META-INF/MANIFEST.MF
trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests/AbstractRefactorTest.java
Log:
Java Seam and CDI quick fixes: after quick fix, editor is scrolled to the beginning. If Undo/Redo commands are used, the entire file content gets selected https://issues.jboss.org/browse/JBIDE-10536
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/AddQualifiersToBeanProcessor.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/AddQualifiersToBeanProcessor.java 2011-12-29 19:13:36 UTC (rev 37577)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/AddQualifiersToBeanProcessor.java 2011-12-29 21:54:07 UTC (rev 37578)
@@ -27,6 +27,7 @@
import org.jboss.tools.cdi.core.IBean;
import org.jboss.tools.cdi.core.IInjectionPoint;
import org.jboss.tools.common.EclipseUtil;
+import org.jboss.tools.common.refactoring.JBDSFileChange;
public class AddQualifiersToBeanProcessor extends CDIRefactoringProcessor {
protected IBean selectedBean;
@@ -86,7 +87,7 @@
ICompilationUnit compilationUnit = original.getWorkingCopy(pm);
- CDIFileChange fileChange = new CDIFileChange(file);
+ JBDSFileChange fileChange = new JBDSFileChange(file);
MultiTextEdit edit = new MultiTextEdit();
@@ -102,7 +103,7 @@
fileChange.setEdit(edit);
rootChange.add(fileChange);
}
- fileChange = new CDIFileChange(file2);
+ fileChange = new JBDSFileChange(file2);
edit = new MultiTextEdit();
}else{
Deleted: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/CDIFileChange.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/CDIFileChange.java 2011-12-29 19:13:36 UTC (rev 37577)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/CDIFileChange.java 2011-12-29 21:54:07 UTC (rev 37578)
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.cdi.internal.core.refactoring;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.ltk.core.refactoring.Change;
-import org.eclipse.ltk.core.refactoring.MultiStateTextFileChange;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.ltk.core.refactoring.TextChange;
-import org.eclipse.ltk.core.refactoring.TextFileChange;
-import org.eclipse.text.edits.TextEdit;
-import org.eclipse.text.edits.UndoEdit;
-
-public class CDIFileChange extends MultiStateTextFileChange{
- private IFile file;
- private CDITextChange rootChange = null;
-
- public CDIFileChange(IFile file) {
- super(file.getName(), file);
- this.file = file;
- setSaveMode(TextFileChange.LEAVE_DIRTY);
- }
-
- public IFile getFile(){
- return file;
- }
-
- public void setEdit(TextEdit edit) {
- rootChange = new CDITextChange();
- rootChange.setEdit(edit);
- super.addChange(rootChange);
- }
-
- public TextEdit getEdit(){
- return rootChange.getEdit();
- }
-
- public void addEdit(TextEdit edit){
- rootChange.addEdit(edit);
- }
-
- class CDITextChange extends TextChange{
-
- protected CDITextChange() {
- super("");
- }
-
- @Override
- protected IDocument acquireDocument(IProgressMonitor pm)
- throws CoreException {
- return null;
- }
-
- @Override
- protected void commit(IDocument document, IProgressMonitor pm)
- throws CoreException {
- }
-
- @Override
- protected void releaseDocument(IDocument document, IProgressMonitor pm)
- throws CoreException {
- }
-
- @Override
- protected Change createUndoChange(UndoEdit edit) {
- return null;
- }
-
- @Override
- public void initializeValidationData(IProgressMonitor pm) {
- }
-
- @Override
- public RefactoringStatus isValid(IProgressMonitor pm)
- throws CoreException, OperationCanceledException {
- return null;
- }
-
- @Override
- public Object getModifiedElement() {
- return null;
- }
-
- }
-}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/CDIRefactoringProcessor.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/CDIRefactoringProcessor.java 2011-12-29 19:13:36 UTC (rev 37577)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/CDIRefactoringProcessor.java 2011-12-29 21:54:07 UTC (rev 37578)
@@ -25,11 +25,12 @@
import org.jboss.tools.cdi.core.IBean;
import org.jboss.tools.cdi.core.ICDIProject;
import org.jboss.tools.cdi.core.IClassBean;
+import org.jboss.tools.common.refactoring.JBDSFileChange;
public abstract class CDIRefactoringProcessor extends AbstractCDIProcessor {
protected IFile file;
- protected CDIFileChange change;
+ protected JBDSFileChange change;
protected IClassBean bean;
public CDIRefactoringProcessor(IFile file, String label){
@@ -43,7 +44,7 @@
protected void createRootChange(){
rootChange = new CompositeChange(getLabel());
- change = new CDIFileChange(file);
+ change = new JBDSFileChange(file);
MultiTextEdit root = new MultiTextEdit();
change.setEdit(root);
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/CDIRenameProcessor.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/CDIRenameProcessor.java 2011-12-29 19:13:36 UTC (rev 37577)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/CDIRenameProcessor.java 2011-12-29 21:54:07 UTC (rev 37578)
@@ -29,13 +29,14 @@
import org.jboss.tools.common.el.core.model.ELInvocationExpression;
import org.jboss.tools.common.el.core.model.ELPropertyInvocation;
import org.jboss.tools.common.model.project.ProjectHome;
+import org.jboss.tools.common.refactoring.JBDSFileChange;
import org.jboss.tools.jst.web.kb.refactoring.RefactorSearcher;
/**
* @author Daniel Azarov
*/
public abstract class CDIRenameProcessor extends AbstractCDIProcessor {
- protected CDIFileChange lastChange;
+ protected JBDSFileChange lastChange;
protected IFile declarationFile=null;
private String newName;
@@ -84,18 +85,18 @@
}
// lets collect all changes for the same files in one MultiTextEdit
- protected CDIFileChange getChange(IFile file){
+ protected JBDSFileChange getChange(IFile file){
if(lastChange != null && lastChange.getFile().equals(file))
return lastChange;
for(int i=0; i < rootChange.getChildren().length; i++){
- CDIFileChange change = (CDIFileChange)rootChange.getChildren()[i];
+ JBDSFileChange change = (JBDSFileChange)rootChange.getChildren()[i];
if(change.getFile().equals(file)){
lastChange = change;
return lastChange;
}
}
- lastChange = new CDIFileChange(file);
+ lastChange = new JBDSFileChange(file);
MultiTextEdit root = new MultiTextEdit();
lastChange.setEdit(root);
@@ -115,7 +116,7 @@
protected void change(IFile file, int offset, int length, String text){
String key = file.getFullPath().toString()+" "+offset;
if(!keys.contains(key)){
- CDIFileChange change = getChange(file);
+ JBDSFileChange change = getChange(file);
TextEdit edit = new ReplaceEdit(offset, length, text);
change.addEdit(edit);
keys.add(key);
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/AbstractModifyInjectionPointWizard.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/AbstractModifyInjectionPointWizard.java 2011-12-29 19:13:36 UTC (rev 37577)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/AbstractModifyInjectionPointWizard.java 2011-12-29 21:54:07 UTC (rev 37578)
@@ -23,8 +23,9 @@
import org.jboss.tools.cdi.core.IInjectionPoint;
import org.jboss.tools.cdi.internal.core.refactoring.AddQualifiersToBeanProcessor;
import org.jboss.tools.cdi.ui.CDIUIPlugin;
+import org.jboss.tools.common.ui.refactoring.JBDSRefactoringWizard;
-public abstract class AbstractModifyInjectionPointWizard extends CDIRefactoringWizard {
+public abstract class AbstractModifyInjectionPointWizard extends JBDSRefactoringWizard {
public AbstractModifyInjectionPointWizard(ProcessorBasedRefactoring refactoring){
super(refactoring, RefactoringWizard.WIZARD_BASED_USER_INTERFACE);
}
Deleted: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/CDIRefactoringWizard.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/CDIRefactoringWizard.java 2011-12-29 19:13:36 UTC (rev 37577)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/CDIRefactoringWizard.java 2011-12-29 21:54:07 UTC (rev 37578)
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.cdi.ui.wizard;
-
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.ltk.core.refactoring.Refactoring;
-import org.eclipse.ltk.ui.refactoring.RefactoringWizard;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorReference;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-
-public class CDIRefactoringWizard extends RefactoringWizard {
-
- public CDIRefactoringWizard(Refactoring refactoring, int flags) {
- super(refactoring, flags);
- }
-
- @Override
- protected void addUserInputPages() {
- }
-
- @Override
- public boolean performFinish() {
- boolean result = super.performFinish();
-
- saveAllEditors();
-
- return result;
- }
-
- private void saveAllEditors(){
- for(IWorkbenchWindow window : PlatformUI.getWorkbench().getWorkbenchWindows()){
- for(IWorkbenchPage page : window.getPages()){
- for(IEditorReference eReference : page.getEditorReferences()){
- IEditorPart editor = eReference.getEditor(true);
- if(editor != null && editor.isDirty()){
- editor.doSave(new NullProgressMonitor());
- }
- }
- }
- }
- }
-
-}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/DeletePreviewWizard.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/DeletePreviewWizard.java 2011-12-29 19:13:36 UTC (rev 37577)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/DeletePreviewWizard.java 2011-12-29 21:54:07 UTC (rev 37578)
@@ -17,8 +17,9 @@
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
+import org.jboss.tools.common.ui.refactoring.JBDSRefactoringWizard;
-public class DeletePreviewWizard extends CDIRefactoringWizard {
+public class DeletePreviewWizard extends JBDSRefactoringWizard {
public DeletePreviewWizard(Refactoring refactoring) {
super(refactoring, RefactoringWizard.WIZARD_BASED_USER_INTERFACE);
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 2011-12-29 19:13:36 UTC (rev 37577)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java 2011-12-29 21:54:07 UTC (rev 37578)
@@ -19,9 +19,12 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.ltk.core.refactoring.Change;
import org.eclipse.ltk.core.refactoring.CompositeChange;
import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.ltk.core.refactoring.TextFileChange;
import org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor;
+import org.eclipse.text.edits.MultiTextEdit;
import org.eclipse.ui.IMarkerResolution;
import org.eclipse.ui.ide.IDE;
import org.jboss.tools.cdi.core.test.tck.TCKTest;
@@ -43,9 +46,11 @@
import org.jboss.tools.cdi.ui.marker.TestableResolutionWithDialog;
import org.jboss.tools.cdi.ui.marker.TestableResolutionWithRefactoringProcessor;
import org.jboss.tools.common.base.test.validation.TestUtil;
+import org.jboss.tools.common.refactoring.JBDSFileChange;
import org.jboss.tools.common.ui.marker.AddSuppressWarningsMarkerResolution;
import org.jboss.tools.common.ui.marker.ConfigureProblemSeverityMarkerResolution;
import org.jboss.tools.common.util.FileUtil;
+import org.jboss.tools.tests.AbstractRefactorTest.TestChangeStructure;
/**
* @author Daniel Azarov
@@ -125,7 +130,13 @@
assertNull("Rename processor returns fatal error", status.getEntryMatchingSeverity(RefactoringStatus.FATAL));
CompositeChange rootChange = (CompositeChange)processor.createChange(new NullProgressMonitor());
-
+
+ for(Change fileChange : rootChange.getChildren()){
+ if(fileChange instanceof JBDSFileChange){
+ ((JBDSFileChange)fileChange).setSaveMode(TextFileChange.FORCE_SAVE);
+ }
+ }
+
rootChange.perform(new NullProgressMonitor());
} else if(resolution instanceof TestableResolutionWithDialog){
((TestableResolutionWithDialog) resolution).runForTest(marker);
Modified: trunk/common/plugins/org.jboss.tools.common/META-INF/MANIFEST.MF
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/META-INF/MANIFEST.MF 2011-12-29 19:13:36 UTC (rev 37577)
+++ trunk/common/plugins/org.jboss.tools.common/META-INF/MANIFEST.MF 2011-12-29 21:54:07 UTC (rev 37578)
@@ -39,7 +39,8 @@
org.eclipse.jface.text;bundle-version="3.7.0",
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.jpt.common.core;bundle-version="1.0.0",
+ org.eclipse.ltk.core.refactoring;bundle-version="3.5.201"
Bundle-Version: 3.3.0.qualifier
Bundle-ActivationPolicy: lazy
Bundle-ManifestVersion: 2
Copied: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/refactoring/JBDSFileChange.java (from rev 37577, trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/CDIFileChange.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/refactoring/JBDSFileChange.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/refactoring/JBDSFileChange.java 2011-12-29 21:54:07 UTC (rev 37578)
@@ -0,0 +1,97 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.refactoring;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.MultiStateTextFileChange;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.ltk.core.refactoring.TextChange;
+import org.eclipse.ltk.core.refactoring.TextFileChange;
+import org.eclipse.text.edits.TextEdit;
+import org.eclipse.text.edits.UndoEdit;
+
+public class JBDSFileChange extends MultiStateTextFileChange{
+ private IFile file;
+ private JBDSTextChange rootChange = null;
+
+ public JBDSFileChange(IFile file) {
+ super(file.getName(), file);
+ this.file = file;
+ setSaveMode(TextFileChange.LEAVE_DIRTY);
+ }
+
+ public IFile getFile(){
+ return file;
+ }
+
+ public void setEdit(TextEdit edit) {
+ rootChange = new JBDSTextChange();
+ rootChange.setEdit(edit);
+ super.addChange(rootChange);
+ }
+
+ public TextEdit getEdit(){
+ return rootChange.getEdit();
+ }
+
+ public void addEdit(TextEdit edit){
+ rootChange.addEdit(edit);
+ }
+
+ class JBDSTextChange extends TextChange{
+
+ protected JBDSTextChange() {
+ super("");
+ }
+
+ @Override
+ protected IDocument acquireDocument(IProgressMonitor pm)
+ throws CoreException {
+ return null;
+ }
+
+ @Override
+ protected void commit(IDocument document, IProgressMonitor pm)
+ throws CoreException {
+ }
+
+ @Override
+ protected void releaseDocument(IDocument document, IProgressMonitor pm)
+ throws CoreException {
+ }
+
+ @Override
+ protected Change createUndoChange(UndoEdit edit) {
+ return null;
+ }
+
+ @Override
+ public void initializeValidationData(IProgressMonitor pm) {
+ }
+
+ @Override
+ public RefactoringStatus isValid(IProgressMonitor pm)
+ throws CoreException, OperationCanceledException {
+ return null;
+ }
+
+ @Override
+ public Object getModifiedElement() {
+ return null;
+ }
+
+ }
+}
Property changes on: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/refactoring/JBDSFileChange.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
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 2011-12-29 19:13:36 UTC (rev 37577)
+++ trunk/common/plugins/org.jboss.tools.common.ui/META-INF/MANIFEST.MF 2011-12-29 21:54:07 UTC (rev 37578)
@@ -28,12 +28,14 @@
org.eclipse.ui.cheatsheets;bundle-version="3.4.0",
org.eclipse.jdt.core.manipulation;bundle-version="1.4.0",
org.eclipse.ltk.core.refactoring;bundle-version="3.5.200",
- org.eclipse.jpt.common.core;bundle-version="1.0.0"
+ org.eclipse.jpt.common.core;bundle-version="1.0.0",
+ org.eclipse.ltk.ui.refactoring;bundle-version="3.6.0"
Export-Package: org.jboss.tools.common.ui,
org.jboss.tools.common.ui.databinding,
org.jboss.tools.common.ui.marker,
org.jboss.tools.common.ui.preferences,
org.jboss.tools.common.ui.preferencevalue,
+ org.jboss.tools.common.ui.refactoring,
org.jboss.tools.common.ui.ssh,
org.jboss.tools.common.ui.widget.editor,
org.jboss.tools.common.ui.widget.field,
Copied: trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/refactoring/JBDSRefactoringWizard.java (from rev 37577, trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/CDIRefactoringWizard.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/refactoring/JBDSRefactoringWizard.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/refactoring/JBDSRefactoringWizard.java 2011-12-29 21:54:07 UTC (rev 37578)
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.ui.refactoring;
+
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.ltk.core.refactoring.Refactoring;
+import org.eclipse.ltk.ui.refactoring.RefactoringWizard;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IEditorReference;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+
+public class JBDSRefactoringWizard extends RefactoringWizard {
+
+ public JBDSRefactoringWizard(Refactoring refactoring, int flags) {
+ super(refactoring, flags);
+ }
+
+ @Override
+ protected void addUserInputPages() {
+ }
+
+ @Override
+ public boolean performFinish() {
+ boolean result = super.performFinish();
+
+ saveAllEditors();
+
+ return result;
+ }
+
+ private void saveAllEditors(){
+ for(IWorkbenchWindow window : PlatformUI.getWorkbench().getWorkbenchWindows()){
+ for(IWorkbenchPage page : window.getPages()){
+ for(IEditorReference eReference : page.getEditorReferences()){
+ IEditorPart editor = eReference.getEditor(true);
+ if(editor != null && editor.isDirty()){
+ editor.doSave(new NullProgressMonitor());
+ }
+ }
+ }
+ }
+ }
+
+}
Property changes on: trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/refactoring/JBDSRefactoringWizard.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/tests/plugins/org.jboss.tools.tests/META-INF/MANIFEST.MF
===================================================================
--- trunk/tests/plugins/org.jboss.tools.tests/META-INF/MANIFEST.MF 2011-12-29 19:13:36 UTC (rev 37577)
+++ trunk/tests/plugins/org.jboss.tools.tests/META-INF/MANIFEST.MF 2011-12-29 21:54:07 UTC (rev 37578)
@@ -12,7 +12,8 @@
org.apache.xerces;bundle-version="[2.9.0,3.0.0)",
org.eclipse.ltk.core.refactoring;bundle-version="3.5.0",
org.eclipse.text;bundle-version="3.5.0",
- org.eclipse.ui.ide.application;bundle-version="1.0.200"
+ org.eclipse.ui.ide.application;bundle-version="1.0.200",
+ org.jboss.tools.common;bundle-version="3.3.0"
Bundle-ActivationPolicy: lazy
Export-Package: org.jboss.tools.test.resource,
org.jboss.tools.test.util,
Modified: trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests/AbstractRefactorTest.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests/AbstractRefactorTest.java 2011-12-29 19:13:36 UTC (rev 37577)
+++ trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests/AbstractRefactorTest.java 2011-12-29 21:54:07 UTC (rev 37578)
@@ -24,6 +24,7 @@
import org.eclipse.ltk.core.refactoring.participants.RenameParticipant;
import org.eclipse.ltk.core.refactoring.participants.RenameProcessor;
import org.eclipse.text.edits.MultiTextEdit;
+import org.jboss.tools.common.refactoring.JBDSFileChange;
import org.jboss.tools.test.util.JobUtils;
public class AbstractRefactorTest extends TestCase{
@@ -144,13 +145,22 @@
int numberOfChanges = rootChange.getChildren().length;
for(int i = 0; i < rootChange.getChildren().length;i++){
- TextFileChange fileChange = (TextFileChange)rootChange.getChildren()[i];
-
- MultiTextEdit edit = (MultiTextEdit)fileChange.getEdit();
+ Change fileChange = rootChange.getChildren()[i];
+ MultiTextEdit edit = null;
+ IFile file = null;
+ if(fileChange instanceof JBDSFileChange){
+ edit = (MultiTextEdit)((JBDSFileChange)fileChange).getEdit();
+ file = ((JBDSFileChange)fileChange).getFile();
+ ((JBDSFileChange)fileChange).setSaveMode(TextFileChange.FORCE_SAVE);
+ }else if(fileChange instanceof TextFileChange){
+ edit = (MultiTextEdit)((TextFileChange)fileChange).getEdit();
+ file = ((TextFileChange)fileChange).getFile();
+ }
+
//System.out.println("File - "+fileChange.getFile().getFullPath()+" offset - "+edit.getOffset());
- TestChangeStructure change = findChange(changeList, fileChange.getFile());
+ TestChangeStructure change = findChange(changeList, file);
if(change != null){
assertEquals(change.size(), edit.getChildrenSize());
}
12 years, 12 months
JBoss Tools SVN: r37577 - in trunk/cdi/plugins: org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2011-12-29 14:13:36 -0500 (Thu, 29 Dec 2011)
New Revision: 37577
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/CDIRefactoringWizard.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/CDIFileChange.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/AbstractModifyInjectionPointWizard.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/DeletePreviewWizard.java
Log:
Java Seam and CDI quick fixes: after quick fix, editor is scrolled to the beginning. If Undo/Redo commands are used, the entire file content gets selected https://issues.jboss.org/browse/JBIDE-10536
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/CDIFileChange.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/CDIFileChange.java 2011-12-29 18:36:20 UTC (rev 37576)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/CDIFileChange.java 2011-12-29 19:13:36 UTC (rev 37577)
@@ -30,7 +30,7 @@
public CDIFileChange(IFile file) {
super(file.getName(), file);
this.file = file;
- setSaveMode(TextFileChange.FORCE_SAVE);
+ setSaveMode(TextFileChange.LEAVE_DIRTY);
}
public IFile getFile(){
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/AbstractModifyInjectionPointWizard.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/AbstractModifyInjectionPointWizard.java 2011-12-29 18:36:20 UTC (rev 37576)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/AbstractModifyInjectionPointWizard.java 2011-12-29 19:13:36 UTC (rev 37577)
@@ -24,7 +24,7 @@
import org.jboss.tools.cdi.internal.core.refactoring.AddQualifiersToBeanProcessor;
import org.jboss.tools.cdi.ui.CDIUIPlugin;
-public abstract class AbstractModifyInjectionPointWizard extends RefactoringWizard {
+public abstract class AbstractModifyInjectionPointWizard extends CDIRefactoringWizard {
public AbstractModifyInjectionPointWizard(ProcessorBasedRefactoring refactoring){
super(refactoring, RefactoringWizard.WIZARD_BASED_USER_INTERFACE);
}
Added: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/CDIRefactoringWizard.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/CDIRefactoringWizard.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/CDIRefactoringWizard.java 2011-12-29 19:13:36 UTC (rev 37577)
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.ui.wizard;
+
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.ltk.core.refactoring.Refactoring;
+import org.eclipse.ltk.ui.refactoring.RefactoringWizard;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IEditorReference;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+
+public class CDIRefactoringWizard extends RefactoringWizard {
+
+ public CDIRefactoringWizard(Refactoring refactoring, int flags) {
+ super(refactoring, flags);
+ }
+
+ @Override
+ protected void addUserInputPages() {
+ }
+
+ @Override
+ public boolean performFinish() {
+ boolean result = super.performFinish();
+
+ saveAllEditors();
+
+ return result;
+ }
+
+ private void saveAllEditors(){
+ for(IWorkbenchWindow window : PlatformUI.getWorkbench().getWorkbenchWindows()){
+ for(IWorkbenchPage page : window.getPages()){
+ for(IEditorReference eReference : page.getEditorReferences()){
+ IEditorPart editor = eReference.getEditor(true);
+ if(editor != null && editor.isDirty()){
+ editor.doSave(new NullProgressMonitor());
+ }
+ }
+ }
+ }
+ }
+
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/CDIRefactoringWizard.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/DeletePreviewWizard.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/DeletePreviewWizard.java 2011-12-29 18:36:20 UTC (rev 37576)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/DeletePreviewWizard.java 2011-12-29 19:13:36 UTC (rev 37577)
@@ -18,7 +18,7 @@
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
-public class DeletePreviewWizard extends RefactoringWizard {
+public class DeletePreviewWizard extends CDIRefactoringWizard {
public DeletePreviewWizard(Refactoring refactoring) {
super(refactoring, RefactoringWizard.WIZARD_BASED_USER_INTERFACE);
12 years, 12 months
JBoss Tools SVN: r37576 - trunk/common/site.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2011-12-29 13:36:20 -0500 (Thu, 29 Dec 2011)
New Revision: 37576
Added:
trunk/common/site/.project
Log:
.project for common component update site
Added: trunk/common/site/.project
===================================================================
--- trunk/common/site/.project (rev 0)
+++ trunk/common/site/.project 2011-12-29 18:36:20 UTC (rev 37576)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.common.site</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ </buildSpec>
+ <natures>
+ </natures>
+</projectDescription>
Property changes on: trunk/common/site/.project
___________________________________________________________________
Added: svn:mime-type
+ text/plain
12 years, 12 months
JBoss Tools SVN: r37575 - trunk/build/parent.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2011-12-28 20:44:14 -0500 (Wed, 28 Dec 2011)
New Revision: 37575
Modified:
trunk/build/parent/pom.xml
Log:
https://issues.jboss.org/browse/JBIDE-10529 test failure in common.verification
fixed coverage report generation to be aware of that coverage could be enabled for plugins that have no classes to test.
Modified: trunk/build/parent/pom.xml
===================================================================
--- trunk/build/parent/pom.xml 2011-12-29 01:24:23 UTC (rev 37574)
+++ trunk/build/parent/pom.xml 2011-12-29 01:44:14 UTC (rev 37575)
@@ -629,10 +629,16 @@
<html outfile="${project.build.directory}/emma/coverage.html" />
</report>
</emma>
- <loadfile property="emma.txt"
- srcFile="${project.build.directory}/emma/coverage.txt"
- failonerror="false" />
- <echo>${emma.txt}</echo>
+ <if>
+ <available file="${project.build.directory}/emma/coverage.txt" type="file" />
+ <then>
+ <loadfile property="emma.txt" srcFile="${project.build.directory}/emma/coverage.txt" failonerror="false" />
+ <echo>${emma.txt}</echo>
+ </then>
+ <else>
+ <echo>No coverage report found </echo>
+ </else>
+ </if>
</then>
</if>
</tasks>
12 years, 12 months
JBoss Tools SVN: r37574 - trunk/common/tests/org.jboss.tools.common.ui.test.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2011-12-28 20:24:23 -0500 (Wed, 28 Dec 2011)
New Revision: 37574
Modified:
trunk/common/tests/org.jboss.tools.common.ui.test/pom.xml
Log:
https://issues.jboss.org/browse/JBIDE-10529 test failure in common.verification
fixed coverage configuration for common.ui.test by adding bundles that should be covered
Modified: trunk/common/tests/org.jboss.tools.common.ui.test/pom.xml
===================================================================
--- trunk/common/tests/org.jboss.tools.common.ui.test/pom.xml 2011-12-29 01:12:32 UTC (rev 37573)
+++ trunk/common/tests/org.jboss.tools.common.ui.test/pom.xml 2011-12-29 01:24:23 UTC (rev 37574)
@@ -9,4 +9,8 @@
<groupId>org.jboss.tools.common.tests</groupId>
<artifactId>org.jboss.tools.common.ui.test</artifactId>
<packaging>eclipse-test-plugin</packaging>
+
+ <properties>
+ <emma.instrument.bundles>org.jboss.tools.common.ui,org.jboss.tools.common,org.jboss.tools.common.validation,org.jboss.tools.common.el.core,org.jboss.tools.common.resref.core</emma.instrument.bundles>
+ </properties>
</project>
12 years, 12 months
JBoss Tools SVN: r37573 - in trunk: common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui and 8 other directories.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2011-12-28 20:12:32 -0500 (Wed, 28 Dec 2011)
New Revision: 37573
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIValidatorPreferencePage.java
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/marker/ConfigureProblemSeverityMarkerResolution.java
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/messages.properties
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/preferences/SeverityPreferencePage.java
trunk/esb/plugins/org.jboss.tools.esb.validator/src/org/jboss/tools/esb/validator/ui/ESBConfigurationBlock.java
trunk/esb/plugins/org.jboss.tools.esb.validator/src/org/jboss/tools/esb/validator/ui/ESBValidatorPreferencePage.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences/JSFValidationConfigurationBlock.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences/JSFValidationPreferencePage.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/preferences/KBValidationConfigurationBlock.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/preferences/KBValidationPreferencePage.java
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/ELValidatorConfigurationBlock.java
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/ELValidatorPreferencePage.java
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/WebXMLConfigurationBlock.java
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/WebXMLValidatorPreferencePage.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamValidatorConfigurationBlock.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamValidatorPreferencePage.java
trunk/struts/plugins/org.jboss.tools.struts.ui/src/org/jboss/tools/struts/ui/preferences/StrutsConfigConfigurationBlock.java
trunk/struts/plugins/org.jboss.tools.struts.ui/src/org/jboss/tools/struts/ui/preferences/StrutsConfigValidatorPreferencePage.java
Log:
"Configure Problem Severity" quick fix label should contain property name https://issues.jboss.org/browse/JBIDE-10568
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIValidatorPreferencePage.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIValidatorPreferencePage.java 2011-12-29 00:56:12 UTC (rev 37572)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIValidatorPreferencePage.java 2011-12-29 01:12:32 UTC (rev 37573)
@@ -15,6 +15,7 @@
import org.jboss.tools.cdi.core.CDICorePlugin;
import org.jboss.tools.cdi.internal.core.validation.CDICoreValidator;
import org.jboss.tools.common.ui.preferences.SeverityPreferencePage;
+import org.jboss.tools.common.ui.preferences.SeverityConfigurationBlock.SectionDescription;
/**
* @author Alexey Kazakov
@@ -52,4 +53,9 @@
super.createControl(parent);
}
+
+ @Override
+ protected SectionDescription[] getAllSections() {
+ return CDIConfigurationBlockDescriptionProvider.getInstance().getSections();
+ }
}
\ No newline at end of file
Modified: trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/marker/ConfigureProblemSeverityMarkerResolution.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/marker/ConfigureProblemSeverityMarkerResolution.java 2011-12-29 00:56:12 UTC (rev 37572)
+++ trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/marker/ConfigureProblemSeverityMarkerResolution.java 2011-12-29 01:12:32 UTC (rev 37573)
@@ -10,6 +10,9 @@
******************************************************************************/
package org.jboss.tools.common.ui.marker;
+import java.util.Iterator;
+import java.util.List;
+
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@@ -18,27 +21,39 @@
import org.eclipse.debug.internal.ui.DebugUIPlugin;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.JavaPluginImages;
+import org.eclipse.jface.preference.IPreferenceNode;
+import org.eclipse.jface.preference.PreferenceManager;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.IMarkerResolution2;
+import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.dialogs.PreferencesUtil;
+import org.eclipse.ui.internal.dialogs.WorkbenchPreferenceNode;
import org.eclipse.ui.progress.UIJob;
import org.jboss.tools.common.ui.CommonUIMessages;
+import org.jboss.tools.common.ui.preferences.SeverityPreferencePage;
/**
* @author Daniel Azarov
*/
public class ConfigureProblemSeverityMarkerResolution implements
IMarkerResolution2 {
+ private static final int PREFERENCE_SIZE = 40;
+ private static final String DOTS = "...";
+
private String preferencePageId;
private String preferenceKey;
+ private String label;
public ConfigureProblemSeverityMarkerResolution(String preferencePageId, String preferenceKey){
this.preferencePageId = preferencePageId;
this.preferenceKey = preferenceKey;
+ String preferenceName = getPreferenceLabel();
+ label = NLS.bind(CommonUIMessages.CONFIGURE_PROBLEM_SEVERITY, preferenceName);
}
public String getLabel() {
- return CommonUIMessages.CONFIGURE_PROBLEM_SEVERITY;
+ return label;
}
public void run(IMarker marker) {
@@ -57,11 +72,44 @@
}
public String getDescription() {
- return CommonUIMessages.CONFIGURE_PROBLEM_SEVERITY;
+ return label;
}
public Image getImage() {
return JavaPlugin.getImageDescriptorRegistry().get(JavaPluginImages.DESC_ELCL_CONFIGURE_PROBLEM_SEVERITIES);
}
-
+
+ private WorkbenchPreferenceNode findPageNode() {
+ final PreferenceManager preferenceManager = PlatformUI.getWorkbench()
+ .getPreferenceManager();
+ List nodes = preferenceManager.getElements(PreferenceManager.POST_ORDER);
+ for (Iterator i = nodes.iterator(); i.hasNext();) {
+ IPreferenceNode node = (IPreferenceNode) i.next();
+ if (node.getId().equals(preferencePageId)) {
+ return (WorkbenchPreferenceNode)node;
+ }
+ }
+ return null;
+ }
+
+ private String getPreferenceLabel() {
+ WorkbenchPreferenceNode pageNode = findPageNode();
+ pageNode.createPage();
+ if(pageNode != null && pageNode.getPage() instanceof SeverityPreferencePage){
+ SeverityPreferencePage page = (SeverityPreferencePage)pageNode.getPage();
+ return cut(page.getLabel(preferenceKey));
+ }
+ return null;
+ }
+
+ private String cut(String label){
+ if(label.length() > PREFERENCE_SIZE){
+ return label.substring(0, PREFERENCE_SIZE-1)+DOTS;
+ }else{
+ if(label.endsWith(":")){
+ return label.substring(0, label.length()-1);
+ }
+ return label;
+ }
+ }
}
Modified: trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/messages.properties
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/messages.properties 2011-12-29 00:56:12 UTC (rev 37572)
+++ trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/messages.properties 2011-12-29 01:12:32 UTC (rev 37573)
@@ -33,7 +33,7 @@
URLSTRINGVALIDATOR_NOT_A_VALID_URL=\"{0}\" is not a valid url.
MANDATORYSTRING_VALIDATOR_MUST_PROVIDE_VALUE=You have to provide a {0}.
-CONFIGURE_PROBLEM_SEVERITY=Configure Problem Severity
+CONFIGURE_PROBLEM_SEVERITY=Configure Problem Severity for preference ''{0}''
ADD_SUPPRESS_WARNINGS_TITLE=Add @SuppressWarnings ''{0}'' to ''{1}''
ADD_SUPPRESS_WARNINGS_MESSAGE=This quick fix uses warning names that are not supported by The Java Validator and will cause \"Unsupported @SuppressWarning\" problem message.\n\n
ADD_SUPPRESS_WARNINGS_QUESTION1=Do you want to disable 'Unsupported @SuppressWarnings' validation?
Modified: trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/preferences/SeverityPreferencePage.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/preferences/SeverityPreferencePage.java 2011-12-29 00:56:12 UTC (rev 37572)
+++ trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/preferences/SeverityPreferencePage.java 2011-12-29 01:12:32 UTC (rev 37573)
@@ -24,6 +24,8 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.jboss.tools.common.preferences.SeverityPreferences;
+import org.jboss.tools.common.ui.preferences.SeverityConfigurationBlock.OptionDescription;
+import org.jboss.tools.common.ui.preferences.SeverityConfigurationBlock.SectionDescription;
/**
* @author Viacheslav Kabanovich
@@ -156,6 +158,33 @@
}
}
+ public String getLabel(String preferenceId){
+ for(SectionDescription section : getAllSections()){
+ String label = getLabel(section, preferenceId);
+ if(label != null){
+ return label;
+ }
+ }
+ return "";
+ }
+
+ private String getLabel(SectionDescription section, String preferenceId){
+ for(OptionDescription option : section.getOptions()){
+ if(option.key.getName().equals(preferenceId)){
+ return option.label;
+ }
+ }
+ for(SectionDescription s : section.getSections()){
+ String label = getLabel(s, preferenceId);
+ if(label != null){
+ return label;
+ }
+ }
+ return null;
+ }
+
+ protected abstract SectionDescription[] getAllSections();
+
@Override
public void applyData(Object data) {
if(data instanceof String){
Modified: trunk/esb/plugins/org.jboss.tools.esb.validator/src/org/jboss/tools/esb/validator/ui/ESBConfigurationBlock.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.validator/src/org/jboss/tools/esb/validator/ui/ESBConfigurationBlock.java 2011-12-29 00:56:12 UTC (rev 37572)
+++ trunk/esb/plugins/org.jboss.tools.esb.validator/src/org/jboss/tools/esb/validator/ui/ESBConfigurationBlock.java 2011-12-29 01:12:32 UTC (rev 37573)
@@ -45,7 +45,7 @@
ESBValidatorPlugin.PLUGIN_ID
);
- private static SectionDescription[] ALL_SECTIONS = new SectionDescription[]{
+ public static SectionDescription[] ALL_SECTIONS = new SectionDescription[]{
SECTION_CHANNEL_ID_REF,
SECTION_ACTION_DEFINITIONS,
};
Modified: trunk/esb/plugins/org.jboss.tools.esb.validator/src/org/jboss/tools/esb/validator/ui/ESBValidatorPreferencePage.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.validator/src/org/jboss/tools/esb/validator/ui/ESBValidatorPreferencePage.java 2011-12-29 00:56:12 UTC (rev 37572)
+++ trunk/esb/plugins/org.jboss.tools.esb.validator/src/org/jboss/tools/esb/validator/ui/ESBValidatorPreferencePage.java 2011-12-29 01:12:32 UTC (rev 37573)
@@ -13,6 +13,7 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
import org.jboss.tools.common.ui.preferences.SeverityPreferencePage;
+import org.jboss.tools.common.ui.preferences.SeverityConfigurationBlock.SectionDescription;
import org.jboss.tools.esb.validator.ESBCoreValidator;
import org.jboss.tools.esb.validator.ESBValidatorPlugin;
@@ -52,4 +53,9 @@
super.createControl(parent);
}
+
+ @Override
+ protected SectionDescription[] getAllSections() {
+ return ESBConfigurationBlock.ALL_SECTIONS;
+ }
}
\ No newline at end of file
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences/JSFValidationConfigurationBlock.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences/JSFValidationConfigurationBlock.java 2011-12-29 00:56:12 UTC (rev 37572)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences/JSFValidationConfigurationBlock.java 2011-12-29 01:12:32 UTC (rev 37573)
@@ -152,7 +152,7 @@
JSFModelPlugin.PLUGIN_ID
);
- private static SectionDescription[] ALL_SECTIONS = new SectionDescription[] {
+ public static SectionDescription[] ALL_SECTIONS = new SectionDescription[] {
SECTION_COMPOSITE_COMPONENTS,
SECTION_FACES_CONFIG
};
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences/JSFValidationPreferencePage.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences/JSFValidationPreferencePage.java 2011-12-29 00:56:12 UTC (rev 37572)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences/JSFValidationPreferencePage.java 2011-12-29 01:12:32 UTC (rev 37573)
@@ -13,6 +13,7 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
import org.jboss.tools.common.ui.preferences.SeverityPreferencePage;
+import org.jboss.tools.common.ui.preferences.SeverityConfigurationBlock.SectionDescription;
import org.jboss.tools.jsf.JSFModelPlugin;
import org.jboss.tools.jsf.web.validation.composite.CompositeComponentValidator;
@@ -56,4 +57,9 @@
super.createControl(parent);
}
+
+ @Override
+ protected SectionDescription[] getAllSections() {
+ return JSFValidationConfigurationBlock.ALL_SECTIONS;
+ }
}
\ No newline at end of file
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/preferences/KBValidationConfigurationBlock.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/preferences/KBValidationConfigurationBlock.java 2011-12-29 00:56:12 UTC (rev 37572)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/preferences/KBValidationConfigurationBlock.java 2011-12-29 01:12:32 UTC (rev 37573)
@@ -35,7 +35,7 @@
WebKbPlugin.PLUGIN_ID
);
- private static SectionDescription[] ALL_SECTIONS = new SectionDescription[]{
+ public static SectionDescription[] ALL_SECTIONS = new SectionDescription[]{
SECTION_KB_CONFIG,
};
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/preferences/KBValidationPreferencePage.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/preferences/KBValidationPreferencePage.java 2011-12-29 00:56:12 UTC (rev 37572)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/preferences/KBValidationPreferencePage.java 2011-12-29 01:12:32 UTC (rev 37573)
@@ -14,6 +14,7 @@
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
import org.jboss.tools.common.ui.preferences.SeverityPreferencePage;
+import org.jboss.tools.common.ui.preferences.SeverityConfigurationBlock.SectionDescription;
import org.jboss.tools.jst.web.kb.WebKbPlugin;
/**
@@ -49,4 +50,9 @@
protected String getPropertyPageID() {
return PROP_ID;
}
+
+ @Override
+ protected SectionDescription[] getAllSections() {
+ return KBValidationConfigurationBlock.ALL_SECTIONS;
+ }
}
\ No newline at end of file
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/ELValidatorConfigurationBlock.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/ELValidatorConfigurationBlock.java 2011-12-29 00:56:12 UTC (rev 37572)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/ELValidatorConfigurationBlock.java 2011-12-29 01:12:32 UTC (rev 37573)
@@ -62,7 +62,7 @@
WebKbPlugin.PLUGIN_ID
);
- private static SectionDescription[] ALL_SECTIONS = new SectionDescription[]{
+ public static SectionDescription[] ALL_SECTIONS = new SectionDescription[]{
SECTION_EL,
};
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/ELValidatorPreferencePage.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/ELValidatorPreferencePage.java 2011-12-29 00:56:12 UTC (rev 37572)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/ELValidatorPreferencePage.java 2011-12-29 01:12:32 UTC (rev 37573)
@@ -13,6 +13,7 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
import org.jboss.tools.common.ui.preferences.SeverityPreferencePage;
+import org.jboss.tools.common.ui.preferences.SeverityConfigurationBlock.SectionDescription;
import org.jboss.tools.jst.web.kb.WebKbPlugin;
import org.jboss.tools.jst.web.kb.internal.validation.ELValidator;
@@ -45,4 +46,9 @@
super.createControl(parent);
}
+
+ @Override
+ protected SectionDescription[] getAllSections() {
+ return ELValidatorConfigurationBlock.ALL_SECTIONS;
+ }
}
\ No newline at end of file
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/WebXMLConfigurationBlock.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/WebXMLConfigurationBlock.java 2011-12-29 00:56:12 UTC (rev 37572)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/WebXMLConfigurationBlock.java 2011-12-29 01:12:32 UTC (rev 37573)
@@ -66,7 +66,7 @@
WebModelPlugin.PLUGIN_ID
);
- private static SectionDescription[] ALL_SECTIONS = new SectionDescription[]{
+ public static SectionDescription[] ALL_SECTIONS = new SectionDescription[]{
SECTION_CLASS_REFERENCES,
SECTION_RESOURCE_REFERENCES,
SECTION_OBJECT_REFERENCES,
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/WebXMLValidatorPreferencePage.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/WebXMLValidatorPreferencePage.java 2011-12-29 00:56:12 UTC (rev 37572)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/WebXMLValidatorPreferencePage.java 2011-12-29 01:12:32 UTC (rev 37573)
@@ -13,6 +13,7 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
import org.jboss.tools.common.ui.preferences.SeverityPreferencePage;
+import org.jboss.tools.common.ui.preferences.SeverityConfigurationBlock.SectionDescription;
import org.jboss.tools.jst.web.WebModelPlugin;
import org.jboss.tools.jst.web.validation.WebXMLCoreValidator;
@@ -52,4 +53,9 @@
super.createControl(parent);
}
+
+ @Override
+ protected SectionDescription[] getAllSections() {
+ return WebXMLConfigurationBlock.ALL_SECTIONS;
+ }
}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamValidatorConfigurationBlock.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamValidatorConfigurationBlock.java 2011-12-29 00:56:12 UTC (rev 37572)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamValidatorConfigurationBlock.java 2011-12-29 01:12:32 UTC (rev 37573)
@@ -126,7 +126,7 @@
SeamCorePlugin.PLUGIN_ID
);
- private static SectionDescription[] ALL_SECTIONS = new SectionDescription[]{
+ public static SectionDescription[] ALL_SECTIONS = new SectionDescription[]{
SECTION_COMPONENT,
SECTION_ENTITY,
SECTION_LIFECYCLE,
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamValidatorPreferencePage.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamValidatorPreferencePage.java 2011-12-29 00:56:12 UTC (rev 37572)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamValidatorPreferencePage.java 2011-12-29 01:12:32 UTC (rev 37573)
@@ -14,6 +14,7 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
import org.jboss.tools.common.ui.preferences.SeverityPreferencePage;
+import org.jboss.tools.common.ui.preferences.SeverityConfigurationBlock.SectionDescription;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.internal.core.validation.SeamValidationErrorManager;
@@ -46,4 +47,9 @@
super.createControl(parent);
}
+
+ @Override
+ protected SectionDescription[] getAllSections() {
+ return SeamValidatorConfigurationBlock.ALL_SECTIONS;
+ }
}
\ No newline at end of file
Modified: trunk/struts/plugins/org.jboss.tools.struts.ui/src/org/jboss/tools/struts/ui/preferences/StrutsConfigConfigurationBlock.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts.ui/src/org/jboss/tools/struts/ui/preferences/StrutsConfigConfigurationBlock.java 2011-12-29 00:56:12 UTC (rev 37572)
+++ trunk/struts/plugins/org.jboss.tools.struts.ui/src/org/jboss/tools/struts/ui/preferences/StrutsConfigConfigurationBlock.java 2011-12-29 01:12:32 UTC (rev 37573)
@@ -18,9 +18,7 @@
import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
import org.jboss.tools.common.preferences.SeverityPreferences;
import org.jboss.tools.common.ui.preferences.SeverityConfigurationBlock;
-import org.jboss.tools.common.ui.preferences.SeverityConfigurationBlock.SectionDescription;
import org.jboss.tools.jst.web.ui.WebUiPlugin;
-import org.jboss.tools.jst.web.validation.WebXMLPreferences;
import org.jboss.tools.struts.StrutsModelPlugin;
import org.jboss.tools.struts.validation.StrutsPreferences;
@@ -56,7 +54,7 @@
StrutsModelPlugin.PLUGIN_ID
);
- private static SectionDescription[] ALL_SECTIONS = new SectionDescription[]{
+ public static SectionDescription[] ALL_SECTIONS = new SectionDescription[]{
SECTION_STRUTS_CONFIG,
SECTION_WEB_XML,
};
Modified: trunk/struts/plugins/org.jboss.tools.struts.ui/src/org/jboss/tools/struts/ui/preferences/StrutsConfigValidatorPreferencePage.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts.ui/src/org/jboss/tools/struts/ui/preferences/StrutsConfigValidatorPreferencePage.java 2011-12-29 00:56:12 UTC (rev 37572)
+++ trunk/struts/plugins/org.jboss.tools.struts.ui/src/org/jboss/tools/struts/ui/preferences/StrutsConfigValidatorPreferencePage.java 2011-12-29 01:12:32 UTC (rev 37573)
@@ -13,6 +13,7 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
import org.jboss.tools.common.ui.preferences.SeverityPreferencePage;
+import org.jboss.tools.common.ui.preferences.SeverityConfigurationBlock.SectionDescription;
import org.jboss.tools.struts.StrutsModelPlugin;
import org.jboss.tools.struts.validation.StrutsCoreValidator;
@@ -52,4 +53,9 @@
super.createControl(parent);
}
+
+ @Override
+ protected SectionDescription[] getAllSections() {
+ return StrutsConfigConfigurationBlock.ALL_SECTIONS;
+ }
}
\ No newline at end of file
12 years, 12 months