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