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


Java AdapterFactoryLabelProvider類代碼示例

本文整理匯總了Java中org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider的典型用法代碼示例。如果您正苦於以下問題:Java AdapterFactoryLabelProvider類的具體用法?Java AdapterFactoryLabelProvider怎麽用?Java AdapterFactoryLabelProvider使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


AdapterFactoryLabelProvider類屬於org.eclipse.emf.edit.ui.provider包,在下文中一共展示了AdapterFactoryLabelProvider類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createPartControl

import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; //導入依賴的package包/類
@Override
public void createPartControl ( final Composite parent )
{
    this.container = parent;
    createEditingDomain ();

    parent.setLayout ( new FillLayout () );
    this.viewer = new TreeViewer ( parent );
    this.viewer.setAutoExpandLevel ( 2 );

    this.viewer.setContentProvider ( new AdapterFactoryContentProvider ( this.factory ) );
    this.viewer.setLabelProvider ( new AdapterFactoryLabelProvider ( this.factory ) );

    createContextMenuFor ( this.viewer );

    new AdapterFactoryTreeEditor ( this.viewer.getTree (), this.factory );
    getViewSite ().setSelectionProvider ( this.viewer );

    attachSelectionService ();

    getViewSite ().getActionBars ().getMenuManager ().add ( new Separator ( "additions" ) );

    this.actionBarContributor.init ( getViewSite ().getActionBars () );
    this.actionBarContributor.setViewPart ( this );
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:26,代碼來源:ChartConfiguratorView.java

示例2: createFieldEditors

import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; //導入依賴的package包/類
/**
 * Create contents of the preference page.
 */
@Override
protected void createFieldEditors() {
	// Create the field editors
	IPreferenceStore store = new ScopedPreferenceStore(InstanceScope.INSTANCE, "org.bbaw.bts.app");
	Composite container = (Composite) this.getControl();
	container.setLayout(new GridLayout(1, false));

	Label activeConfigLB = new Label(container, SWT.NONE);
	activeConfigLB.setLayoutData(new GridData(SWT.RIGHT, SWT.TOP, false,
			false, 1, 1));
	activeConfigLB.setText("Currently active Configuration");

	activeConfigcomboViewer = new ComboViewer(container, SWT.READ_ONLY);
	activeConfigcomboViewer.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true,
			false, 1, 1));
	ComposedAdapterFactory factory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
	AdapterFactoryLabelProvider labelProvider = new AdapterFactoryLabelProvider(factory);
	activeConfigcomboViewer.setContentProvider(new AdapterFactoryContentProvider(factory));
	activeConfigcomboViewer.setLabelProvider(labelProvider);		
	
	
	init(null);
	loaded = true;
}
 
開發者ID:cplutte,項目名稱:bts,代碼行數:28,代碼來源:ConfigurationPage.java

示例3: selectElement

import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; //導入依賴的package包/類
/**
 * @generated
 */
protected EObject selectElement(EObject[] elements) {
	Shell shell = Display.getCurrent().getActiveShell();
	ILabelProvider labelProvider = new AdapterFactoryLabelProvider(
			StatemachineDiagramEditorPlugin.getInstance()
					.getItemProvidersAdapterFactory());
	ElementListSelectionDialog dialog = new ElementListSelectionDialog(
			shell, labelProvider);
	dialog.setMessage(Messages.StatemachineModelingAssistantProviderMessage);
	dialog.setTitle(Messages.StatemachineModelingAssistantProviderTitle);
	dialog.setMultipleSelection(false);
	dialog.setElements(elements);
	EObject selected = null;
	if (dialog.open() == Window.OK) {
		selected = (EObject) dialog.getFirstResult();
	}
	return selected;
}
 
開發者ID:spoenemann,項目名稱:xtext-gef,代碼行數:21,代碼來源:StatemachineModelingAssistantProvider.java

示例4: init

import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; //導入依賴的package包/類
private void init() {
	this.setLayout(new GridLayout(2, false));
	viewer = new TableViewer(this, SWT.SINGLE | SWT.BORDER);
	viewer.setContentProvider(new ArrayContentProvider());
	viewer.setLabelProvider(new AdapterFactoryLabelProvider(new SGraphItemProviderAdapterFactory()));
	Composite buttonComposite = getToolkit().createComposite(this);
	buttonComposite.setLayout(new FillLayout(SWT.VERTICAL));
	btnUp = getToolkit().createButton(buttonComposite, "up", SWT.PUSH);
	btnDown = getToolkit().createButton(buttonComposite, "down", SWT.PUSH);
	viewer.addSelectionChangedListener(enableButtonListener);
	viewer.addSelectionChangedListener(editPartSelectionListener);
	btnUp.addSelectionListener(upButtonListener);
	btnDown.addSelectionListener(downButtonListener);
	GridDataFactory.fillDefaults().applyTo(viewer.getControl());
	GridDataFactory.fillDefaults().applyTo(buttonComposite);
	GridDataFactory.fillDefaults().grab(true, false).applyTo(viewer.getControl());
	GridDataFactory.fillDefaults().grab(true, false).applyTo(this);
}
 
開發者ID:Yakindu,項目名稱:statecharts,代碼行數:19,代碼來源:OrderElementControl.java

示例5: openFirstInstructionSelection

import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; //導入依賴的package包/類
/**
 * Opens the {@link EObject first instruction} selection dialog.
 * 
 * @param shell
 *            the {@link Shell} to use for display
 * @param resourceSet
 *            the {@link ResourceSet} to get the first instruction from
 * @return the selected first instruction {@link URI} if any selected, <code>null</code> otherwise
 */
public static EObject openFirstInstructionSelection(final Shell shell, ResourceSet resourceSet) {
	final EObject res;
	final ComposedAdapterFactory fatory = new ComposedAdapterFactory(
			ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
	fatory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
	fatory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());

	ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(shell,
			new AdapterFactoryLabelProvider(fatory), new AdapterFactoryContentProvider(fatory));
	dialog.setTitle("Select first instruction");
	dialog.setMessage("Select the first instruction:");
	dialog.setInput(resourceSet);
	if (dialog.open() == Window.OK) {
		res = (EObject)dialog.getFirstResult();
	} else {
		res = null;
	}
	fatory.dispose();
	return res;
}
 
開發者ID:SiriusLab,項目名稱:ModelDebugging,代碼行數:30,代碼來源:DSLLaunchConfigurationTab.java

示例6: build

import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; //導入依賴的package包/類
@Override
public TimelineViewer build(PlanTimeline timeline, PlanReferencedObjectSection s) {
	EPlan plan = timeline.getPlan();
	PlanReferencedObjectSection section = s;
	PlanTimelineContentProvider contentProvider = new PlanReferencedObjectSectionContentProvider(plan, section);
	contentProvider.activate();
	
	PlanTimelineViewer viewer = new PlanTimelineViewer(timeline);
	viewer.setTreeTimelineContentProvider(contentProvider);
	viewer.setEditPartFactory(new PlanTimelineEditPartFactory());
	viewer.setTimelineSectionModel(section);
	viewer.setLabelProvider(new AdapterFactoryLabelProvider(EMFUtils.getAdapterFactory(section)));
	viewer.setProperty(TimelineConstants.TIMELINE_GROUP_ELEMENTS, false);
	viewer.setContents(plan);
	return viewer;
}
 
開發者ID:nasa,項目名稱:OpenSPIFe,代碼行數:17,代碼來源:PlanReferencedObjectSectionTimelineBuilder.java

示例7: build

import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; //導入依賴的package包/類
@Override
public TimelineViewer build(PlanTimeline timeline, final Section section) {
	EPlan plan = timeline.getPlan();
	CustomContentProvider contentProvider = new CustomContentProvider(plan, (PlanSection) section);
	contentProvider.activate();
	
	final PlanTimelineViewer viewer = new PlanTimelineViewer(timeline);
	viewer.setTreeTimelineContentProvider(contentProvider);
	viewer.setLabelProvider(new AdapterFactoryLabelProvider(EMFUtils.getAdapterFactory(section)));
	viewer.setEditPartFactory(new PlanTimelineEditPartFactory());
	viewer.setTimelineSectionModel(section);
	viewer.setProperty(TimelineConstants.TIMELINE_GROUP_ELEMENTS, false);
	viewer.setContents(plan);
	viewer.setTimelineToolBarContributionItem(new CustomTimelineToolBarContributor(viewer, section));
	return viewer;
}
 
開發者ID:nasa,項目名稱:OpenSPIFe,代碼行數:17,代碼來源:CustomTimelineBuilder.java

示例8: build

import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; //導入依賴的package包/類
@Override
public TimelineViewer build(Timeline timeline, Chart chart) {
	final EditingDomain domain = AdapterFactoryEditingDomain.getEditingDomainFor(chart);
	AdapterFactory factory = new ChartItemProviderAdapterFactory();//.getAdapterFactory(chart);
	AdapterFactoryLabelProvider labeler = new AdapterFactoryLabelProvider(factory);
	TimelineViewer viewer = new TimelineViewer(timeline);
	ChartStyle chartStyle = chart.getStyle();
	viewer.setTimelineSectionModel(chart);
	viewer.setImageDescriptor(ImageDescriptor.createFromImage(labeler.getImage(chart)));
	viewer.setLabelProvider(labeler);
	switch (chartStyle) {
	case HEAT_MAP:
		viewer.setTreeTimelineContentProvider(new ChartTimelineContentProvider());
		viewer.setEditPartFactory(new HeatMapChartTimelineEditPartFactory());
		viewer.setProperty(TimelineConstants.TIMELINE_GROUP_ELEMENTS, true);
		break;
	case LINE:
		viewer.setEditPartFactory(new LineChartTimelineFactory());
		break;
	}
	viewer.setTimelineToolBarContributionItem(new ChartTimelineToolBarContributor(timeline, chart, domain));
	viewer.setContents(chart);
	return viewer;
}
 
開發者ID:nasa,項目名稱:OpenSPIFe,代碼行數:25,代碼來源:ChartTimelineBuilder.java

示例9: createViewer

import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; //導入依賴的package包/類
protected TreeViewer createViewer(Composite composite) {
	TreeViewer treeViewer = new TreeViewer(composite);
	treeViewer.getTree().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
	
	ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory();
	adapterFactory.addAdapterFactory(new DecoratorEXTLibraryItemProviderAdapterFactory());
	adapterFactory.addAdapterFactory(new EXTLibraryItemProviderAdapterFactory());
	adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory());
	adapterFactory.addAdapterFactory(new TreeItemProviderAdapterFactory());
	adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
	adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
	
	treeViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
	treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
	
	return treeViewer;
}
 
開發者ID:mbarbero,項目名稱:econ-na-2014-emf-edit,代碼行數:18,代碼來源:NotYourFathersSWT.java

示例10: selectElement

import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; //導入依賴的package包/類
/**
 * @generated
 */
protected EObject selectElement(EObject[] elements) {
	Shell shell = Display.getCurrent().getActiveShell();
	ILabelProvider labelProvider = new AdapterFactoryLabelProvider(
			SmcDiagramEditorPlugin.getInstance()
					.getItemProvidersAdapterFactory());
	ElementListSelectionDialog dialog = new ElementListSelectionDialog(
			shell, labelProvider);
	dialog.setMessage(Messages.SmcModelingAssistantProviderMessage);
	dialog.setTitle(Messages.SmcModelingAssistantProviderTitle);
	dialog.setMultipleSelection(false);
	dialog.setElements(elements);
	EObject selected = null;
	if (dialog.open() == Window.OK) {
		selected = (EObject) dialog.getFirstResult();
	}
	return selected;
}
 
開發者ID:road-framework,項目名稱:ROADDesigner,代碼行數:21,代碼來源:SmcModelingAssistantProvider.java

示例11: selectElement

import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; //導入依賴的package包/類
/**
 * @generated
 */
protected EObject selectElement(EObject[] elements) {
	Shell shell = Display.getCurrent().getActiveShell();
	ILabelProvider labelProvider = new AdapterFactoryLabelProvider(
			Wc2014DiagramEditorPlugin.getInstance()
					.getItemProvidersAdapterFactory());
	ElementListSelectionDialog dialog = new ElementListSelectionDialog(
			shell, labelProvider);
	dialog.setMessage(Messages.Wc2014ModelingAssistantProviderMessage);
	dialog.setTitle(Messages.Wc2014ModelingAssistantProviderTitle);
	dialog.setMultipleSelection(false);
	dialog.setElements(elements);
	EObject selected = null;
	if (dialog.open() == Window.OK) {
		selected = (EObject) dialog.getFirstResult();
	}
	return selected;
}
 
開發者ID:ggxx,項目名稱:HelloBrazil,代碼行數:21,代碼來源:Wc2014ModelingAssistantProvider.java

示例12: selectElement

import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; //導入依賴的package包/類
/**
 * @generated
 */
protected EObject selectElement(EObject[] elements) {
	Shell shell = Display.getCurrent().getActiveShell();
	ILabelProvider labelProvider = new AdapterFactoryLabelProvider(
			SimpleBPMN.diagram.part.SimpleBPMNDiagramEditorPlugin
					.getInstance().getItemProvidersAdapterFactory());
	ElementListSelectionDialog dialog = new ElementListSelectionDialog(
			shell, labelProvider);
	dialog.setMessage(SimpleBPMN.diagram.part.Messages.SimpleBPMNModelingAssistantProviderMessage);
	dialog.setTitle(SimpleBPMN.diagram.part.Messages.SimpleBPMNModelingAssistantProviderTitle);
	dialog.setMultipleSelection(false);
	dialog.setElements(elements);
	EObject selected = null;
	if (dialog.open() == Window.OK) {
		selected = (EObject) dialog.getFirstResult();
	}
	return selected;
}
 
開發者ID:bluezio,項目名稱:simplified-bpmn-example,代碼行數:21,代碼來源:SimpleBPMNModelingAssistantProvider.java

示例13: selectElement

import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; //導入依賴的package包/類
/**
 * @generated
 */
protected EObject selectElement(EObject[] elements) {
	Shell shell = Display.getCurrent().getActiveShell();
	ILabelProvider labelProvider = new AdapterFactoryLabelProvider(
			ArmyDiagramEditorPlugin.getInstance()
					.getItemProvidersAdapterFactory());
	ElementListSelectionDialog dialog = new ElementListSelectionDialog(
			shell, labelProvider);
	dialog.setMessage(Messages.ArmyModelingAssistantProviderMessage);
	dialog.setTitle(Messages.ArmyModelingAssistantProviderTitle);
	dialog.setMultipleSelection(false);
	dialog.setElements(elements);
	EObject selected = null;
	if (dialog.open() == Window.OK) {
		selected = (EObject) dialog.getFirstResult();
	}
	return selected;
}
 
開發者ID:adisandro,項目名稱:MMINT,代碼行數:21,代碼來源:ArmyModelingAssistantProvider.java

示例14: createPartControl

import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; //導入依賴的package包/類
@Override
public void createPartControl(Composite parent) {
	layout = new StackLayout();
	parent.setLayout(layout);
	treeViewer = new TreeViewer(parent);
	
	treeViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
	treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
	
	new AdapterFactoryTreeEditor(treeViewer.getTree(), adapterFactory);
	
	textViewer = new TextViewer(parent, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
	
	layout.topControl = treeViewer.getControl();
	
	makeActions();
	contributeToActionBars();		
}
 
開發者ID:markus1978,項目名稱:clickwatch,代碼行數:19,代碼來源:ResultView.java

示例15: createDialogArea

import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; //導入依賴的package包/類
@Override
protected Control createDialogArea(Composite parent) {
  this.parent = parent;
  Composite area = (Composite) super.createDialogArea(parent);
  Composite container = new Composite(area, SWT.NONE);
  container.setLayoutData(new GridData(GridData.FILL_BOTH));
  GridLayout layout = new GridLayout(1, false);
  container.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
  container.setLayout(layout);

  treeViewer = new CheckboxTreeViewer(area, SWT.BORDER);

  Tree tree = treeViewer.getTree();
  tree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));

  treeViewer
      .setLabelProvider(new AdapterFactoryLabelProvider(new ReflectiveItemProviderAdapterFactory()));

  treeViewer
      .setContentProvider(new AdapterFactoryContentProvider(new ReflectiveItemProviderAdapterFactory()));

  treeViewer.setInput(modelRoot);
  return area;
}
 
開發者ID:atlanmod,項目名稱:emfviews,代碼行數:25,代碼來源:ModelSelectionDialog.java


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