Author: dazarov
Date: 2011-10-24 19:40:10 -0400 (Mon, 24 Oct 2011)
New Revision: 35962
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/AddQualifiersToBeanWizard.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/AddQualifiersToBeanWizardPage.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/SelectBeanWizard.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/xpl/AddQualifiersToBeanComposite.java
Log:
Quickfix and Wizard for fixing ambigious injection warning is confusing
https://issues.jboss.org/browse/JBIDE-9940
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/AddQualifiersToBeanWizard.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/AddQualifiersToBeanWizard.java 2011-10-24
23:39:14 UTC (rev 35961)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/AddQualifiersToBeanWizard.java 2011-10-24
23:40:10 UTC (rev 35962)
@@ -12,6 +12,7 @@
import java.util.List;
+import org.eclipse.osgi.util.NLS;
import org.jboss.tools.cdi.core.IBean;
import org.jboss.tools.cdi.core.IInjectionPoint;
import org.jboss.tools.cdi.core.IQualifier;
@@ -30,7 +31,7 @@
}
public void addPages() {
- page = new AddQualifiersToBeanWizardPage("");
+ page = new
AddQualifiersToBeanWizardPage(NLS.bind(CDIUIMessages.ADD_QUALIFIERS_TO_BEAN_WIZARD_TITLE,
bean.getElementName()));
addPage(page);
}
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/AddQualifiersToBeanWizardPage.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/AddQualifiersToBeanWizardPage.java 2011-10-24
23:39:14 UTC (rev 35961)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/AddQualifiersToBeanWizardPage.java 2011-10-24
23:40:10 UTC (rev 35962)
@@ -13,6 +13,7 @@
import java.util.ArrayList;
import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.widgets.Composite;
import org.jboss.tools.cdi.core.IBean;
import org.jboss.tools.cdi.core.IQualifier;
@@ -26,7 +27,7 @@
protected AddQualifiersToBeanWizardPage(String pageName) {
super(pageName);
- setTitle(CDIUIMessages.ADD_QUALIFIERS_TO_BEAN_WIZARD_TITLE);
+ setTitle(pageName);
}
public void createControl(Composite parent) {
@@ -44,6 +45,7 @@
public void init(IBean bean){
composite.init(bean);
+ setTitle(NLS.bind(CDIUIMessages.ADD_QUALIFIERS_TO_BEAN_WIZARD_TITLE,
bean.getElementName()));
}
public void deploy(ValuedQualifier qualifier){
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/SelectBeanWizard.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/SelectBeanWizard.java 2011-10-24
23:39:14 UTC (rev 35961)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/SelectBeanWizard.java 2011-10-24
23:40:10 UTC (rev 35962)
@@ -20,7 +20,6 @@
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ListViewer;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.Viewer;
@@ -28,6 +27,7 @@
import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
@@ -36,7 +36,6 @@
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.List;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.dialogs.SearchPattern;
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/xpl/AddQualifiersToBeanComposite.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/xpl/AddQualifiersToBeanComposite.java 2011-10-24
23:39:14 UTC (rev 35961)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/xpl/AddQualifiersToBeanComposite.java 2011-10-24
23:40:10 UTC (rev 35962)
@@ -100,9 +100,6 @@
// original qualifiers on the bean with declaration + currently added qualifiers on the
bean
private ArrayList<ValuedQualifier> deployed = new
ArrayList<ValuedQualifier>();
- // original + deployed
- ArrayList<ValuedQualifier> total = new ArrayList<ValuedQualifier>();
-
private TableViewer availableTableViewer;
private TableViewer deployedTableViewer;
@@ -140,8 +137,6 @@
if(declaration != null){
String value = MarkerResolutionUtils.findQualifierValue(declaration);
ValuedQualifier vq = new ValuedQualifier(q, value);
- //originalQualifiers.add(vq);
- //deployedTableViewer.add(vq);
deployed.add(vq);
}else{
originalQualifiers.add(new ValuedQualifier(q, ""));
@@ -158,7 +153,7 @@
}
}
- total.clear();
+ ArrayList<ValuedQualifier> total = new ArrayList<ValuedQualifier>();
total.addAll(originalQualifiers);
total.addAll(deployed);
@@ -167,6 +162,7 @@
qualifiers.clear();
loadAvailableQualifiers();
+
availableTableViewer.setInput(qualifiers);
if(nLabel != null)
nLabel.setText(MessageFormat.format(CDIUIMessages.ADD_QUALIFIERS_TO_BEAN_WIZARD_MESSAGE,
@@ -199,6 +195,7 @@
String qualifierPackage =
qualifierTypeName.substring(0,qualifierTypeName.lastIndexOf(MarkerResolutionUtils.DOT));
if((isPublic || (samePackage &&
injectionPointPackage.equals(qualifierPackage))) ){
qualifiers.add(vq);
+ availableTableViewer.add(vq);
lastQualifier = vq;
}
}
@@ -234,7 +231,7 @@
}
public boolean checkBeans(){
- total.clear();
+ ArrayList<ValuedQualifier> total = new ArrayList<ValuedQualifier>();
total.addAll(originalQualifiers);
total.addAll(deployed);
HashSet<ValuedQualifier> qfs = new HashSet<ValuedQualifier>(total);
@@ -428,12 +425,6 @@
}
});
- label = new Label(this, SWT.NONE);
- label.setText("");
-
- label = new Label(this, SWT.NONE);
- label.setText("");
-
final Button createQualifier = new Button(this, SWT.PUSH);
createQualifier.setText(CDIUIMessages.ADD_QUALIFIERS_TO_BEAN_WIZARD_CREATE_NEW_QUALIFIER);
@@ -472,11 +463,7 @@
}
}
- ValuedQualifier q = loadAvailableQualifiers();
-
- if(q != null){
- moveAll(new ValuedQualifier[]{q}, true);
- }
+ loadAvailableQualifiers();
}
}
});
@@ -484,9 +471,6 @@
label = new Label(this, SWT.NONE);
label.setText("");
- label = new Label(this, SWT.NONE);
- label.setText("");
-
editQualifierValue = new Button(this, SWT.PUSH);
editQualifierValue.setText(CDIUIMessages.ADD_QUALIFIERS_TO_BEAN_WIZARD_EDIT_QUALIFIER_VALUE);
@@ -690,7 +674,7 @@
}
public ArrayList<ValuedQualifier> getDeployedQualifiers(){
- total.clear();
+ ArrayList<ValuedQualifier> total = new ArrayList<ValuedQualifier>();
total.addAll(originalQualifiers);
total.addAll(deployed);