本文整理匯總了Java中org.eclipse.emf.edit.ui.celleditor.AdapterFactoryTreeEditor類的典型用法代碼示例。如果您正苦於以下問題:Java AdapterFactoryTreeEditor類的具體用法?Java AdapterFactoryTreeEditor怎麽用?Java AdapterFactoryTreeEditor使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
AdapterFactoryTreeEditor類屬於org.eclipse.emf.edit.ui.celleditor包,在下文中一共展示了AdapterFactoryTreeEditor類的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createPartControl
import org.eclipse.emf.edit.ui.celleditor.AdapterFactoryTreeEditor; //導入依賴的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: createPartControl
import org.eclipse.emf.edit.ui.celleditor.AdapterFactoryTreeEditor; //導入依賴的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();
}
示例3: createUnresolvedInterfacesTreeView
import org.eclipse.emf.edit.ui.celleditor.AdapterFactoryTreeEditor; //導入依賴的package包/類
private TreeViewer createUnresolvedInterfacesTreeView(Composite parent, Object input){
TreeViewer treeViewer;
Tree tree = new Tree(parent, SWT.BORDER);
tree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
treeViewer = new TreeViewer(tree);
treeViewer.setContentProvider(new AdapterFactoryContentProvider(mainEditor.getAdapterFactory()));
treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(mainEditor.getAdapterFactory()));
treeViewer.setInput(input);
new AdapterFactoryTreeEditor(tree, mainEditor.getAdapterFactory());
return treeViewer;
}
示例4: createPartControl
import org.eclipse.emf.edit.ui.celleditor.AdapterFactoryTreeEditor; //導入依賴的package包/類
public void createPartControl(Composite parent) {
super.createPartControl(parent);
treeViewer = new TreeViewer(parent);
treeViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
new AdapterFactoryTreeEditor(treeViewer.getTree(), adapterFactory);
}
示例5: createPages
import org.eclipse.emf.edit.ui.celleditor.AdapterFactoryTreeEditor; //導入依賴的package包/類
/**
* This is the method used by the framework to install your own controls.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void createPages() {
// Creates the model from the editor input
//
createModel();
// Only creates the other pages if there is something that can be edited
//
if (!getEditingDomain().getResourceSet().getResources().isEmpty()) {
// Create a page for the selection tree view.
//
Tree tree = new Tree(getContainer(), SWT.MULTI);
selectionViewer = new TreeViewer(tree);
setCurrentViewer(selectionViewer);
selectionViewer
.setContentProvider(new AdapterFactoryContentProvider(
adapterFactory));
selectionViewer.setLabelProvider(new AdapterFactoryLabelProvider(
adapterFactory));
selectionViewer.setInput(editingDomain.getResourceSet());
selectionViewer.setSelection(new StructuredSelection(editingDomain
.getResourceSet().getResources().get(0)), true);
new AdapterFactoryTreeEditor(selectionViewer.getTree(),
adapterFactory);
createContextMenuFor(selectionViewer);
int pageIndex = addPage(tree);
setPageText(pageIndex, getString("_UI_SelectionPage_label"));
getSite().getShell().getDisplay().asyncExec(new Runnable() {
public void run() {
setActivePage(0);
}
});
}
// Ensures that this editor will only display the page's tab
// area if there are more than one page
//
getContainer().addControlListener(new ControlAdapter() {
boolean guard = false;
@Override
public void controlResized(ControlEvent event) {
if (!guard) {
guard = true;
hideTabs();
guard = false;
}
}
});
getSite().getShell().getDisplay().asyncExec(new Runnable() {
public void run() {
updateProblemIndication();
}
});
}
示例6: createPages
import org.eclipse.emf.edit.ui.celleditor.AdapterFactoryTreeEditor; //導入依賴的package包/類
@Override
public void createPages(ExeedEditor editor, Composite container, AdapterFactory adapterFactory) {
/*
* This is a slightly customized version of {@link EcoreEditor#createPages()}. The problem with
* Ecore'hawkState version is that its DiagnosticDecorator implementation will scan the tree from leaves
* to roots, propagating error markers. We need to disable this behaviour to be able to provide
* "lazy" loading, and we have no place to do it but right where the DiagnosticDecorator instance
* is created, as the setInput(...) call will start the redecoration process.
*/
editor.setShowAllResources(true);
// Creates the model from the editor input
editor.createModelGen();
// Only creates the other pages if there is something that can be edited
//
final EditingDomain editingDomain = editor.getEditingDomain();
if (!editingDomain.getResourceSet().getResources().isEmpty())
{
// Create a page for the selection tree view.
//
Tree tree = new Tree(container, SWT.MULTI);
TreeViewer selectionViewer = new TreeViewer(tree);
editor.setCurrentViewer(selectionViewer);
selectionViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
final IDialogSettings dialogSettings = EcoreEditorPlugin.getPlugin().getDialogSettings();
final DiagnosticDecorator labelDecorator = new SingleNodeDiagnosticDecorator(editingDomain, selectionViewer, dialogSettings);
selectionViewer.setLabelProvider(new DecoratingColumLabelProvider(new AdapterFactoryLabelProvider(adapterFactory), labelDecorator));
selectionViewer.setInput(editingDomain.getResourceSet());
selectionViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
new AdapterFactoryTreeEditor(selectionViewer.getTree(), adapterFactory);
new ColumnViewerInformationControlToolTipSupport(selectionViewer, new DiagnosticDecorator.EditingDomainLocationListener(editingDomain, selectionViewer));
editor.createContextMenuFor(selectionViewer);
int pageIndex = editor.addPage(tree);
editor.setPageText(pageIndex, EcoreEditorPlugin.INSTANCE.getString("_UI_SelectionPage_label"));
}
final IWorkbenchPage page = editor.getEditorSite().getPage();
page.addPartListener(new UnloadResourceSetOnCloseListener(page, editor));
}
示例7: createPages
import org.eclipse.emf.edit.ui.celleditor.AdapterFactoryTreeEditor; //導入依賴的package包/類
/**
* This is the method used by the framework to install your own controls.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void createPages() {
// Creates the model from the editor input
//
createModel();
// Only creates the other pages if there is something that can be edited
//
if (!getEditingDomain().getResourceSet().getResources().isEmpty()) {
// Create a page for the selection tree view.
//
Tree tree = new Tree(getContainer(), SWT.MULTI);
selectionViewer = new TreeViewer(tree);
setCurrentViewer(selectionViewer);
selectionViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
selectionViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
selectionViewer.setInput(editingDomain.getResourceSet().getResources().get(0));
selectionViewer.expandToLevel(2);
selectionViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
new AdapterFactoryTreeEditor(selectionViewer.getTree(), adapterFactory);
createContextMenuFor(selectionViewer);
int pageIndex = addPage(tree);
setPageText(pageIndex, getString("_UI_SelectionPage_label"));
getSite().getShell().getDisplay().asyncExec
(new Runnable() {
public void run() {
setActivePage(0);
}
});
}
// Ensures that this editor will only display the page's tab
// area if there are more than one page
//
getContainer().addControlListener
(new ControlAdapter() {
boolean guard = false;
@Override
public void controlResized(ControlEvent event) {
if (!guard) {
guard = true;
hideTabs();
guard = false;
}
}
});
getSite().getShell().getDisplay().asyncExec
(new Runnable() {
public void run() {
updateProblemIndication();
}
});
}
示例8: createPages
import org.eclipse.emf.edit.ui.celleditor.AdapterFactoryTreeEditor; //導入依賴的package包/類
/**
* This is the method used by the framework to install your own controls.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void createPages() {
// Creates the model from the editor input
//
createModel();
// Only creates the other pages if there is something that can be edited
//
if (!getEditingDomain().getResourceSet().getResources().isEmpty()) {
// Create a page for the selection tree view.
//
Tree tree = new Tree(getContainer(), SWT.MULTI);
selectionViewer = new TreeViewer(tree);
setCurrentViewer(selectionViewer);
selectionViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
selectionViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
selectionViewer.setInput(editingDomain.getResourceSet());
selectionViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
new AdapterFactoryTreeEditor(selectionViewer.getTree(), adapterFactory);
createContextMenuFor(selectionViewer);
int pageIndex = addPage(tree);
setPageText(pageIndex, getString("_UI_SelectionPage_label"));
getSite().getShell().getDisplay().asyncExec
(new Runnable() {
public void run() {
setActivePage(0);
}
});
}
// Ensures that this editor will only display the page's tab
// area if there are more than one page
//
getContainer().addControlListener
(new ControlAdapter() {
boolean guard = false;
@Override
public void controlResized(ControlEvent event) {
if (!guard) {
guard = true;
hideTabs();
guard = false;
}
}
});
getSite().getShell().getDisplay().asyncExec
(new Runnable() {
public void run() {
updateProblemIndication();
}
});
}
示例9: createDatatypeTreeView
import org.eclipse.emf.edit.ui.celleditor.AdapterFactoryTreeEditor; //導入依賴的package包/類
private TreeViewer createDatatypeTreeView(Composite parent, Object input){
TreeViewer treeViewer;
Tree tree = new Tree(parent, SWT.BORDER);
tree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
treeViewer = new TreeViewer(tree);
treeViewer.setContentProvider(new AdapterFactoryContentProvider(mainEditor.getAdapterFactory()));
treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(mainEditor.getAdapterFactory()));
treeViewer.setInput(input);
treeViewer.expandAll();
createContextMenuFor(treeViewer);
new AdapterFactoryTreeEditor(tree, mainEditor.getAdapterFactory());
return treeViewer;
}