當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。