Author: dazarov
Date: 2008-07-02 07:52:25 -0400 (Wed, 02 Jul 2008)
New Revision: 9042
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/ParamEditPart.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ParamFigure.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1189
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/ParamEditPart.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/ParamEditPart.java 2008-07-02
08:56:54 UTC (rev 9041)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/ParamEditPart.java 2008-07-02
11:52:25 UTC (rev 9042)
@@ -152,10 +152,7 @@
protected void refreshVisuals() {
Point loc = new Point(1,1);
- String text = getExceptionModel().getName();
- if(text == null) text="Param";
- int width = getIconWidth()+FigureUtilities.getTextExtents(text,
NodeFigure.nodeLabelFont).width;
- size = new Dimension(width, getVisualHeight());
+ size = new Dimension(200, getVisualHeight());
adjustForGrid(loc);
Rectangle r = new Rectangle(loc, size);
@@ -168,10 +165,6 @@
return 21;
}
- private int getIconWidth() {
- return 30;
- }
-
public ConnectionAnchor getTargetConnectionAnchor(
ConnectionEditPart connEditPart) {
ConnectionAnchor anc = getNodeFigure().getConnectionAnchor("1_IN");
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ParamFigure.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ParamFigure.java 2008-07-02
08:56:54 UTC (rev 9041)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ParamFigure.java 2008-07-02
11:52:25 UTC (rev 9042)
@@ -48,6 +48,14 @@
public Dimension getPreferredSize(int wHint, int hHint) {
return SIZE;
}
+
+ private int getTextWidth(){
+ return 90;
+ }
+
+ private int getTextInset(){
+ return 5;
+ }
/**
* @see org.eclipse.draw2d.Figure#paintFigure(Graphics)
@@ -55,19 +63,26 @@
protected void paintFigure(Graphics g) {
Rectangle r = getBounds().getCopy();
g.translate(r.getLocation());
+
+ String name;
+ if(exc.getName() != null){
+ name = dottedString(exc.getName(), getTextWidth()-getTextInset(), nameParamFont);
+ name += ":";
+ }else
+ name = "Param:";
+
+ String value;
+ if(exc.getValue() != null){
+ value = dottedString(exc.getValue(), getTextWidth()-getTextInset(), valueParamFont);
+ }else
+ value = "value";
if(exc != null){
g.setFont(nameParamFont);
- if(exc.getName() != null)
- g.drawString(exc.getName()+":", 5, 1);
- else
- g.drawString("Param:", 5, 1);
+ g.drawString(name, getTextInset(), 1);
g.setFont(valueParamFont);
- if(exc.getValue() != null)
- g.drawString(exc.getValue(), 105, 1);
- else
- g.drawString("value", 105, 1);
+ g.drawString(value, getTextWidth()+3*getTextInset(), 1);
}