JBoss Tools SVN: r27589 - in trunk/jbpm/plugins/org.jbpm.gd.jpdl: src/org/jbpm/gd/jpdl and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2010-12-17 10:05:26 -0500 (Fri, 17 Dec 2010)
New Revision: 27589
Modified:
trunk/jbpm/plugins/org.jbpm.gd.jpdl/plugin.xml
trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/StartupClass.java
trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/prefs/Jbpm3PreferencesManager.java
trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/util/JbpmClasspathContainerInitializer.java
Log:
try to fix classpath init when converting from old workspace
Modified: trunk/jbpm/plugins/org.jbpm.gd.jpdl/plugin.xml
===================================================================
--- trunk/jbpm/plugins/org.jbpm.gd.jpdl/plugin.xml 2010-12-17 14:20:17 UTC (rev 27588)
+++ trunk/jbpm/plugins/org.jbpm.gd.jpdl/plugin.xml 2010-12-17 15:05:26 UTC (rev 27589)
@@ -1574,9 +1574,9 @@
</editorContribution>
</extension>
- <extension point="org.eclipse.ui.startup">
+<!-- <extension point="org.eclipse.ui.startup">
<startup class="org.jbpm.gd.jpdl.StartupClass"/>
- </extension>
+ </extension> -->
<extension
point="org.eclipse.core.runtime.preferences">
Modified: trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/StartupClass.java
===================================================================
--- trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/StartupClass.java 2010-12-17 14:20:17 UTC (rev 27588)
+++ trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/StartupClass.java 2010-12-17 15:05:26 UTC (rev 27589)
@@ -7,7 +7,7 @@
public void earlyStartup() {
// Reference the Jbpm3PreferencesManager to trigger the initialization.
- Jbpm3PreferencesManager.INSTANCE.toString();
+// Jbpm3PreferencesManager.INSTANCE.toString();
}
}
Modified: trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/prefs/Jbpm3PreferencesManager.java
===================================================================
--- trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/prefs/Jbpm3PreferencesManager.java 2010-12-17 14:20:17 UTC (rev 27588)
+++ trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/prefs/Jbpm3PreferencesManager.java 2010-12-17 15:05:26 UTC (rev 27589)
@@ -29,8 +29,15 @@
public class Jbpm3PreferencesManager extends PreferencesManager {
- public static final Jbpm3PreferencesManager INSTANCE = new Jbpm3PreferencesManager();
-
+ private static Jbpm3PreferencesManager INSTANCE = new Jbpm3PreferencesManager();
+
+ public static PreferencesManager getInstance() {
+ if (INSTANCE == null) {
+ INSTANCE = new Jbpm3PreferencesManager();
+ }
+ return INSTANCE;
+ }
+
protected void initialize() {
File installationsFile =
Plugin.getDefault().getStateLocation().append("jbpm-installations.xml").toFile();
@@ -41,6 +48,7 @@
loadInstallations();
}
installationsFile.delete();
+ super.initialize();
}
@SuppressWarnings("deprecation")
Modified: trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/util/JbpmClasspathContainerInitializer.java
===================================================================
--- trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/util/JbpmClasspathContainerInitializer.java 2010-12-17 14:20:17 UTC (rev 27588)
+++ trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/util/JbpmClasspathContainerInitializer.java 2010-12-17 15:05:26 UTC (rev 27589)
@@ -28,15 +28,15 @@
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;
import org.jboss.tools.jbpm.preferences.JbpmInstallation;
-import org.jboss.tools.jbpm.preferences.PreferencesManager;
import org.jbpm.gd.jpdl.Logger;
+import org.jbpm.gd.jpdl.prefs.Jbpm3PreferencesManager;
public class JbpmClasspathContainerInitializer extends
ClasspathContainerInitializer {
private JbpmInstallation getJbpmInstallation(IPath containerPath) {
String jbpmInstallationName = containerPath.lastSegment();
- return PreferencesManager.getInstance().getJbpmInstallation(jbpmInstallationName);
+ return Jbpm3PreferencesManager.getInstance().getJbpmInstallation(jbpmInstallationName);
}
public void initialize(IPath containerPath, IJavaProject project) throws CoreException {
14 years
JBoss Tools SVN: r27588 - in trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng: xpl and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2010-12-17 09:20:17 -0500 (Fri, 17 Dec 2010)
New Revision: 27588
Added:
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/xpl/CheckedTreeSelectionDialog.java
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/TablePropertiesBlock.java
Log:
https://issues.jboss.org/browse/JBIDE-7910
Do not check whether Elements list is empty (this calls getting metadata from db in background)
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/TablePropertiesBlock.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/TablePropertiesBlock.java 2010-12-17 12:55:16 UTC (rev 27587)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/TablePropertiesBlock.java 2010-12-17 14:20:17 UTC (rev 27588)
@@ -48,7 +48,6 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.ui.dialogs.CheckedTreeSelectionDialog;
import org.eclipse.ui.forms.DetailsPart;
import org.eclipse.ui.forms.IManagedForm;
import org.eclipse.ui.forms.MasterDetailsBlock;
@@ -68,6 +67,7 @@
import org.hibernate.eclipse.console.workbench.xpl.AnyAdaptableLabelProvider;
import org.hibernate.eclipse.mapper.MapperMessages;
import org.hibernate.eclipse.mapper.editors.ReverseEngineeringEditor;
+import org.hibernate.eclipse.mapper.editors.reveng.xpl.CheckedTreeSelectionDialog;
import org.hibernate.eclipse.mapper.model.RevEngColumnAdapter;
import org.hibernate.eclipse.mapper.model.RevEngGeneratorAdapter;
import org.hibernate.eclipse.mapper.model.RevEngParamAdapter;
@@ -346,6 +346,9 @@
return buttonComposite;
}
+ protected boolean evaluateIfTreeEmpty(Object input) {
+ return false;
+ }
};
}
Added: trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/xpl/CheckedTreeSelectionDialog.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/xpl/CheckedTreeSelectionDialog.java (rev 0)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/xpl/CheckedTreeSelectionDialog.java 2010-12-17 14:20:17 UTC (rev 27588)
@@ -0,0 +1,410 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are 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:
+ * IBM Corporation - initial API and implementation
+ * Sebastian Davids <sdavids(a)gmx.de> - Fix for bug 19346 - Dialog font should be
+ * activated and used by other components.
+ * Lubomir Marinov <lubomir.marinov(a)gmail.com> - Fix for bug 182122 -[Dialogs]
+ * CheckedTreeSelectionDialog#createSelectionButtons(Composite) fails to
+ * align the selection buttons to the right
+ * Dmitry Geraskov - made evaluateIfTreeEmpty method protected.
+ *******************************************************************************/
+package org.hibernate.eclipse.mapper.editors.reveng.xpl;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.viewers.CheckStateChangedEvent;
+import org.eclipse.jface.viewers.CheckboxTreeViewer;
+import org.eclipse.jface.viewers.ICheckStateListener;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.ViewerComparator;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.BusyIndicator;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.ContainerCheckedTreeViewer;
+import org.eclipse.ui.dialogs.ISelectionStatusValidator;
+import org.eclipse.ui.dialogs.SelectionStatusDialog;
+import org.eclipse.ui.internal.WorkbenchMessages;
+
+/**
+ * A class to select elements out of a tree structure.
+ *
+ * @since 2.0
+ */
+public class CheckedTreeSelectionDialog extends SelectionStatusDialog {
+ private CheckboxTreeViewer fViewer;
+
+ private ILabelProvider fLabelProvider;
+
+ private ITreeContentProvider fContentProvider;
+
+ private ISelectionStatusValidator fValidator = null;
+
+ private ViewerComparator fComparator;
+
+ private String fEmptyListMessage = WorkbenchMessages.CheckedTreeSelectionDialog_nothing_available;
+
+ private IStatus fCurrStatus = new Status(IStatus.OK, PlatformUI.PLUGIN_ID,
+ 0, "", null); //$NON-NLS-1$
+
+ private List fFilters;
+
+ private Object fInput;
+
+ private boolean fIsEmpty;
+
+ private int fWidth = 60;
+
+ private int fHeight = 18;
+
+ private boolean fContainerMode;
+
+ private Object[] fExpandedElements;
+
+ /**
+ * Constructs an instance of <code>ElementTreeSelectionDialog</code>.
+ *
+ * @param parent
+ * The shell to parent from.
+ * @param labelProvider
+ * the label provider to render the entries
+ * @param contentProvider
+ * the content provider to evaluate the tree structure
+ */
+ public CheckedTreeSelectionDialog(Shell parent,
+ ILabelProvider labelProvider, ITreeContentProvider contentProvider) {
+ super(parent);
+ fLabelProvider = labelProvider;
+ fContentProvider = contentProvider;
+ setResult(new ArrayList(0));
+ setStatusLineAboveButtons(true);
+ fContainerMode = false;
+ fExpandedElements = null;
+ }
+
+ /**
+ * If set, the checked /gray state of containers (inner nodes) is derived
+ * from the checked state of its leaf nodes.
+ *
+ * @param containerMode
+ * The containerMode to set
+ */
+ public void setContainerMode(boolean containerMode) {
+ fContainerMode = containerMode;
+ }
+
+ /**
+ * Sets the initial selection. Convenience method.
+ *
+ * @param selection
+ * the initial selection.
+ */
+ public void setInitialSelection(Object selection) {
+ setInitialSelections(new Object[] { selection });
+ }
+
+ /**
+ * Sets the message to be displayed if the list is empty.
+ *
+ * @param message
+ * the message to be displayed.
+ */
+ public void setEmptyListMessage(String message) {
+ fEmptyListMessage = message;
+ }
+
+ /**
+ * Sets the sorter used by the tree viewer.
+ *
+ * @param sorter
+ * @deprecated since 3.3, use
+ * {@link CheckedTreeSelectionDialog#setComparator(ViewerComparator)}
+ * instead
+ */
+ public void setSorter(ViewerSorter sorter) {
+ fComparator = sorter;
+ }
+
+ /**
+ * Sets the comparator used by the tree viewer.
+ *
+ * @param comparator
+ * @since 3.3
+ */
+ public void setComparator(ViewerComparator comparator){
+ fComparator = comparator;
+ }
+
+ /**
+ * Adds a filter to the tree viewer.
+ *
+ * @param filter
+ * a filter.
+ */
+ public void addFilter(ViewerFilter filter) {
+ if (fFilters == null) {
+ fFilters = new ArrayList(4);
+ }
+ fFilters.add(filter);
+ }
+
+ /**
+ * Sets an optional validator to check if the selection is valid. The
+ * validator is invoked whenever the selection changes.
+ *
+ * @param validator
+ * the validator to validate the selection.
+ */
+ public void setValidator(ISelectionStatusValidator validator) {
+ fValidator = validator;
+ }
+
+ /**
+ * Sets the tree input.
+ *
+ * @param input
+ * the tree input.
+ */
+ public void setInput(Object input) {
+ fInput = input;
+ }
+
+ /**
+ * Expands elements in the tree.
+ *
+ * @param elements
+ * The elements that will be expanded.
+ */
+ public void setExpandedElements(Object[] elements) {
+ fExpandedElements = elements;
+ }
+
+ /**
+ * Sets the size of the tree in unit of characters.
+ *
+ * @param width
+ * the width of the tree.
+ * @param height
+ * the height of the tree.
+ */
+ public void setSize(int width, int height) {
+ fWidth = width;
+ fHeight = height;
+ }
+
+ /**
+ * Validate the receiver and update the status with the result.
+ *
+ */
+ protected void updateOKStatus() {
+ if (!fIsEmpty) {
+ if (fValidator != null) {
+ fCurrStatus = fValidator.validate(fViewer.getCheckedElements());
+ updateStatus(fCurrStatus);
+ } else if (!fCurrStatus.isOK()) {
+ fCurrStatus = new Status(IStatus.OK, PlatformUI.PLUGIN_ID,
+ IStatus.OK, "", //$NON-NLS-1$
+ null);
+ }
+ } else {
+ fCurrStatus = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID,
+ IStatus.OK, fEmptyListMessage, null);
+ }
+ updateStatus(fCurrStatus);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.jface.window.Window#open()
+ */
+ public int open() {
+ fIsEmpty = evaluateIfTreeEmpty(fInput);
+ super.open();
+ return getReturnCode();
+ }
+
+ private void access$superCreate() {
+ super.create();
+ }
+
+ /**
+ * Handles cancel button pressed event.
+ */
+ protected void cancelPressed() {
+ setResult(null);
+ super.cancelPressed();
+ }
+
+ /*
+ * @see SelectionStatusDialog#computeResult()
+ */
+ protected void computeResult() {
+ setResult(Arrays.asList(fViewer.getCheckedElements()));
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.jface.window.Window#create()
+ */
+ public void create() {
+ BusyIndicator.showWhile(null, new Runnable() {
+ public void run() {
+ access$superCreate();
+ fViewer.setCheckedElements(getInitialElementSelections()
+ .toArray());
+ if (fExpandedElements != null) {
+ fViewer.setExpandedElements(fExpandedElements);
+ }
+ updateOKStatus();
+ }
+ });
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
+ */
+ protected Control createDialogArea(Composite parent) {
+ Composite composite = (Composite) super.createDialogArea(parent);
+ Label messageLabel = createMessageArea(composite);
+ CheckboxTreeViewer treeViewer = createTreeViewer(composite);
+ Control buttonComposite = createSelectionButtons(composite);
+ GridData data = new GridData(GridData.FILL_BOTH);
+ data.widthHint = convertWidthInCharsToPixels(fWidth);
+ data.heightHint = convertHeightInCharsToPixels(fHeight);
+ Tree treeWidget = treeViewer.getTree();
+ treeWidget.setLayoutData(data);
+ treeWidget.setFont(parent.getFont());
+ if (fIsEmpty) {
+ messageLabel.setEnabled(false);
+ treeWidget.setEnabled(false);
+ buttonComposite.setEnabled(false);
+ }
+ return composite;
+ }
+
+ /**
+ * Creates the tree viewer.
+ *
+ * @param parent
+ * the parent composite
+ * @return the tree viewer
+ */
+ protected CheckboxTreeViewer createTreeViewer(Composite parent) {
+ if (fContainerMode) {
+ fViewer = new ContainerCheckedTreeViewer(parent, SWT.BORDER);
+ } else {
+ fViewer = new CheckboxTreeViewer(parent, SWT.BORDER);
+ }
+ fViewer.setContentProvider(fContentProvider);
+ fViewer.setLabelProvider(fLabelProvider);
+ fViewer.addCheckStateListener(new ICheckStateListener() {
+ public void checkStateChanged(CheckStateChangedEvent event) {
+ updateOKStatus();
+ }
+ });
+ fViewer.setComparator(fComparator);
+ if (fFilters != null) {
+ for (int i = 0; i != fFilters.size(); i++) {
+ fViewer.addFilter((ViewerFilter) fFilters.get(i));
+ }
+ }
+ fViewer.setInput(fInput);
+ return fViewer;
+ }
+
+ /**
+ * Returns the tree viewer.
+ *
+ * @return the tree viewer
+ */
+ protected CheckboxTreeViewer getTreeViewer() {
+ return fViewer;
+ }
+
+ /**
+ * Adds the selection and deselection buttons to the dialog.
+ *
+ * @param composite
+ * the parent composite
+ * @return Composite the composite the buttons were created in.
+ */
+ protected Composite createSelectionButtons(Composite composite) {
+ Composite buttonComposite = new Composite(composite, SWT.RIGHT);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 0;
+ layout.marginWidth = 0;
+ layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
+ buttonComposite.setLayout(layout);
+ buttonComposite.setFont(composite.getFont());
+ GridData data = new GridData(GridData.HORIZONTAL_ALIGN_END
+ | GridData.GRAB_HORIZONTAL);
+ data.grabExcessHorizontalSpace = true;
+ buttonComposite.setLayoutData(data);
+ Button selectButton = createButton(buttonComposite,
+ IDialogConstants.SELECT_ALL_ID, WorkbenchMessages.CheckedTreeSelectionDialog_select_all,
+ false);
+ SelectionListener listener = new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ Object[] viewerElements = fContentProvider.getElements(fInput);
+ if (fContainerMode) {
+ fViewer.setCheckedElements(viewerElements);
+ } else {
+ for (int i = 0; i < viewerElements.length; i++) {
+ fViewer.setSubtreeChecked(viewerElements[i], true);
+ }
+ }
+ updateOKStatus();
+ }
+ };
+ selectButton.addSelectionListener(listener);
+ Button deselectButton = createButton(buttonComposite,
+ IDialogConstants.DESELECT_ALL_ID, WorkbenchMessages.CheckedTreeSelectionDialog_deselect_all,
+ false);
+ listener = new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ fViewer.setCheckedElements(new Object[0]);
+ updateOKStatus();
+ }
+ };
+ deselectButton.addSelectionListener(listener);
+ return buttonComposite;
+ }
+
+ protected boolean evaluateIfTreeEmpty(Object input) {
+ Object[] elements = fContentProvider.getElements(input);
+ if (elements.length > 0) {
+ if (fFilters != null) {
+ for (int i = 0; i < fFilters.size(); i++) {
+ ViewerFilter curr = (ViewerFilter) fFilters.get(i);
+ elements = curr.filter(fViewer, input, elements);
+ }
+ }
+ }
+ return elements.length == 0;
+ }
+}
14 years
JBoss Tools SVN: r27587 - in trunk/cdi: tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2010-12-17 07:55:16 -0500 (Fri, 17 Dec 2010)
New Revision: 27587
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/TestableResolutionWithRefactoringProcessor.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TimestampLogger_Broken.qfxresult
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/DeleteAllDisposerDuplicantMarkerResolution.java
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/META-INF/MANIFEST.MF
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java
Log:
https://issues.jboss.org/browse/JBIDE-7673
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/DeleteAllDisposerDuplicantMarkerResolution.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/DeleteAllDisposerDuplicantMarkerResolution.java 2010-12-17 12:44:31 UTC (rev 27586)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/DeleteAllDisposerDuplicantMarkerResolution.java 2010-12-17 12:55:16 UTC (rev 27587)
@@ -11,32 +11,24 @@
package org.jboss.tools.cdi.ui.marker;
import java.text.MessageFormat;
-import java.util.HashSet;
-import java.util.Set;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IMarker;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.ltk.core.refactoring.participants.ProcessorBasedRefactoring;
+import org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor;
import org.eclipse.ltk.ui.refactoring.RefactoringWizard;
import org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IMarkerResolution2;
import org.eclipse.ui.internal.Workbench;
-import org.jboss.tools.cdi.core.CDIConstants;
-import org.jboss.tools.cdi.core.CDIUtil;
-import org.jboss.tools.cdi.core.IBeanMethod;
-import org.jboss.tools.cdi.core.IClassBean;
-import org.jboss.tools.cdi.core.IProducer;
-import org.jboss.tools.cdi.core.IProducerMethod;
import org.jboss.tools.cdi.ui.CDIUIMessages;
-import org.jboss.tools.common.text.ITextSourceReference;
/**
* @author Daniel Azarov
*/
-public class DeleteAllDisposerDuplicantMarkerResolution implements IMarkerResolution2 {
+public class DeleteAllDisposerDuplicantMarkerResolution implements IMarkerResolution2, TestableResolutionWithRefactoringProcessor {
private String label;
private IMethod method;
private IFile file;
@@ -67,6 +59,10 @@
}
+ public RefactoringProcessor getRefactoringProcessor(){
+ return new DeleteAllDisposerAnnotationsProcessor(file, method);
+ }
+
public String getDescription() {
return null;
}
Added: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/TestableResolutionWithRefactoringProcessor.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/TestableResolutionWithRefactoringProcessor.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/TestableResolutionWithRefactoringProcessor.java 2010-12-17 12:55:16 UTC (rev 27587)
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.ui.marker;
+
+import org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor;
+
+/**
+ * @author Daniel Azarov
+ */
+public interface TestableResolutionWithRefactoringProcessor {
+ public RefactoringProcessor getRefactoringProcessor();
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/TestableResolutionWithRefactoringProcessor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TimestampLogger_Broken.qfxresult
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TimestampLogger_Broken.qfxresult (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TimestampLogger_Broken.qfxresult 2010-12-17 12:55:16 UTC (rev 27587)
@@ -0,0 +1,18 @@
+package org.jboss.jsr299.tck.tests.jbt.quickfixes;
+
+import javax.enterprise.inject.Disposes;
+import javax.enterprise.inject.Produces;
+
+public class TimestampLogger_Broken {
+
+ @Produces
+ public static Spider getSpider() {
+ return new Spider();
+ }
+
+ public static void destorySpider(@Disposes Spider spider) {
+ }
+
+ public static void destorySpiderAgain( Spider spider) {
+ }
+}
\ No newline at end of file
Modified: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/META-INF/MANIFEST.MF 2010-12-17 12:44:31 UTC (rev 27586)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/META-INF/MANIFEST.MF 2010-12-17 12:55:16 UTC (rev 27587)
@@ -19,5 +19,6 @@
org.eclipse.jdt.core,
org.eclipse.jdt.ui,
org.eclipse.ui.ide,
- org.jboss.tools.jst.jsp.base.test
+ org.jboss.tools.jst.jsp.base.test,
+ org.eclipse.ltk.core.refactoring;bundle-version="3.5.100"
Export-Package: org.jboss.tools.cdi.ui.test
Modified: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java 2010-12-17 12:44:31 UTC (rev 27586)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java 2010-12-17 12:55:16 UTC (rev 27587)
@@ -21,14 +21,20 @@
import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.ltk.core.refactoring.CompositeChange;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.ltk.core.refactoring.RefactoringStatusEntry;
+import org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor;
import org.eclipse.ui.IMarkerResolution;
import org.eclipse.ui.ide.IDE;
import org.jboss.tools.cdi.core.test.tck.validation.ValidationTest;
import org.jboss.tools.cdi.internal.core.validation.CDIValidationErrorManager;
import org.jboss.tools.cdi.ui.marker.AddLocalBeanMarkerResolution;
+import org.jboss.tools.cdi.ui.marker.DeleteAllDisposerDuplicantMarkerResolution;
import org.jboss.tools.cdi.ui.marker.MakeFieldStaticMarkerResolution;
import org.jboss.tools.cdi.ui.marker.MakeMethodBusinessMarkerResolution;
import org.jboss.tools.cdi.ui.marker.MakeMethodPublicMarkerResolution;
+import org.jboss.tools.cdi.ui.marker.TestableResolutionWithRefactoringProcessor;
import org.jboss.tools.common.util.FileUtil;
import org.jboss.tools.test.util.JobUtils;
@@ -65,9 +71,35 @@
for (int j = 0; j < resolutions.length; j++) {
IMarkerResolution resolution = resolutions[j];
if (resolution.getClass().equals(resolutionClass)) {
+ if(resolution instanceof TestableResolutionWithRefactoringProcessor){
+ RefactoringProcessor processor = ((TestableResolutionWithRefactoringProcessor)resolution).getRefactoringProcessor();
+
+ RefactoringStatus status = processor.checkInitialConditions(new NullProgressMonitor());
+
+// RefactoringStatusEntry[] entries = status.getEntries();
+// for(RefactoringStatusEntry entry : entries){
+// System.out.println("Refactor status - "+entry.getMessage());
+// }
+
+ assertNull("Rename processor returns fatal error", status.getEntryMatchingSeverity(RefactoringStatus.FATAL));
+
+ status = processor.checkFinalConditions(new NullProgressMonitor(), null);
+
+// entries = status.getEntries();
+// for(RefactoringStatusEntry entry : entries){
+// System.out.println("Refactor status - "+entry.getMessage());
+// }
+
+ assertNull("Rename processor returns fatal error", status.getEntryMatchingSeverity(RefactoringStatus.FATAL));
+
+
+ CompositeChange rootChange = (CompositeChange)processor.createChange(new NullProgressMonitor());
+
+ rootChange.perform(new NullProgressMonitor());
+ }else{
+ resolution.run(marker);
+ }
- resolution.run(marker);
-
refresh(project);
IMarker[] newMarkers = file.findMarkers(markerType, true, IResource.DEPTH_INFINITE);
@@ -76,6 +108,7 @@
checkResults(project, fileNames, results);
+
return;
}
}
@@ -305,4 +338,18 @@
MakeMethodPublicMarkerResolution.class);
}
+ public void testDeleteAllDisposerDuplicantsResolution() throws CoreException {
+ checkResolution(tckProject,
+ new String[]{
+ "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/TimestampLogger_Broken.java"
+ },
+// new String[]{
+// "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/TimestampLogger_Broken.qfxresult"
+// },
+ MARKER_TYPE,
+ CDIValidationErrorManager.MESSAGE_ID_ATTRIBUTE_NAME,
+ CDIValidationErrorManager.MULTIPLE_DISPOSERS_FOR_PRODUCER_ID,
+ DeleteAllDisposerDuplicantMarkerResolution.class);
+ }
+
}
14 years
JBoss Tools SVN: r27586 - in trunk/jbpm/plugins: org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/prefs and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2010-12-17 07:44:31 -0500 (Fri, 17 Dec 2010)
New Revision: 27586
Modified:
trunk/jbpm/plugins/org.jboss.tools.jbpm.common/src/org/jboss/tools/jbpm/preferences/JbpmLocationsPage.java
trunk/jbpm/plugins/org.jboss.tools.jbpm.common/src/org/jboss/tools/jbpm/preferences/PreferencesManager.java
trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/prefs/Initializer.java
trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/prefs/Jbpm3PreferencesManager.java
Log:
JBDS-1442
Modified: trunk/jbpm/plugins/org.jboss.tools.jbpm.common/src/org/jboss/tools/jbpm/preferences/JbpmLocationsPage.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.common/src/org/jboss/tools/jbpm/preferences/JbpmLocationsPage.java 2010-12-17 12:08:06 UTC (rev 27585)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.common/src/org/jboss/tools/jbpm/preferences/JbpmLocationsPage.java 2010-12-17 12:44:31 UTC (rev 27586)
@@ -183,7 +183,10 @@
}
private void checkItemToCheck(TableViewer viewer) {
- String name = Activator.getDefault().getPreferenceStore().getString(Constants.JBPM_NAME);
+// String name = Activator.getDefault().getPreferenceStore().getString(Constants.JBPM_NAME);
+ PreferencesManager inputManager =
+ (PreferencesManager)tableViewer.getInput();
+ String name = inputManager.getPreferredJbpmName();
if (name != null) {
TableItem tableItem = getItemToCheck(viewer, name);
if (tableItem != null) {
@@ -296,7 +299,8 @@
if (item != null) {
name = item.getText(0);
}
- Activator.getDefault().getPreferenceStore().setValue(Constants.JBPM_NAME, name);
+// Activator.getDefault().getPreferenceStore().setValue(Constants.JBPM_NAME, name);
+ inputManager.setPreferredJbpmName(name);
return true;
}
@@ -309,9 +313,10 @@
}
public void performDefaults() {
- Activator.getDefault().getPreferenceStore().setToDefault(Constants.JBPM_NAME);
+// Activator.getDefault().getPreferenceStore().setToDefault(Constants.JBPM_NAME);
PreferencesManager inputManager =
(PreferencesManager)tableViewer.getInput();
+ inputManager.setPreferredJbpmName(null);
inputManager.getJbpmInstallationMap().clear();
tableViewer.setInput(inputManager);
checkItemToCheck(tableViewer);
Modified: trunk/jbpm/plugins/org.jboss.tools.jbpm.common/src/org/jboss/tools/jbpm/preferences/PreferencesManager.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.common/src/org/jboss/tools/jbpm/preferences/PreferencesManager.java 2010-12-17 12:08:06 UTC (rev 27585)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.common/src/org/jboss/tools/jbpm/preferences/PreferencesManager.java 2010-12-17 12:44:31 UTC (rev 27586)
@@ -53,6 +53,10 @@
}
protected PreferencesManager() {
+ initialize();
+ }
+
+ protected void initialize() {
initializeInstallations();
}
Modified: trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/prefs/Initializer.java
===================================================================
--- trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/prefs/Initializer.java 2010-12-17 12:08:06 UTC (rev 27585)
+++ trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/prefs/Initializer.java 2010-12-17 12:44:31 UTC (rev 27586)
@@ -1,8 +1,8 @@
package org.jbpm.gd.jpdl.prefs;
import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+import org.eclipse.jface.preference.IPreferenceStore;
import org.jbpm.gd.jpdl.Plugin;
-import org.eclipse.jface.preference.IPreferenceStore;
public class Initializer extends AbstractPreferenceInitializer implements PreferencesConstants {
Modified: trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/prefs/Jbpm3PreferencesManager.java
===================================================================
--- trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/prefs/Jbpm3PreferencesManager.java 2010-12-17 12:08:06 UTC (rev 27585)
+++ trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/prefs/Jbpm3PreferencesManager.java 2010-12-17 12:44:31 UTC (rev 27586)
@@ -31,20 +31,11 @@
public static final Jbpm3PreferencesManager INSTANCE = new Jbpm3PreferencesManager();
- protected Jbpm3PreferencesManager() {
- super();
- initialize();
- }
-
- void initialize() {
- initializeInstallations();
- initializePreferredJbpmName();
- }
-
- private void initializeInstallations() {
+ protected void initialize() {
File installationsFile =
Plugin.getDefault().getStateLocation().append("jbpm-installations.xml").toFile();
if (installationsFile.exists()) {
+ initializePreferredJbpmName();
loadInstallations(installationsFile);
saveInstallations();
loadInstallations();
14 years
JBoss Tools SVN: r27585 - trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2010-12-17 07:08:06 -0500 (Fri, 17 Dec 2010)
New Revision: 27585
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VPETestPlugin.java
Log:
https://issues.jboss.org/browse/JBIDE-7843
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VPETestPlugin.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VPETestPlugin.java 2010-12-17 12:06:50 UTC (rev 27584)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VPETestPlugin.java 2010-12-17 12:08:06 UTC (rev 27585)
@@ -25,7 +25,7 @@
// The plug-in ID
public static final String PLUGIN_ID = "org.jboss.tools.vpe.ui.test";
- public static final String VPE_TEST_EXTENTION_POINT_ID = "org.jboss.tools.vpe.ui.tests"; //$NON-NLS-1$
+ public static final String VPE_TEST_EXTENTION_POINT_ID = "org.jboss.tools.vpe.ui.test"; //$NON-NLS-1$
// The shared instance
private static VPETestPlugin plugin;
14 years
JBoss Tools SVN: r27584 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-12-17 07:06:50 -0500 (Fri, 17 Dec 2010)
New Revision: 27584
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudAuthException.java
Log:
corrected typo in param name
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudAuthException.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudAuthException.java 2010-12-17 11:08:27 UTC (rev 27583)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudAuthException.java 2010-12-17 12:06:50 UTC (rev 27584)
@@ -17,14 +17,14 @@
private static final long serialVersionUID = 1L;
- public DeltaCloudAuthException(String message, Throwable clause)
+ public DeltaCloudAuthException(String message, Throwable cause)
{
- super(message, clause);
+ super(message, cause);
}
- public DeltaCloudAuthException(Throwable clause)
+ public DeltaCloudAuthException(Throwable cause)
{
- super(clause);
+ super(cause);
}
public DeltaCloudAuthException(String message)
14 years
JBoss Tools SVN: r27583 - trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/preferences.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-12-17 06:08:27 -0500 (Fri, 17 Dec 2010)
New Revision: 27583
Modified:
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/preferences/messages.properties
Log:
[JBIDE-7750] corrected strings (product id -> Eclipse product, product version -> Eclipse product version)
Modified: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/preferences/messages.properties
===================================================================
--- trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/preferences/messages.properties 2010-12-17 10:51:56 UTC (rev 27582)
+++ trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/preferences/messages.properties 2010-12-17 11:08:27 UTC (rev 27583)
@@ -9,9 +9,9 @@
UsageReportPreferencePage_OperatingSystem=Operating system\:
UsageReportPreferencePage_OperatingSystemVersion=Operating system version\:
UsageReportPreferencePage_LinuxDistro=Linux Distro\:
-UsageReportPreferencePage_ProductId=Product id\:
+UsageReportPreferencePage_ProductId=Eclipse product\:
UsageReportPreferencePage_ProductOwner=Report owner\:
-UsageReportPreferencePage_ProductVersion=Product version\:
+UsageReportPreferencePage_ProductVersion=Eclipse product version\:
UsageReportPreferencePage_ScreenColors=Screen Colors\:
UsageReportPreferencePage_ScreenResolution=Screen Resolution\:
UsageReportPreferencePage_Error_Saving=Could not save usage reporting preferences
14 years
JBoss Tools SVN: r27582 - trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/preferences.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-12-17 05:51:56 -0500 (Fri, 17 Dec 2010)
New Revision: 27582
Modified:
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/preferences/messages.properties
Log:
[JBIDE-7750] corrected strings (usage-hit, product-owner)
Modified: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/preferences/messages.properties
===================================================================
--- trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/preferences/messages.properties 2010-12-17 10:08:05 UTC (rev 27581)
+++ trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/preferences/messages.properties 2010-12-17 10:51:56 UTC (rev 27582)
@@ -1,16 +1,16 @@
UsageReportPreferencePage_ReportedValues=Reported Values
-UsageReportPreferencePage_CurrentUsageHit=Current usage-hit\:
-UsageReportPreferencePage_FirstUsageHit=First usage-hit\:
+UsageReportPreferencePage_CurrentUsageHit=Current usage reported on\:
+UsageReportPreferencePage_FirstUsageHit=First usage reported on\:
UsageReportPreferencePage_JBossToolsComponents=JBoss Tools Components\:
UsageReportPreferencePage_JBossToolsVersion=JBoss Tools Version\:
-UsageReportPreferencePage_LastUsageHit=Last usage-hit\:
+UsageReportPreferencePage_LastUsageHit=Last usage reported on\:
UsageReportPreferencePage_Locale=Locale\:
UsageReportPreferencePage_NumberOfUsageHits=Number of usage-hits\:
UsageReportPreferencePage_OperatingSystem=Operating system\:
UsageReportPreferencePage_OperatingSystemVersion=Operating system version\:
UsageReportPreferencePage_LinuxDistro=Linux Distro\:
UsageReportPreferencePage_ProductId=Product id\:
-UsageReportPreferencePage_ProductOwner=Product owner\:
+UsageReportPreferencePage_ProductOwner=Report owner\:
UsageReportPreferencePage_ProductVersion=Product version\:
UsageReportPreferencePage_ScreenColors=Screen Colors\:
UsageReportPreferencePage_ScreenResolution=Screen Resolution\:
14 years
JBoss Tools SVN: r27581 - trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/reporting.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-12-17 05:08:05 -0500 (Fri, 17 Dec 2010)
New Revision: 27581
Modified:
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/reporting/UsageReport.java
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/reporting/UsageReportEnablementDialog.java
Log:
[JBDS-1453] changed usage-repoting-enablement dialog to display "yes" and "no" buttons and not to use a checkbox.
Modified: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/reporting/UsageReport.java
===================================================================
--- trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/reporting/UsageReport.java 2010-12-17 10:05:25 UTC (rev 27580)
+++ trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/reporting/UsageReport.java 2010-12-17 10:08:05 UTC (rev 27581)
@@ -129,7 +129,8 @@
public void run() {
UsageReportEnablementDialog dialog =
- new UsageReportEnablementDialog(true, PlatformUI.getWorkbench().getActiveWorkbenchWindow(),
+ new UsageReportEnablementDialog(
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow(),
JBossToolsUsageActivator.getDefault().getUsageBranding());
if (dialog.open() == Window.OK) {
userResponse[0] = dialog.isReportEnabled();
Modified: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/reporting/UsageReportEnablementDialog.java
===================================================================
--- trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/reporting/UsageReportEnablementDialog.java 2010-12-17 10:05:25 UTC (rev 27580)
+++ trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/reporting/UsageReportEnablementDialog.java 2010-12-17 10:08:05 UTC (rev 27581)
@@ -17,7 +17,6 @@
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Link;
@@ -31,35 +30,42 @@
*/
public class UsageReportEnablementDialog extends Dialog {
- private Button checkBox;
private boolean reportEnabled;
private IUsageBranding branding;
- public UsageReportEnablementDialog(boolean reportEnabled, IShellProvider parentShell, IUsageBranding branding) {
+ public UsageReportEnablementDialog(IShellProvider parentShell, IUsageBranding branding) {
super(parentShell);
- this.reportEnabled = reportEnabled;
this.branding = branding;
}
protected void buttonPressed(int buttonId) {
- if (buttonId == IDialogConstants.OK_ID) {
- this.reportEnabled = checkBox.getSelection();
- } else if (buttonId == IDialogConstants.CANCEL_ID) {
- this.reportEnabled = false;
+ this.reportEnabled = (buttonId == IDialogConstants.OK_ID);
+ if (IDialogConstants.NO_ID == buttonId) {
+ noPressed();
}
super.buttonPressed(buttonId);
}
+ /**
+ * Notifies that the no button of this dialog has been pressed.
+ * <p>
+ * The <code>Dialog</code> implementation of this framework method sets this
+ * dialog's return code to <code>Window.OK</code> and closes the dialog.
+ * </p>
+ */
+ protected void noPressed() {
+ setReturnCode(OK);
+ close();
+ }
+
protected void configureShell(Shell shell) {
super.configureShell(shell);
shell.setText(branding.getStartupAllowReportingTitle());
}
protected void createButtonsForButtonBar(Composite parent) {
- createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
- createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
- checkBox.setFocus();
- checkBox.setSelection(reportEnabled);
+ createButton(parent, IDialogConstants.OK_ID, IDialogConstants.YES_LABEL, false);
+ createButton(parent, IDialogConstants.NO_ID, IDialogConstants.NO_LABEL, false);
}
protected Control createDialogArea(Composite parent) {
@@ -90,11 +96,6 @@
.grab(true, false)
.hint(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH, SWT.DEFAULT)
.applyTo(link);
-
- // checkbox
- checkBox = new Button(composite, SWT.CHECK);
- checkBox.setText(branding.getStartupAllowReportingCheckboxLabel());
- GridDataFactory.fillDefaults().grab(true, false).align(SWT.LEFT, SWT.CENTER).applyTo(checkBox);
}
public boolean isReportEnabled() {
14 years
JBoss Tools SVN: r27580 - trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/branding.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-12-17 05:05:25 -0500 (Fri, 17 Dec 2010)
New Revision: 27580
Modified:
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/branding/messages.properties
Log:
[JBDS-1453] changed message displayed in usage-repoting-enablement dialog
Modified: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/branding/messages.properties
===================================================================
--- trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/branding/messages.properties 2010-12-17 09:17:20 UTC (rev 27579)
+++ trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/branding/messages.properties 2010-12-17 10:05:25 UTC (rev 27580)
@@ -2,7 +2,7 @@
UsageReportPreferencePage_AllowReporting=&Please allow the JBoss Tools team to receive anonymous usage\n statistics for this Eclipse installation with JBoss Tools.
UsageReport_DialogTitle=JBoss Tools Usage
-UsageReport_DialogMessage=Please allow JBoss Tools team to receive anonymous usage statistics for this Eclipse instance with JBoss Tools (<a>info</a>).
+UsageReport_DialogMessage=Will you allow JBoss Tools team to receive anonymous usage statistics for this Eclipse instance with JBoss Tools (<a>info</a>)?
UsageReport_GoogleAnalytics_Account=UA-17645367-1
UsageReport_Checkbox_Text=Report usage of JBoss Tools to JBoss Tools team.
UsageReport_HostName=jboss.org
14 years