Author: scabanovich
Date: 2011-09-14 19:19:21 -0400 (Wed, 14 Sep 2011)
New Revision: 34747
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/AssignableBeansDialog.java
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/AssignableBeansHyperlink.java
Log:
JBIDE-9347
https://issues.jboss.org/browse/JBIDE-9347
Small fixes.
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/AssignableBeansDialog.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/AssignableBeansDialog.java 2011-09-14
23:09:32 UTC (rev 34746)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/AssignableBeansDialog.java 2011-09-14
23:19:21 UTC (rev 34747)
@@ -22,7 +22,6 @@
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.TitleAreaDialog;
-import org.eclipse.jface.resource.ColorRegistry;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.viewers.CheckStateChangedEvent;
import org.eclipse.jface.viewers.CheckboxTreeViewer;
@@ -45,7 +44,6 @@
import org.eclipse.jface.viewers.StyledString.Styler;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.TextStyle;
import org.eclipse.swt.layout.GridData;
@@ -155,7 +153,6 @@
list.getControl().setLayoutData(g);
list.setContentProvider(new ListContent());
list.setLabelProvider(new LP());
-// TableOwnerDrawSupport.install(list.getTable());
list.setInput(injectionPoint);
list.addOpenListener(new IOpenListener() {
@Override
@@ -165,6 +162,7 @@
Object o = ((IStructuredSelection)s).getFirstElement();
if(o instanceof IBean) {
((IBean)o).open();
+ close();
}
}
}
@@ -371,8 +369,8 @@
static Color black = new Color(null, 0, 0, 0);
static Styler ELIGIBLE_NAME = new DefaultStyler(black, false);
- static Styler ELIGIBLE_QUALIFIER = new DefaultStyler(gray, true);
- static Styler DISABLED = new DefaultStyler(gray, true);
+ static Styler ELIGIBLE_QUALIFIER = new DefaultStyler(gray, false);
+ static Styler DISABLED = new DefaultStyler(gray, false);
private static class DefaultStyler extends Styler {
private final Color foreground;
@@ -384,7 +382,6 @@
}
public void applyStyles(TextStyle textStyle) {
-// ColorRegistry colorRegistry = JFaceResources.getColorRegistry();
if (foreground != null) {
textStyle.foreground = foreground;
}
@@ -554,5 +551,4 @@
}
}
-
}
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/AssignableBeansHyperlink.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/AssignableBeansHyperlink.java 2011-09-14
23:09:32 UTC (rev 34746)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/AssignableBeansHyperlink.java 2011-09-14
23:19:21 UTC (rev 34747)
@@ -14,6 +14,7 @@
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
+import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Display;
import org.jboss.tools.cdi.core.ICDIElement;
import org.jboss.tools.cdi.core.IInjectionPoint;
@@ -44,7 +45,12 @@
dialog.setInjectionPoint(injectionPoint);
dialog.create();
dialog.getShell().setText(CDIExtensionsMessages.ASSIGNABLE_BEANS_DIALOG_TITLE);
- dialog.getShell().setSize(700, 400);
+ int width = 700;
+ int height = 400;
+ Rectangle b = display.getActiveShell().getBounds();
+ int x = b.x + (b.width - width) / 2;
+ int y = b.y + (b.height - height) / 2;
+ dialog.getShell().setBounds(x, y, width, height);
dialog.open();
}