当前位置: 首页>>代码示例>>Java>>正文


Java FocusListener类代码示例

本文整理汇总了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;
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:21,代码来源:EdgeActionSection.java

示例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;		
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:20,代码来源:EdgeGuardSection.java

示例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;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:23,代码来源:FilterConditionsDialog.java

示例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);
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:33,代码来源:VertexInitSection.java

示例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);
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:9,代码来源:BuildDefaultsTabPage.java

示例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);
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:33,代码来源:CustomAbstractInformationControl.java

示例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;
	}
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:14,代码来源:CustomAbstractInformationControl.java

示例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;
}
 
开发者ID:fabric8io,项目名称:data-mapper,代码行数:10,代码来源:MappingRow.java

示例9: addFocusListener

import org.eclipse.swt.events.FocusListener; //导入依赖的package包/类
public void addFocusListener( FocusListener listener )
{
	if ( cba != null )
	{
		cba.addFocusListener( listener );
	}
	else
	{
		cbb.addFocusListener( listener );
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:12,代码来源:FormatLayoutPeer.java

示例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);
}
 
开发者ID:allati,项目名称:eclipse-rbe,代码行数:8,代码来源:BundleEntryComposite.java

示例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);
        }
    }
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:47,代码来源:ChartComposite.java

示例12: addFocusListener

import org.eclipse.swt.events.FocusListener; //导入依赖的package包/类
@Override
public void addFocusListener(final FocusListener listener) {
    combo.addFocusListener(listener);
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:5,代码来源:ClassificationCombo.java

示例13: removeFocusListener

import org.eclipse.swt.events.FocusListener; //导入依赖的package包/类
@Override
public void removeFocusListener(final FocusListener listener) {
    combo.removeFocusListener(listener);
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:5,代码来源:ClassificationCombo.java

示例14: addOwnerTextFocusListener

import org.eclipse.swt.events.FocusListener; //导入依赖的package包/类
public void addOwnerTextFocusListener(final FocusListener listener) {
    ownerCombo.addFocusListener(listener);
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:4,代码来源:ShelvesetSearchControl.java

示例15: removeOwnerTextFocusListener

import org.eclipse.swt.events.FocusListener; //导入依赖的package包/类
public void removeOwnerTextFocusListener(final FocusListener listener) {
    ownerCombo.removeFocusListener(listener);
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:4,代码来源:ShelvesetSearchControl.java


注:本文中的org.eclipse.swt.events.FocusListener类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。