protected SourceViewer createViewer (Composite composite) { SourceViewer viewer = ViewerHelper.createEditor(composite); viewer.getControl().setData(WIDGET_ID, WIDGET_ACTION_SCRIPT); FocusListener listener = new FocusListener() { @Override public void focusGained(FocusEvent e) { } @Override public void focusLost(FocusEvent event) { if (!notification) return; if (viewer.getDocument() == null) return; String content = viewer.getDocument().get(); getProperties().setPropertyValue(ModelProperties.PROPERTY_EDGE_ACTION, content); } }; viewer.getControl().addFocusListener(listener); return viewer; }
protected SourceViewer createViewer (Composite composite) { SourceViewer viewer = ViewerHelper.createEditor(composite); viewer.getControl().setData(WIDGET_ID, WIDGET_GUARD_SCRIPT); FocusListener listener = new FocusListener() { @Override public void focusGained(FocusEvent e) { } @Override public void focusLost(FocusEvent event) { if (!notification) return; if (viewer.getDocument() == null) return; String content = viewer.getDocument().get(); getProperties().setPropertyValue(ModelProperties.PROPERTY_EDGE_GUARD, content); } }; viewer.getControl().addFocusListener(listener); return viewer; }
private CCombo addComboInTable(TableViewer tableViewer, TableItem tableItem, String comboName, String comboPaneName, String editorName, int columnIndex, String[] relationalOperators, SelectionListener dropDownSelectionListener, ModifyListener modifyListener,FocusListener focusListener) { final Composite buttonPane = new Composite(tableViewer.getTable(), SWT.NONE); buttonPane.setLayout(new FillLayout()); final CCombo combo = new CCombo(buttonPane, SWT.NONE); combo.setItems(relationalOperators); combo.setData(FilterConstants.ROW_INDEX, tableViewer.getTable().indexOf(tableItem)); tableItem.setData(comboName, combo); tableItem.setData(comboPaneName, buttonPane); combo.addSelectionListener(dropDownSelectionListener); combo.addModifyListener(modifyListener); combo.addFocusListener(focusListener); new AutoCompleteField(combo, new CComboContentAdapter(), combo.getItems()); final TableEditor editor = new TableEditor(tableViewer.getTable()); editor.grabHorizontal = true; editor.grabVertical = true; editor.setEditor(buttonPane, tableItem, columnIndex); editor.layout(); combo.setData(editorName, editor); return combo; }
protected void fillComposite (Composite composite) { composite.setLayout(new FormLayout()); viewer = ViewerHelper.createEditor(composite); viewer.getControl().setData(WIDGET_ID, WIDGET_SCRIPT); FocusListener listener = new FocusListener() { @Override public void focusGained(FocusEvent e) { } @Override public void focusLost(FocusEvent event) { if (!notification) return; GW4EVertexEditPartProperties properties = (GW4EVertexEditPartProperties) node.getAdapter(IPropertySource.class); if (viewer.getDocument() == null) return; String content = viewer.getDocument().get(); properties.setPropertyValue(ModelProperties.PROPERTY_VERTEX_INIT, content); } }; viewer.getControl().addFocusListener(listener); Control control = viewer.getControl(); control.setEnabled(false); FormData fd_javaScript = new FormData(); fd_javaScript.left = new FormAttachment(0, 10); fd_javaScript.right = new FormAttachment(100, -5); fd_javaScript.top = new FormAttachment(0, 10); setHeight (fd_javaScript, control, 10); control.setLayoutData(fd_javaScript); }
@Override public void addFocusListener(final FocusListener listener) { dropToDiskText.addFocusListener(listener); if (dropToTfVcText != null) { dropToTfVcText.addFocusListener(listener); } controllerCombo.addFocusListener(listener); }
/** * {@inheritDoc} This method is not intended to be overridden by subclasses. */ public void addFocusListener(final FocusListener listener) { if (fFocusListeners.isEmpty()) { fShellListener = new Listener() { public void handleEvent(Event event) { Object[] listeners = fFocusListeners.getListeners(); for (int i = 0; i < listeners.length; i++) { FocusListener focusListener = (FocusListener) listeners[i]; if (event.type == SWT.Activate) { focusListener.focusGained(new FocusEvent(event)); } else { focusListener.focusLost(new FocusEvent(event)); } } } }; fShell.addListener(SWT.Deactivate, fShellListener); fShell.addListener(SWT.Activate, fShellListener); } fFocusListeners.add(listener); }
/** * {@inheritDoc} This method is not intended to be overridden by subclasses. */ public void removeFocusListener(FocusListener listener) { fFocusListeners.remove(listener); if (fFocusListeners.isEmpty()) { fShell.removeListener(SWT.Activate, fShellListener); fShell.removeListener(SWT.Deactivate, fShellListener); fShellListener = null; } }
private Text createText(final Composite parent, final FocusListener focusListener, final KeyListener keyListener) { final Text text = new Text(parent, SWT.BORDER); text.setEditable(false); text.addFocusListener(focusListener); text.addKeyListener(keyListener); return text; }
public void addFocusListener( FocusListener listener ) { if ( cba != null ) { cba.addFocusListener( listener ); } else { cbb.addFocusListener( listener ); } }
@Override public void focusLost(FocusEvent e) { e.widget = BundleEntryComposite.this; for (FocusListener listener : focusListeners) listener.focusLost(e); //textViewer.setSelectedRange(0, 0); }
/** * Hook an SWT listener on the canvas where the chart is drawn. * The purpose of this method is to allow some degree of customization. * * @param listener The SWT listener to attach to the canvas. */ public void addSWTListener(EventListener listener) { if (listener instanceof ControlListener) { this.canvas.addControlListener((ControlListener) listener); } else if (listener instanceof DisposeListener) { this.canvas.addDisposeListener((DisposeListener) listener); // } // else if (listener instanceof DragDetectListener) { // this.canvas.addDragDetectListener((DragDetectListener) listener); } else if (listener instanceof FocusListener) { this.canvas.addFocusListener((FocusListener) listener); } else if (listener instanceof HelpListener) { this.canvas.addHelpListener((HelpListener) listener); } else if (listener instanceof KeyListener) { this.canvas.addKeyListener((KeyListener) listener); // } // else if (listener instanceof MenuDetectListener) { // this.canvas.addMenuDetectListener((MenuDetectListener) listener); } else if (listener instanceof MouseListener) { this.canvas.addMouseListener((MouseListener) listener); } else if (listener instanceof MouseMoveListener) { this.canvas.addMouseMoveListener((MouseMoveListener) listener); } else if (listener instanceof MouseTrackListener) { this.canvas.addMouseTrackListener((MouseTrackListener) listener); // } else if (listener instanceof MouseWheelListener) { // this.canvas.addMouseWheelListener((MouseWheelListener) listener); } else if (listener instanceof PaintListener) { this.canvas.addPaintListener((PaintListener) listener); } else if (listener instanceof TraverseListener) { this.canvas.addTraverseListener((TraverseListener) listener); } }
@Override public void addFocusListener(final FocusListener listener) { combo.addFocusListener(listener); }
@Override public void removeFocusListener(final FocusListener listener) { combo.removeFocusListener(listener); }
public void addOwnerTextFocusListener(final FocusListener listener) { ownerCombo.addFocusListener(listener); }
public void removeOwnerTextFocusListener(final FocusListener listener) { ownerCombo.removeFocusListener(listener); }
public void addFocusListener(FocusListener listener) { shell.addFocusListener(listener); }
public void removeFocusListener(FocusListener listener) { shell.removeFocusListener(listener); }
@Override public void addFocusListener(FocusListener listener) { text.addFocusListener(listener); }
@Override public void removeFocusListener(FocusListener listener) { text.removeFocusListener(listener); }
@Override public void addFocusListener(FocusListener listener) { getShell().addFocusListener(listener); }
@Override public void removeFocusListener(FocusListener listener) { getShell().removeFocusListener(listener); }
@Override public void addFocusListener(FocusListener listener) { super.addFocusListener(listener); text.addFocusListener(listener); combo.addFocusListener(listener); }
@Override public void removeFocusListener(FocusListener listener) { super.removeFocusListener(listener); text.removeFocusListener(listener); combo.removeFocusListener(listener); }
@Override public void addFocusListener(FocusListener listener) { super.addFocusListener(listener); canvas.addFocusListener(listener); }
public void removeFocusListener(FocusListener listener) { control.removeFocusListener(listener); }
public void addFocusListener(FocusListener listener) { control.addFocusListener(listener); }
public void addFocusListener(FocusListener listener) { rootControl.addFocusListener(listener); }
public void removeFocusListener(FocusListener listener) { rootControl.removeFocusListener(listener); }
/** * @see org.eclipse.swt.widgets.Control#addFocusListener(org.eclipse.swt.events.FocusListener) */ public void addFocusListener(FocusListener listener) { text.addFocusListener(listener); }
/** * @see org.eclipse.swt.widgets.Control#removeFocusListener(org.eclipse.swt.events.FocusListener) */ public void removeFocusListener(FocusListener listener) { text.removeFocusListener(listener); }
public void addFocusListener(FocusListener listener) { }
public void removeFocusListener(FocusListener listener) { }
/** * @see IInformationControl#addFocusListener(FocusListener) */ public void addFocusListener(FocusListener listener) { fText.addFocusListener(listener); }
/** * @see IInformationControl#removeFocusListener(FocusListener) */ public void removeFocusListener(FocusListener listener) { fText.removeFocusListener(listener); }
/** * Creates a listener to manage the focus on buttons. */ public FocusListener createFocusListener(Button button) { return new FindBarControlFocusListener(button); }
@Override public void addFocusListener(FocusListener focusListener) { stext.addFocusListener(focusListener); }