当前位置: 首页>>代码示例>>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;未经允许,请勿转载。