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


Java IStructuredSelection类代码示例

本文整理汇总了Java中org.eclipse.jface.viewers.IStructuredSelection的典型用法代码示例。如果您正苦于以下问题:Java IStructuredSelection类的具体用法?Java IStructuredSelection怎么用?Java IStructuredSelection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IStructuredSelection类属于org.eclipse.jface.viewers包,在下文中一共展示了IStructuredSelection类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getQueryList

import org.eclipse.jface.viewers.IStructuredSelection; //导入依赖的package包/类
protected Collection<QueryBean> getQueryList ()
{
    final IStructuredSelection sel = getSelection ();

    if ( sel == null )
    {
        return Collections.emptyList ();

    }

    final Collection<QueryBean> result = new LinkedList<QueryBean> ();
    final Iterator<?> i = sel.iterator ();
    while ( i.hasNext () )
    {
        final Object o = i.next ();
        if ( o instanceof QueryBean )
        {
            result.add ( (QueryBean)o );
        }
    }

    return result;
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:24,代码来源:AbstractQueryHandler.java

示例2: addRServices

import org.eclipse.jface.viewers.IStructuredSelection; //导入依赖的package包/类
/**
 * 
 */
protected void addRServices() {
	TabElementTreeSelectionDialog dialog = new TabElementTreeSelectionDialog(rServices.getInput(), rServicesFilters, rServicesBusinessFilters,
	"rServices", propertiesEditionComponent.getEditingContext().getAdapterFactory(), current.eResource()) {
		@Override
		public void process(IStructuredSelection selection) {
			for (Iterator<?> iter = selection.iterator(); iter.hasNext();) {
				EObject elem = (EObject) iter.next();
				propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(OtherPropertiesEditionPartImpl.this, LibraryViewsRepository.Other.Properties.rServices,
					PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.ADD, null, elem));
			}
			rServices.refresh();
		}
	};
	dialog.open();
}
 
开发者ID:polarsys,项目名称:time4sys,代码行数:19,代码来源:OtherPropertiesEditionPartImpl.java

示例3: addExitServices

import org.eclipse.jface.viewers.IStructuredSelection; //导入依赖的package包/类
/**
 * 
 */
protected void addExitServices() {
	TabElementTreeSelectionDialog dialog = new TabElementTreeSelectionDialog(exitServices.getInput(),
			exitServicesFilters, exitServicesBusinessFilters, "exitServices",
			propertiesEditionComponent.getEditingContext().getAdapterFactory(), current.eResource()) {
		@Override
		public void process(IStructuredSelection selection) {
			for (Iterator<?> iter = selection.iterator(); iter.hasNext();) {
				EObject elem = (EObject) iter.next();
				propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(
						OtherPropertiesEditionPartForm.this, SrmViewsRepository.Other.Properties.exitServices,
						PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.ADD, null, elem));
			}
			exitServices.refresh();
		}
	};
	dialog.open();
}
 
开发者ID:polarsys,项目名称:time4sys,代码行数:21,代码来源:OtherPropertiesEditionPartForm.java

示例4: addDelayServices

import org.eclipse.jface.viewers.IStructuredSelection; //导入依赖的package包/类
/**
 * 
 */
protected void addDelayServices() {
	TabElementTreeSelectionDialog dialog = new TabElementTreeSelectionDialog(delayServices.getInput(),
			delayServicesFilters, delayServicesBusinessFilters, "delayServices",
			propertiesEditionComponent.getEditingContext().getAdapterFactory(), current.eResource()) {
		@Override
		public void process(IStructuredSelection selection) {
			for (Iterator<?> iter = selection.iterator(); iter.hasNext();) {
				EObject elem = (EObject) iter.next();
				propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(
						OtherPropertiesEditionPartImpl.this, SrmViewsRepository.Other.Properties.delayServices,
						PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.ADD, null, elem));
			}
			delayServices.refresh();
		}
	};
	dialog.open();
}
 
开发者ID:polarsys,项目名称:time4sys,代码行数:21,代码来源:OtherPropertiesEditionPartImpl.java

示例5: addRServices

import org.eclipse.jface.viewers.IStructuredSelection; //导入依赖的package包/类
/**
 * 
 */
protected void addRServices() {
	TabElementTreeSelectionDialog dialog = new TabElementTreeSelectionDialog(rServices.getInput(), rServicesFilters, rServicesBusinessFilters,
	"rServices", propertiesEditionComponent.getEditingContext().getAdapterFactory(), current.eResource()) {
		@Override
		public void process(IStructuredSelection selection) {
			for (Iterator<?> iter = selection.iterator(); iter.hasNext();) {
				EObject elem = (EObject) iter.next();
				propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(OtherPropertiesEditionPartImpl.this, GrmViewsRepository.Other.OtherProperties.rServices,
					PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.ADD, null, elem));
			}
			rServices.refresh();
		}
	};
	dialog.open();
}
 
开发者ID:polarsys,项目名称:time4sys,代码行数:19,代码来源:OtherPropertiesEditionPartImpl.java

示例6: addReceiveServices

import org.eclipse.jface.viewers.IStructuredSelection; //导入依赖的package包/类
/**
 * 
 */
protected void addReceiveServices() {
	TabElementTreeSelectionDialog dialog = new TabElementTreeSelectionDialog(receiveServices.getInput(),
			receiveServicesFilters, receiveServicesBusinessFilters, "receiveServices",
			propertiesEditionComponent.getEditingContext().getAdapterFactory(), current.eResource()) {
		@Override
		public void process(IStructuredSelection selection) {
			for (Iterator<?> iter = selection.iterator(); iter.hasNext();) {
				EObject elem = (EObject) iter.next();
				propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(
						OtherPropertiesEditionPartImpl.this, SrmViewsRepository.Other.Properties.receiveServices,
						PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.ADD, null, elem));
			}
			receiveServices.refresh();
		}
	};
	dialog.open();
}
 
开发者ID:polarsys,项目名称:time4sys,代码行数:21,代码来源:OtherPropertiesEditionPartImpl.java

示例7: addMutualExclusionResources

import org.eclipse.jface.viewers.IStructuredSelection; //导入依赖的package包/类
/**
 * 
 */
protected void addMutualExclusionResources() {
	TabElementTreeSelectionDialog dialog = new TabElementTreeSelectionDialog(mutualExclusionResources.getInput(),
			mutualExclusionResourcesFilters, mutualExclusionResourcesBusinessFilters, "mutualExclusionResources",
			propertiesEditionComponent.getEditingContext().getAdapterFactory(), current.eResource()) {
		@Override
		public void process(IStructuredSelection selection) {
			for (Iterator<?> iter = selection.iterator(); iter.hasNext();) {
				EObject elem = (EObject) iter.next();
				propertiesEditionComponent
						.firePropertiesChanged(new PropertiesEditionEvent(TimingPropertiesEditionPartForm.this,
								SrmViewsRepository.Timing.Properties.mutualExclusionResources,
								PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.ADD, null, elem));
			}
			mutualExclusionResources.refresh();
		}
	};
	dialog.open();
}
 
开发者ID:polarsys,项目名称:time4sys,代码行数:22,代码来源:TimingPropertiesEditionPartForm.java

示例8: handleSelectionChanged

import org.eclipse.jface.viewers.IStructuredSelection; //导入依赖的package包/类
protected void handleSelectionChanged ( final ISelection sel )
{
    if ( sel == null || sel.isEmpty () )
    {
        return;
    }
    if ( ! ( sel instanceof IStructuredSelection ) )
    {
        return;
    }

    final Object o = ( (IStructuredSelection)sel ).getFirstElement ();
    if ( ! ( o instanceof ChartViewer ) )
    {
        return;
    }

    setChartViewer ( (ChartViewer)o );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:20,代码来源:AbstractChartManagePart.java

示例9: addClearServices

import org.eclipse.jface.viewers.IStructuredSelection; //导入依赖的package包/类
/**
 * 
 */
protected void addClearServices() {
	TabElementTreeSelectionDialog dialog = new TabElementTreeSelectionDialog(clearServices.getInput(),
			clearServicesFilters, clearServicesBusinessFilters, "clearServices",
			propertiesEditionComponent.getEditingContext().getAdapterFactory(), current.eResource()) {
		@Override
		public void process(IStructuredSelection selection) {
			for (Iterator<?> iter = selection.iterator(); iter.hasNext();) {
				EObject elem = (EObject) iter.next();
				propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(
						OtherPropertiesEditionPartForm.this, SrmViewsRepository.Other.Properties.clearServices,
						PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.ADD, null, elem));
			}
			clearServices.refresh();
		}
	};
	dialog.open();
}
 
开发者ID:polarsys,项目名称:time4sys,代码行数:21,代码来源:OtherPropertiesEditionPartForm.java

示例10: activateEditor

import org.eclipse.jface.viewers.IStructuredSelection; //导入依赖的package包/类
@Override
public void activateEditor(final IWorkbenchPage page, final IStructuredSelection selection) {
	if (null != selection && !selection.isEmpty()) {
		final Object firstElement = selection.getFirstElement();
		if (firstElement instanceof ResourceNode) {
			final File fileResource = ((ResourceNode) firstElement).getResource();
			if (fileResource.exists() && fileResource.isFile()) {
				final URI uri = URI.createFileURI(fileResource.getAbsolutePath());
				final IResource resource = externalLibraryWorkspace.getResource(uri);
				if (resource instanceof IFile) {
					final IEditorInput editorInput = EditorUtils.createEditorInput(new URIBasedStorage(uri));
					final IEditorPart editor = page.findEditor(editorInput);
					if (null != editor) {
						page.bringToTop(editor);
						return;
					}
				}
			}
		}
	}
	super.activateEditor(page, selection);
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:23,代码来源:N4JSResourceLinkHelper.java

示例11: selectionChanged

import org.eclipse.jface.viewers.IStructuredSelection; //导入依赖的package包/类
public void selectionChanged(IAction action, ISelection selection) {
	try {
		boolean enable = true;
		super.selectionChanged(action, selection);
		IStructuredSelection structuredSelection = (IStructuredSelection) selection;
		TreeObject treeObject = (TreeObject) structuredSelection.getFirstElement();
		if (treeObject instanceof ObjectsFolderTreeObject)
			enable = ((ObjectsFolderTreeObject)treeObject).folderType == ObjectsFolderTreeObject.FOLDER_TYPE_DOCUMENTS;
		else if (treeObject instanceof DatabaseObjectTreeObject) {
			DatabaseObject dbo = (DatabaseObject) treeObject.getObject();
			ActionModel actionModel = DatabaseObjectsAction.selectionChanged(getClass().getName(), dbo);
			enable = actionModel.isEnabled;
		}
		action.setEnabled(enable);
	}
	catch (Exception e) {}
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:18,代码来源:CreateDocumentAction.java

示例12: addReleaseServices

import org.eclipse.jface.viewers.IStructuredSelection; //导入依赖的package包/类
/**
 * 
 */
protected void addReleaseServices() {
	TabElementTreeSelectionDialog dialog = new TabElementTreeSelectionDialog(releaseServices.getInput(),
			releaseServicesFilters, releaseServicesBusinessFilters, "releaseServices",
			propertiesEditionComponent.getEditingContext().getAdapterFactory(), current.eResource()) {
		@Override
		public void process(IStructuredSelection selection) {
			for (Iterator<?> iter = selection.iterator(); iter.hasNext();) {
				EObject elem = (EObject) iter.next();
				propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(
						OtherPropertiesEditionPartImpl.this, SrmViewsRepository.Other.Properties.releaseServices,
						PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.ADD, null, elem));
			}
			releaseServices.refresh();
		}
	};
	dialog.open();
}
 
开发者ID:polarsys,项目名称:time4sys,代码行数:21,代码来源:OtherPropertiesEditionPartImpl.java

示例13: addRoutineConnectServices

import org.eclipse.jface.viewers.IStructuredSelection; //导入依赖的package包/类
/**
 * 
 */
protected void addRoutineConnectServices() {
	TabElementTreeSelectionDialog dialog = new TabElementTreeSelectionDialog(routineConnectServices.getInput(),
			routineConnectServicesFilters, routineConnectServicesBusinessFilters, "routineConnectServices",
			propertiesEditionComponent.getEditingContext().getAdapterFactory(), current.eResource()) {
		@Override
		public void process(IStructuredSelection selection) {
			for (Iterator<?> iter = selection.iterator(); iter.hasNext();) {
				EObject elem = (EObject) iter.next();
				propertiesEditionComponent
						.firePropertiesChanged(new PropertiesEditionEvent(OtherPropertiesEditionPartImpl.this,
								SrmViewsRepository.Other.Properties.routineConnectServices,
								PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.ADD, null, elem));
			}
			routineConnectServices.refresh();
		}
	};
	dialog.open();
}
 
开发者ID:polarsys,项目名称:time4sys,代码行数:22,代码来源:OtherPropertiesEditionPartImpl.java

示例14: addOpenServices

import org.eclipse.jface.viewers.IStructuredSelection; //导入依赖的package包/类
/**
 * 
 */
protected void addOpenServices() {
	TabElementTreeSelectionDialog dialog = new TabElementTreeSelectionDialog(openServices.getInput(),
			openServicesFilters, openServicesBusinessFilters, "openServices",
			propertiesEditionComponent.getEditingContext().getAdapterFactory(), current.eResource()) {
		@Override
		public void process(IStructuredSelection selection) {
			for (Iterator<?> iter = selection.iterator(); iter.hasNext();) {
				EObject elem = (EObject) iter.next();
				propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(
						OtherPropertiesEditionPartForm.this, SrmViewsRepository.Other.Properties.openServices,
						PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.ADD, null, elem));
			}
			openServices.refresh();
		}
	};
	dialog.open();
}
 
开发者ID:polarsys,项目名称:time4sys,代码行数:21,代码来源:OtherPropertiesEditionPartForm.java

示例15: updateToolbarOnSelectionChanged

import org.eclipse.jface.viewers.IStructuredSelection; //导入依赖的package包/类
protected void updateToolbarOnSelectionChanged(ISelection selection) {
	IStructuredSelection sel = (IStructuredSelection) selection;
	NSNode selectedNode = null;
	if (sel.isEmpty()) {
		selectedNode = schemaRegistry.getNameSpaceTree();
	} else {
		Object element = sel.getFirstElement();
		if (element instanceof NSNode) {
			selectedNode = (NSNode) element;
		}
	}		
	for (NameSpaceAction action : actions) {
		action.setNSNode(selectedNode);				
	}
	toolbarMgr.update(true);
}
 
开发者ID:Talend,项目名称:avro-schema-editor,代码行数:17,代码来源:SchemaRegistryView.java


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