本文整理汇总了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 );
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
示例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;
}