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 2229 Details for
Bug 12329
[Cell Editors] Request:ComboBoxCellEditor READ_ONLY style
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]
Style bits in cell editor constructors
12329_patch (text/plain), 8.06 KB, created by
Andrew Irvine
on 2002-10-18 10:25:57 EDT
(
hide
)
Description:
Style bits in cell editor constructors
Filename:
MIME Type:
Creator:
Andrew Irvine
Created:
2002-10-18 10:25:57 EDT
Size:
8.06 KB
patch
obsolete
>Index: CellEditor.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jface/src/org/eclipse/jface/viewers/CellEditor.java,v >retrieving revision 1.1 >diff -u -r1.1 CellEditor.java >--- CellEditor.java 24 Sep 2002 16:36:54 -0000 1.1 >+++ CellEditor.java 17 Oct 2002 13:10:07 -0000 >@@ -67,6 +67,11 @@ > */ > private Control control = null; > >+ /** >+ * This cell editor's style >+ */ >+ private int style = SWT.NONE; >+ > /** > * Struct-like layout data for cell editors, with reasonable defaults > * for all fields. >@@ -134,6 +139,18 @@ > * @param parent the parent control > */ > protected CellEditor(Composite parent) { >+ this(parent, SWT.NONE); >+} >+/** >+ * Creates a new cell editor under the given parent control. >+ * The cell editor has no cell validator. >+ * >+ * @param parent the parent control >+ * @param style the style bits >+ * @since 2.1 >+ */ >+protected CellEditor(Composite parent, int style) { >+ this.style = style; > control = createControl(parent); > > // See 1GD5CA6: ITPUI:ALL - TaskView.setSelection does not work >@@ -277,6 +294,15 @@ > for (int i = 0; i < listeners.length; ++i) { > ((IPropertyChangeListener) listeners[i]).propertyChange(new PropertyChangeEvent(this, actionId, null, null)); > } >+} >+/** >+ * Returns the style bits for this this cell editor. >+ * >+ * @return the style for this cell editor >+ * @since 2.1 >+ */ >+public int getStyle() { >+ return style; > } > /** > * Returns the control used to implement this cell editor. >Index: CheckboxCellEditor.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jface/src/org/eclipse/jface/viewers/CheckboxCellEditor.java,v >retrieving revision 1.1 >diff -u -r1.1 CheckboxCellEditor.java >--- CheckboxCellEditor.java 24 Sep 2002 16:36:54 -0000 1.1 >+++ CheckboxCellEditor.java 17 Oct 2002 13:10:07 -0000 >@@ -5,6 +5,7 @@ > * All Rights Reserved. > */ > import org.eclipse.jface.util.Assert; >+import org.eclipse.swt.SWT; > import org.eclipse.swt.widgets.*; > > /** >@@ -34,7 +35,19 @@ > * @param parent the parent control > */ > public CheckboxCellEditor(Composite parent) { >- super(parent); >+ this(parent, SWT.NONE); >+} >+/** >+ * Creates a new checkbox cell editor parented under the given control. >+ * The cell editor value is a boolean value, which is initially <code>false</code>. >+ * Initially, the cell editor has no cell validator. >+ * >+ * @param parent the parent control >+ * @param style the style bits >+ * @since 2.1 >+ */ >+public CheckboxCellEditor(Composite parent, int style) { >+ super(parent, style); > } > /** > * The <code>CheckboxCellEditor</code> implementation of >Index: ColorCellEditor.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jface/src/org/eclipse/jface/viewers/ColorCellEditor.java,v >retrieving revision 1.1 >diff -u -r1.1 ColorCellEditor.java >--- ColorCellEditor.java 24 Sep 2002 16:36:54 -0000 1.1 >+++ ColorCellEditor.java 17 Oct 2002 13:10:07 -0000 >@@ -90,7 +90,19 @@ > * @param parent the parent control > */ > public ColorCellEditor(Composite parent) { >- super(parent); >+ this(parent, SWT.NONE); >+} >+/** >+ * Creates a new color cell editor parented under the given control. >+ * The cell editor value is black (<code>RGB(0,0,0)</code>) initially, and has no >+ * validator. >+ * >+ * @param parent the parent control >+ * @param style the style bits >+ * @since 2.1 >+ */ >+public ColorCellEditor(Composite parent, int style) { >+ super(parent, style); > doSetValue(new RGB(0, 0, 0)); > } > /** >@@ -148,7 +160,7 @@ > */ > protected Control createContents(Composite cell) { > Color bg = cell.getBackground(); >- composite = new Composite(cell, SWT.NONE); >+ composite = new Composite(cell, getStyle()); > composite.setBackground(bg); > composite.setLayout(new ColorCellLayout()); > colorLabel = new Label(composite, SWT.LEFT); >Index: ComboBoxCellEditor.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jface/src/org/eclipse/jface/viewers/ComboBoxCellEditor.java,v >retrieving revision 1.1 >diff -u -r1.1 ComboBoxCellEditor.java >--- ComboBoxCellEditor.java 24 Sep 2002 16:36:54 -0000 1.1 >+++ ComboBoxCellEditor.java 17 Oct 2002 13:10:07 -0000 >@@ -48,7 +48,22 @@ > * @param items the list of strings for the combo box > */ > public ComboBoxCellEditor(Composite parent, String[] items) { >- super(parent); >+ this(parent, items, SWT.NONE); >+} >+/** >+ * Creates a new cell editor with a combo containing the given >+ * list of choices and parented under the given control. The cell >+ * editor value is the zero-based index of the selected item. >+ * Initially, the cell editor has no cell validator and >+ * the first item in the list is selected. >+ * >+ * @param parent the parent control >+ * @param items the list of strings for the combo box >+ * @param style the style bits >+ * @since 2.1 >+ */ >+public ComboBoxCellEditor(Composite parent, String[] items, int style) { >+ super(parent, style); > Assert.isNotNull(items); > this.items = items; > selection = 0; >@@ -59,7 +74,7 @@ > */ > protected Control createControl(Composite parent) { > >- comboBox = new CCombo(parent, SWT.NONE); >+ comboBox = new CCombo(parent, getStyle()); > comboBox.setFont(parent.getFont()); > > comboBox.addKeyListener(new KeyAdapter() { >Index: DialogCellEditor.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jface/src/org/eclipse/jface/viewers/DialogCellEditor.java,v >retrieving revision 1.2 >diff -u -r1.2 DialogCellEditor.java >--- DialogCellEditor.java 25 Sep 2002 17:28:03 -0000 1.2 >+++ DialogCellEditor.java 17 Oct 2002 13:10:07 -0000 >@@ -100,7 +100,19 @@ > * @param parent the parent control > */ > protected DialogCellEditor(Composite parent) { >- super(parent); >+ this(parent, SWT.NONE); >+} >+/** >+ * Creates a new dialog cell editor parented under the given control. >+ * The cell editor value is <code>null</code> initially, and has no >+ * validator. >+ * >+ * @param parent the parent control >+ * @param style the style bits >+ * @since 2.1 >+ */ >+protected DialogCellEditor(Composite parent, int style) { >+ super(parent, style); > } > /** > * Creates the button for this cell editor under the given parent control. >@@ -145,7 +157,7 @@ > Font font = parent.getFont(); > Color bg = parent.getBackground(); > >- editor = new Composite(parent, SWT.NONE); >+ editor = new Composite(parent, getStyle()); > editor.setFont(font); > editor.setBackground(bg); > editor.setLayout(new DialogCellLayout()); >Index: TextCellEditor.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jface/src/org/eclipse/jface/viewers/TextCellEditor.java,v >retrieving revision 1.1 >diff -u -r1.1 TextCellEditor.java >--- TextCellEditor.java 24 Sep 2002 16:36:54 -0000 1.1 >+++ TextCellEditor.java 17 Oct 2002 13:10:07 -0000 >@@ -43,7 +43,21 @@ > * @param parent the parent control > */ > public TextCellEditor(Composite parent) { >- super(parent); >+ // specify no borders on text widget as cell outline in >+ // table already provides the look of a border. >+ this(parent, SWT.SINGLE); >+} >+/** >+ * Creates a new text string cell editor parented under the given control. >+ * The cell editor value is the string itself, which is initially the empty string. >+ * Initially, the cell editor has no cell validator. >+ * >+ * @param parent the parent control >+ * @param style the style bits >+ * @since 2.1 >+ */ >+public TextCellEditor(Composite parent, int style) { >+ super(parent, style); > } > /** > * Checks to see if the "deleteable" state (can delete/ >@@ -85,9 +99,7 @@ > * Method declared on CellEditor. > */ > protected Control createControl(Composite parent) { >- // specify no borders on text widget as cell outline in >- // table already provides the look of a border. >- text = new Text(parent, SWT.SINGLE); >+ text = new Text(parent, getStyle()); > text.addKeyListener(new KeyAdapter() { > // hook key pressed - see PR 14201 > public void keyPressed(KeyEvent e) {
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 Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 12329
: 2229