當前位置: 首頁>>代碼示例>>Java>>正文


Java SelectionChangedEvent.getSource方法代碼示例

本文整理匯總了Java中org.eclipse.jface.viewers.SelectionChangedEvent.getSource方法的典型用法代碼示例。如果您正苦於以下問題:Java SelectionChangedEvent.getSource方法的具體用法?Java SelectionChangedEvent.getSource怎麽用?Java SelectionChangedEvent.getSource使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.jface.viewers.SelectionChangedEvent的用法示例。


在下文中一共展示了SelectionChangedEvent.getSource方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: selectionChanged

import org.eclipse.jface.viewers.SelectionChangedEvent; //導入方法依賴的package包/類
public void selectionChanged(SelectionChangedEvent event) {
	if (event.getSource() instanceof ISelectionProvider) {
		IStructuredSelection selection = (IStructuredSelection) event.getSelection();
		TreeObject treeObject = (TreeObject) selection.getFirstElement();
		if (treeObject != null) {
			ConnectorTreeObject connectorTreeObject = treeObject.getConnectorTreeObject();
			if (connectorTreeObject != null) {
				Connector connector =  (Connector)connectorTreeObject.getObject();
				if (connector.equals(htmlConnector)) {
					if (treeObject instanceof TransactionTreeObject) {
						if (!htmlConnector.isLearning())
							toolLearn.setEnabled(true);
					}
					else {
						if (!htmlConnector.isLearning())
							toolLearn.setEnabled(false);
					}
				}
				else {
					if (!htmlConnector.isLearning())
						toolLearn.setEnabled(false);
				}
			}
		}
	}
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:27,代碼來源:HtmlConnectorDesignComposite.java

示例2: modifyEvent

import org.eclipse.jface.viewers.SelectionChangedEvent; //導入方法依賴的package包/類
/**
 * Ensures that IProject is present as first element
 * and DBPair is present as second element of the selection.
 */
private SelectionChangedEvent modifyEvent(SelectionChangedEvent event, DBPair dbPair) {
    ISelection selection = event.getSelection();
    if (selection.isEmpty()) {
        return defaultSelectionEvent;
    }
    if (!(selection instanceof IStructuredSelection)) {
        Log.log(Log.LOG_WARNING, "Cannot handle this selection type: " + selection.toString()); //$NON-NLS-1$
        // no way to deal with empty/other types of selections
        return defaultSelectionEvent;
    }

    IStructuredSelection sel = (IStructuredSelection) selection;
    List<?> elements = sel.toList();

    List<Object> newElements = new ArrayList<>(elements.size() + 2);
    newElements.add(proj);
    newElements.add(dbPair);
    newElements.addAll(elements);

    return new SelectionChangedEvent((ISelectionProvider) event.getSource(),
            new StructuredSelection(newElements));
}
 
開發者ID:pgcodekeeper,項目名稱:pgcodekeeper,代碼行數:27,代碼來源:ProjectEditorSelectionProvider.java

示例3: selectionChanged

import org.eclipse.jface.viewers.SelectionChangedEvent; //導入方法依賴的package包/類
/**
 * Handles tree view selection
 */

public void selectionChanged(SelectionChangedEvent event) {
	if (event.getSource() instanceof ISelectionProvider) {
		IStructuredSelection selection = (IStructuredSelection) event.getSelection();
		TreeObject treeObject = (TreeObject) selection.getFirstElement();
		if (treeObject != null) {
			if (ILearnable.class.isAssignableFrom(this.getClass()) && (!HttpConnectorComposite.class.equals(this.getClass()))) {
				ConnectorTreeObject connectorTreeObject = treeObject.getConnectorTreeObject();
				if (connectorTreeObject != null) {
					Connector connector =  (Connector)connectorTreeObject.getObject();
					if (connector.equals(this.connector)) {
						if (treeObject instanceof TransactionTreeObject) {
							if (!this.connector.isLearning())
								toolBarSetEnable("Learn", true);
						}
						else {
							if (!this.connector.isLearning())
								toolBarSetEnable("Learn", false);
						}
					}
					else {
						if (!this.connector.isLearning())
							toolBarSetEnable("Learn", false);
					}
				}
			}
		}
	}
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:33,代碼來源:AbstractConnectorComposite.java

示例4: selectionChanged

import org.eclipse.jface.viewers.SelectionChangedEvent; //導入方法依賴的package包/類
/**
 * Handles tree view selection
 */

public void selectionChanged(SelectionChangedEvent event) {
	if (event.getSource() instanceof ISelectionProvider) {
		IStructuredSelection selection = (IStructuredSelection) event.getSelection();
		TreeObject treeObject = (TreeObject) selection.getFirstElement();
		if (treeObject != null) {
		}
	}
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:13,代碼來源:AbstractSequenceComposite.java


注:本文中的org.eclipse.jface.viewers.SelectionChangedEvent.getSource方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。