Java 类org.eclipse.swt.events.FocusListener 实例源码

项目:gw4e.project    文件:EdgeActionSection.java   
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;
}
项目:gw4e.project    文件:EdgeGuardSection.java   
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;      
}
项目:Hydrograph    文件:FilterConditionsDialog.java   
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;
}
项目:gw4e.project    文件:VertexInitSection.java   
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);
}
项目:team-explorer-everywhere    文件:BuildDefaultsTabPage.java   
@Override
public void addFocusListener(final FocusListener listener) {
    dropToDiskText.addFocusListener(listener);
    if (dropToTfVcText != null) {
        dropToTfVcText.addFocusListener(listener);
    }
    controllerCombo.addFocusListener(listener);
}
项目:APICloud-Studio    文件:CustomAbstractInformationControl.java   
/**
 * {@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);
}
项目:APICloud-Studio    文件:CustomAbstractInformationControl.java   
/**
 * {@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;
    }
}
项目:data-mapper    文件:MappingRow.java   
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;
}
项目:birt    文件:FormatLayoutPeer.java   
public void addFocusListener( FocusListener listener )
{
    if ( cba != null )
    {
        cba.addFocusListener( listener );
    }
    else
    {
        cbb.addFocusListener( listener );
    }
}
项目:eclipse-rbe    文件:BundleEntryComposite.java   
@Override
public void focusLost(FocusEvent e) {
    e.widget = BundleEntryComposite.this;
    for (FocusListener listener : focusListeners)
        listener.focusLost(e);
    //textViewer.setSelectedRange(0, 0);
}
项目:ccu-historian    文件:ChartComposite.java   
/**
     * 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);
        }
    }
项目:team-explorer-everywhere    文件:ClassificationCombo.java   
@Override
public void addFocusListener(final FocusListener listener) {
    combo.addFocusListener(listener);
}
项目:team-explorer-everywhere    文件:ClassificationCombo.java   
@Override
public void removeFocusListener(final FocusListener listener) {
    combo.removeFocusListener(listener);
}
项目:team-explorer-everywhere    文件:ShelvesetSearchControl.java   
public void addOwnerTextFocusListener(final FocusListener listener) {
    ownerCombo.addFocusListener(listener);
}
项目:team-explorer-everywhere    文件:ShelvesetSearchControl.java   
public void removeOwnerTextFocusListener(final FocusListener listener) {
    ownerCombo.removeFocusListener(listener);
}
项目:aya-lang    文件:ChartComposite.java   
/**
     * 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);
        }
    }
项目:texlipse    文件:TexInformationControl.java   
public void addFocusListener(FocusListener listener) {
    shell.addFocusListener(listener);
}
项目:texlipse    文件:TexInformationControl.java   
public void removeFocusListener(FocusListener listener) {
    shell.removeFocusListener(listener);
}
项目:fluentmark    文件:FluentMkSourceViewerInfoControl.java   
@Override
public void addFocusListener(FocusListener listener) {
    text.addFocusListener(listener);
}
项目:fluentmark    文件:FluentMkSourceViewerInfoControl.java   
@Override
public void removeFocusListener(FocusListener listener) {
    text.removeFocusListener(listener);
}
项目:typescript.java    文件:AbstractInformationControl.java   
@Override
public void addFocusListener(FocusListener listener) {
    getShell().addFocusListener(listener);
}
项目:typescript.java    文件:AbstractInformationControl.java   
@Override
public void removeFocusListener(FocusListener listener) {
    getShell().removeFocusListener(listener);
}
项目:bts    文件:TranslationEditorComposite.java   
@Override
public void addFocusListener(FocusListener listener) {
    super.addFocusListener(listener);
    text.addFocusListener(listener);
    combo.addFocusListener(listener);
}
项目:bts    文件:TranslationEditorComposite.java   
@Override
public void removeFocusListener(FocusListener listener) {
    super.removeFocusListener(listener);
    text.removeFocusListener(listener);
    combo.removeFocusListener(listener);
}
项目:bts    文件:TextAnnotationsComposite.java   
@Override
public void addFocusListener(FocusListener listener) {
    super.addFocusListener(listener);
    canvas.addFocusListener(listener);
}
项目:bts    文件:XtextBrowserInformationControlAdapter.java   
public void removeFocusListener(FocusListener listener) {
    control.removeFocusListener(listener);
}
项目:bts    文件:XtextBrowserInformationControlAdapter.java   
public void addFocusListener(FocusListener listener) {
    control.addFocusListener(listener);
}
项目:bts    文件:SignTextComposite.java   
@Override
public void addFocusListener(FocusListener listener) {
    super.addFocusListener(listener);
    canvas.addFocusListener(listener);
}
项目:KaiZen-OpenAPI-Editor    文件:QuickOutline.java   
@Override
public void addFocusListener(FocusListener listener) {
    getShell().addFocusListener(listener);
}
项目:KaiZen-OpenAPI-Editor    文件:QuickOutline.java   
@Override
public void removeFocusListener(FocusListener listener) {
    getShell().removeFocusListener(listener);
}
项目:skin4eclipse    文件:AbstractPartListControl.java   
public void addFocusListener(FocusListener listener) {
    rootControl.addFocusListener(listener);
}
项目:skin4eclipse    文件:AbstractPartListControl.java   
public void removeFocusListener(FocusListener listener) {
    rootControl.removeFocusListener(listener);
}
项目:PDFReporter-Studio    文件:NullableText.java   
/**
 * @see org.eclipse.swt.widgets.Control#addFocusListener(org.eclipse.swt.events.FocusListener)
 */
public void addFocusListener(FocusListener listener) {
    text.addFocusListener(listener);
}
项目:PDFReporter-Studio    文件:NullableText.java   
/**
 * @see org.eclipse.swt.widgets.Control#removeFocusListener(org.eclipse.swt.events.FocusListener)
 */
public void removeFocusListener(FocusListener listener) {
    text.removeFocusListener(listener);
}
项目:PDFReporter-Studio    文件:MultiOutlineView.java   
public void addFocusListener(FocusListener listener) {
}
项目:PDFReporter-Studio    文件:MultiOutlineView.java   
public void removeFocusListener(FocusListener listener) {
}
项目:APICloud-Studio    文件:InformationControl.java   
/**
 * @see IInformationControl#addFocusListener(FocusListener)
 */
public void addFocusListener(FocusListener listener) {
    fText.addFocusListener(listener);
}
项目:APICloud-Studio    文件:InformationControl.java   
/**
 * @see IInformationControl#removeFocusListener(FocusListener)
 */
public void removeFocusListener(FocusListener listener) {
    fText.removeFocusListener(listener);
}
项目:APICloud-Studio    文件:FindBarActions.java   
/**
 * Creates a listener to manage the focus on buttons.
 */
public FocusListener createFocusListener(Button button)
{
    return new FindBarControlFocusListener(button);
}
项目:OpenSPIFe    文件:MultiLineStyledText.java   
@Override
public void addFocusListener(FocusListener focusListener) {
    stext.addFocusListener(focusListener);
}