/** * Constructs advisor for a viewer * * @param columnViewer ColumnViewer on which the advisor is installed */ public ColumnAdvisor(ColumnViewer columnViewer) { this.columnViewer = columnViewer; this.control = columnViewer.getControl(); this.control.addMouseTrackListener( new MouseTrackAdapter() { public void mouseEnter(MouseEvent e) { handleMouseOver(e); } public void mouseExit(MouseEvent e) { handleMouseExit(e); } }); this.control.addMouseMoveListener( new MouseMoveListener() { public void mouseMove(MouseEvent e) { handleMouseOver(e); } }); this.control.addMouseListener( new MouseAdapter() { @Override public void mouseUp(MouseEvent e) { handleMouseUp(e); } }); }
@Override protected CellEditor getCellEditor(Object element) { allowedKeys = getAllowedKeys(); cellEditor = new ComboBoxCellEditor((Composite) viewer.getControl(), allowedKeys, SWT.READ_ONLY); return cellEditor; }
@Override protected void initialize(ColumnViewer viewer, ViewerColumn column) { super.initialize(viewer, column); Font font = viewer.getControl().getFont(); if (font != null) { FontData data = font.getFontData()[0]; boldFont = new Font(font.getDevice(), data.getName(), data.getHeight(), SWT.BOLD); } }
public InlineComboEditingSupport(ColumnViewer viewer) { super(viewer); this.editor = new ComboBoxCellEditor((Composite) viewer.getControl(), new String[] {}, SWT.READ_ONLY); Control control = editor.getControl(); ((CCombo) control) .addSelectionListener( new SelectionListener() { public void widgetSelected(SelectionEvent e) { editor.deactivate(); } public void widgetDefaultSelected(SelectionEvent e) {} }); }
public void propertyChange(PropertyChangeEvent evt) { if (myColumnViewer.getControl().isDisposed()) { dispose(); return; } if (myData == null) { return; } if (GriddableSeries.PROPERTY_CHANGED.equals(evt.getPropertyName())) { myColumnViewer.refresh(evt.getNewValue(), true); } else if (GriddableSeries.PROPERTY_DELETED.equals(evt.getPropertyName()) || // GriddableSeries.PROPERTY_ADDED.equals(evt.getPropertyName())) { myColumnViewer.refresh(true); } }
/** * Create a new instance of the receiver. * * @param viewer the viewer where the editing support is being provided (cannot be <code>null * </code>) * @param columnID the column id */ public PropertyNameEditingSupport(ColumnViewer viewer, int columnID) { super(viewer); this.columnID = columnID; this.editor = new TextCellEditor((Composite) viewer.getControl()); }