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


Java AdapterFactoryTreeEditor類代碼示例

本文整理匯總了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 );
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:26,代碼來源:ChartConfiguratorView.java

示例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();		
}
 
開發者ID:markus1978,項目名稱:clickwatch,代碼行數:19,代碼來源:ResultView.java

示例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;
}
 
開發者ID:CloudScale-Project,項目名稱:Environment,代碼行數:16,代碼來源:InterfacesEditor.java

示例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);
}
 
開發者ID:markus1978,項目名稱:clickwatch,代碼行數:10,代碼來源:ModelView.java

示例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();
		}
	});
}
 
開發者ID:logicalhacking,項目名稱:SecureBPMN,代碼行數:67,代碼來源:Securebpmn2Editor.java

示例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));
}
 
開發者ID:mondo-project,項目名稱:mondo-hawk,代碼行數:44,代碼來源:HawkResourceExeedCustomizer.java

示例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();
			 }
		 });
}
 
開發者ID:nasa,項目名稱:OpenSPIFe,代碼行數:65,代碼來源:DictionaryEditor.java

示例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();
			 }
		 });
}
 
開發者ID:SOM-Research,項目名稱:collaboro,代碼行數:64,代碼來源:HistoryEditor.java

示例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;
}
 
開發者ID:CloudScale-Project,項目名稱:Environment,代碼行數:20,代碼來源:InterfacesEditor.java


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