Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 140628 Details for
Bug 282210
DecoratedField unusable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
Patch
patch.txt (text/plain), 6.33 KB, created by
Thomas Schindl
on 2009-07-01 16:15:20 EDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Thomas Schindl
Created:
2009-07-01 16:15:20 EDT
Size:
6.33 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rap.jface >Index: src/org/eclipse/jface/fieldassist/DecoratedField.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.ui/org.eclipse.rap.jface/src/org/eclipse/jface/fieldassist/DecoratedField.java,v >retrieving revision 1.3 >diff -u -r1.3 DecoratedField.java >--- src/org/eclipse/jface/fieldassist/DecoratedField.java 17 Apr 2008 09:35:43 -0000 1.3 >+++ src/org/eclipse/jface/fieldassist/DecoratedField.java 1 Jul 2009 20:09:31 -0000 >@@ -151,6 +151,8 @@ > */ > private Hover hover; > >+ private boolean freeDecorationSpace = false; >+ > /** > * The hover used to show a decoration image's description. > */ >@@ -354,7 +356,9 @@ > * Construct a decorated field which is parented by the specified composite > * and has the given style bits. Use the controlCreator to create the > * specific kind of control that is decorated inside the field. >- * >+ * >+ * <p>Extract constructor for RAP to allow decoration hiding</p> >+ * > * @param parent > * the parent of the decorated field. > * @param style >@@ -362,11 +366,13 @@ > * @param controlCreator > * the IControlCreator used to specify the specific kind of > * control that is to be decorated. >- * >+ * @param freeDecorationSpace free the space when no decoration is displayed >+ * > * @see IControlCreator > */ > public DecoratedField(Composite parent, int style, >- IControlCreator controlCreator) { >+ IControlCreator controlCreator, boolean freeDecorationSpace) { >+ this.freeDecorationSpace = freeDecorationSpace; > this.form = createForm(parent); > this.control = controlCreator.createControl(form, style); > >@@ -384,6 +390,26 @@ > } > > /** >+ * Construct a decorated field which is parented by the specified composite >+ * and has the given style bits. Use the controlCreator to create the >+ * specific kind of control that is decorated inside the field. >+ * >+ * @param parent >+ * the parent of the decorated field. >+ * @param style >+ * the desired style bits for the field. >+ * @param controlCreator >+ * the IControlCreator used to specify the specific kind of >+ * control that is to be decorated. >+ * >+ * @see IControlCreator >+ */ >+ public DecoratedField(Composite parent, int style, >+ IControlCreator controlCreator) { >+ this(parent, style, controlCreator, false); >+ } >+ >+ /** > * Adds an image decoration to the field. > * > * @param decoration >@@ -484,17 +510,32 @@ > if (decDatas[opposing] == null) { > // No decorator on the opposing side. > // Attach the control to this decorator >- formData.left = new FormAttachment(decData.label); >+ if( freeDecorationSpace & ! decData.visible ) { >+ formData.left = new FormAttachment(0,0); >+ } else { >+ formData.left = new FormAttachment(decData.label); >+ } >+ > } else if (decDatas[opposing].data.width < newWidth) { > // Decorator on opposing side is the smaller one. Attach > // control to the new one. >- formData.left = new FormAttachment(decData.label); >+ if( freeDecorationSpace & ! decData.visible ) { >+ formData.left = new FormAttachment(0,0); >+ } else { >+ formData.left = new FormAttachment(decData.label); >+ } >+ > // Center align the smaller one relative to the larger one. > decDatas[opposing].data.left.alignment = SWT.CENTER; > decDatas[opposing].data.left.control = decData.label; > } else { > // The new decorator is the smaller one. Keep the > // control attached to the opposing one. >+ if( freeDecorationSpace & ! decData.visible ) { >+ //FIXME Tom: What do we do here >+ } else { >+ //FIXME Tom: What do we do here >+ } > formData = null; > // Horizontally center the smaller one relative to the larger > // one. >@@ -518,11 +559,21 @@ > if (decDatas[opposing] == null) { > // No decorator on the opposing side. > // Attach the control to this decorator. >- formData.right = new FormAttachment(decData.label); >+ if( freeDecorationSpace & ! decData.visible ) { >+ formData.right = new FormAttachment(100, 0); >+ } else { >+ formData.right = new FormAttachment(decData.label); >+ } >+ > } else if (decDatas[opposing].data.width < newWidth) { > // Decorator on opposing side is the smaller one. Attach > // control to the new one. >- formData.right = new FormAttachment(decData.label); >+ if( freeDecorationSpace & ! decData.visible ) { >+ formData.right = new FormAttachment(100, 0); >+ } else { >+ formData.right = new FormAttachment(decData.label); >+ } >+ > // Center align the smaller one to the larger one. > // Note that this could be done using the left or right > // attachment, we use the right since it is already >@@ -532,6 +583,11 @@ > } else { > // The new decorator is the smaller one. Keep the > // control attached to the opposing one. >+ if( freeDecorationSpace & ! decData.visible ) { >+ //FIXME Tom: What do we do here >+ } else { >+ //FIXME Tom: What do we do here >+ } > formData = null; > // Horizontally center align the smaller one to the > // larger one. >@@ -685,11 +741,11 @@ > * over the decoration. This method can be used to show a decoration's > * description text at other times (such as when the control receives > * focus), or to show other text associated with the field. >- * >+ * > * <p> > * If there is currently a hover visible, the hover's text will be replaced > * with the specified text. >- * >+ * > * @param text > * the text to be shown in the info hover, or <code>null</code> > * if no text should be shown. >@@ -821,6 +877,15 @@ > } else { > decData.label.setVisible(false); > } >+ >+ if( freeDecorationSpace ) { >+ for( int i = 0; i < decDatas.length; i++ ) { >+ if( decDatas[i] == decData ) { >+ updateControlAttachments(i, decData); >+ break; >+ } >+ } >+ } > } > > /* >@@ -848,13 +913,13 @@ > } > // RAP [fappel]: (mis-)use images toolTipText for the decorations' description > hoverNear.setToolTipText( text ); >- // RAPEND: [bm] >+ // RAPEND: [bm] > >- if (hover == null) { >- hover = new Hover(hoverNear.getShell()); >- } >- hover.setText(text, hoverNear, control); >- hover.setVisible(true); >+// if (hover == null) { >+// hover = new Hover(hoverNear.getShell()); >+// } >+// hover.setText(text, hoverNear, control); >+// hover.setVisible(true); > } > > /**
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 282210
: 140628