本文整理汇总了Java中org.eclipse.swt.events.FocusListener类的典型用法代码示例。如果您正苦于以下问题:Java FocusListener类的具体用法?Java FocusListener怎么用?Java FocusListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FocusListener类属于org.eclipse.swt.events包,在下文中一共展示了FocusListener类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createViewer
import org.eclipse.swt.events.FocusListener; //导入依赖的package包/类
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;
}
示例2: createViewer
import org.eclipse.swt.events.FocusListener; //导入依赖的package包/类
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;
}
示例3: addComboInTable
import org.eclipse.swt.events.FocusListener; //导入依赖的package包/类
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;
}
示例4: fillComposite
import org.eclipse.swt.events.FocusListener; //导入依赖的package包/类
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);
}
示例5: addFocusListener
import org.eclipse.swt.events.FocusListener; //导入依赖的package包/类
@Override
public void addFocusListener(final FocusListener listener) {
dropToDiskText.addFocusListener(listener);
if (dropToTfVcText != null) {
dropToTfVcText.addFocusListener(listener);
}
controllerCombo.addFocusListener(listener);
}
示例6: addFocusListener
import org.eclipse.swt.events.FocusListener; //导入依赖的package包/类
/**
* {@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);
}
示例7: removeFocusListener
import org.eclipse.swt.events.FocusListener; //导入依赖的package包/类
/**
* {@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;
}
}
示例8: createText
import org.eclipse.swt.events.FocusListener; //导入依赖的package包/类
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;
}
示例9: addFocusListener
import org.eclipse.swt.events.FocusListener; //导入依赖的package包/类
public void addFocusListener( FocusListener listener )
{
if ( cba != null )
{
cba.addFocusListener( listener );
}
else
{
cbb.addFocusListener( listener );
}
}
示例10: focusLost
import org.eclipse.swt.events.FocusListener; //导入依赖的package包/类
@Override
public void focusLost(FocusEvent e) {
e.widget = BundleEntryComposite.this;
for (FocusListener listener : focusListeners)
listener.focusLost(e);
//textViewer.setSelectedRange(0, 0);
}
示例11: addSWTListener
import org.eclipse.swt.events.FocusListener; //导入依赖的package包/类
/**
* 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);
}
}
示例12: addFocusListener
import org.eclipse.swt.events.FocusListener; //导入依赖的package包/类
@Override
public void addFocusListener(final FocusListener listener) {
combo.addFocusListener(listener);
}
示例13: removeFocusListener
import org.eclipse.swt.events.FocusListener; //导入依赖的package包/类
@Override
public void removeFocusListener(final FocusListener listener) {
combo.removeFocusListener(listener);
}
示例14: addOwnerTextFocusListener
import org.eclipse.swt.events.FocusListener; //导入依赖的package包/类
public void addOwnerTextFocusListener(final FocusListener listener) {
ownerCombo.addFocusListener(listener);
}
示例15: removeOwnerTextFocusListener
import org.eclipse.swt.events.FocusListener; //导入依赖的package包/类
public void removeOwnerTextFocusListener(final FocusListener listener) {
ownerCombo.removeFocusListener(listener);
}