/** * The <code>ComboBoxCellEditor</code> implementation of this * <code>CellEditor</code> framework method sets the minimum width of the * cell. The minimum width is 10 characters if <code>comboBox</code> is * not <code>null</code> or <code>disposed</code> eles it is 60 pixels * to make sure the arrow button and some text is visible. The list of * CCombo will be wide enough to show its longest item. */ public LayoutData getLayoutData() { LayoutData layoutData = super.getLayoutData(); if ((comboBox == null) || comboBox.isDisposed()) layoutData.minimumWidth = 60; else { // make the comboBox 10 characters wide GC gc = new GC(comboBox); layoutData.minimumWidth = (gc.getFontMetrics() .getAverageCharWidth() * 10) + 10; gc.dispose(); } return layoutData; }
/** * The <code>ComboBoxCellEditor</code> implementation of this * <code>CellEditor</code> framework method sets the minimum width of the * cell. The minimum width is 10 characters if <code>comboBox</code> is not * <code>null</code> or <code>disposed</code> eles it is 60 pixels to make * sure the arrow button and some text is visible. The list of CCombo will be * wide enough to show its longest item. */ public LayoutData getLayoutData() { LayoutData layoutData = super.getLayoutData(); if ((comboBox == null) || comboBox.isDisposed()) layoutData.minimumWidth = 60; else { // make the comboBox 10 characters wide GC gc = new GC(comboBox); layoutData.minimumWidth = (gc.getFontMetrics().getAverageCharWidth() * 10) + 10; gc.dispose(); } return layoutData; }
CellEditor.LayoutData layout = cellEditor.getLayoutData(); treeEditor.horizontalAlignment = layout.horizontalAlignment; treeEditor.grabHorizontal = layout.grabHorizontal;
CellEditor.LayoutData layout = cellEditor.getLayoutData(); treeEditor.horizontalAlignment = layout.horizontalAlignment; treeEditor.grabHorizontal = layout.grabHorizontal;
CellEditor.LayoutData layout = cellEditor.getLayoutData(); treeEditor.horizontalAlignment = layout.horizontalAlignment; treeEditor.grabHorizontal = layout.grabHorizontal;
if (control == null) return; setLayoutData(fCellEditor.getLayoutData()); setEditor(control, fTableItem, fColumnNumber); fCellEditor.setFocus();
return; setLayoutData(cellEditor.getLayoutData()); setEditor(control, tableItem, columnNumber); cellEditor.setFocus();
return false; setLayoutData(cellEditor.getLayoutData()); setEditor(control, (Item) cell.getItem(), cell.getColumnIndex()); cellEditor.setFocus();
return false; setLayoutData(cellEditor.getLayoutData()); setEditor(control, (Item) cell.getItem(), cell.getColumnIndex()); cellEditor.setFocus();
return false; setLayoutData(cellEditor.getLayoutData()); setEditor(control, (Item) cell.getItem(), cell.getColumnIndex()); cellEditor.setFocus();