Package org.eclipse.emf.edit.ui.provider

Examples of org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider


  /**
   * @generated
   */
  public OntoUMLSheetLabelProvider() {
    super(new AdapterFactoryLabelProvider(
        OntoUML.diagram.part.OntoUMLDiagramEditorPlugin.getInstance()
            .getItemProvidersAdapterFactory()), null);
  }
View Full Code Here


  /**
   * @generated
   */
  protected EObject selectElement(EObject[] elements) {
    Shell shell = Display.getCurrent().getActiveShell();
    ILabelProvider labelProvider = new AdapterFactoryLabelProvider(
        OntoUML.diagram.part.OntoUMLDiagramEditorPlugin.getInstance()
            .getItemProvidersAdapterFactory());
    ElementListSelectionDialog dialog = new ElementListSelectionDialog(
        shell, labelProvider);
    dialog
View Full Code Here

        viewerPane.createControl(getContainer());

        selectionViewer = (TreeViewer)viewerPane.getViewer();
        selectionViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));

        selectionViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
        selectionViewer.setInput(editingDomain.getResourceSet());
        selectionViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
        viewerPane.setTitle(editingDomain.getResourceSet());

        new AdapterFactoryTreeEditor(selectionViewer.getTree(), adapterFactory);

        createContextMenuFor(selectionViewer);
        int pageIndex = addPage(viewerPane.getControl());
        setPageText(pageIndex, getString("_UI_SelectionPage_label"));
      }

      // Create a page for the parent tree view.
      //
      {
        ViewerPane viewerPane =
          new ViewerPane(getSite().getPage(), URMLEditor.this) {
            @Override
            public Viewer createViewer(Composite composite) {
              Tree tree = new Tree(composite, SWT.MULTI);
              TreeViewer newTreeViewer = new TreeViewer(tree);
              return newTreeViewer;
            }
            @Override
            public void requestActivation() {
              super.requestActivation();
              setCurrentViewerPane(this);
            }
          };
        viewerPane.createControl(getContainer());

        parentViewer = (TreeViewer)viewerPane.getViewer();
        parentViewer.setAutoExpandLevel(30);
        parentViewer.setContentProvider(new ReverseAdapterFactoryContentProvider(adapterFactory));
        parentViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));

        createContextMenuFor(parentViewer);
        int pageIndex = addPage(viewerPane.getControl());
        setPageText(pageIndex, getString("_UI_ParentPage_label"));
      }

      // This is the page for the list viewer
      //
      {
        ViewerPane viewerPane =
          new ViewerPane(getSite().getPage(), URMLEditor.this) {
            @Override
            public Viewer createViewer(Composite composite) {
              return new ListViewer(composite);
            }
            @Override
            public void requestActivation() {
              super.requestActivation();
              setCurrentViewerPane(this);
            }
          };
        viewerPane.createControl(getContainer());
        listViewer = (ListViewer)viewerPane.getViewer();
        listViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
        listViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));

        createContextMenuFor(listViewer);
        int pageIndex = addPage(viewerPane.getControl());
        setPageText(pageIndex, getString("_UI_ListPage_label"));
      }

      // This is the page for the tree viewer
      //
      {
        ViewerPane viewerPane =
          new ViewerPane(getSite().getPage(), URMLEditor.this) {
            @Override
            public Viewer createViewer(Composite composite) {
              return new TreeViewer(composite);
            }
            @Override
            public void requestActivation() {
              super.requestActivation();
              setCurrentViewerPane(this);
            }
          };
        viewerPane.createControl(getContainer());
        treeViewer = (TreeViewer)viewerPane.getViewer();
        treeViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
        treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));

        new AdapterFactoryTreeEditor(treeViewer.getTree(), adapterFactory);

        createContextMenuFor(treeViewer);
        int pageIndex = addPage(viewerPane.getControl());
        setPageText(pageIndex, getString("_UI_TreePage_label"));
      }

      // This is the page for the table viewer.
      //
      {
        ViewerPane viewerPane =
          new ViewerPane(getSite().getPage(), URMLEditor.this) {
            @Override
            public Viewer createViewer(Composite composite) {
              return new TableViewer(composite);
            }
            @Override
            public void requestActivation() {
              super.requestActivation();
              setCurrentViewerPane(this);
            }
          };
        viewerPane.createControl(getContainer());
        tableViewer = (TableViewer)viewerPane.getViewer();

        Table table = tableViewer.getTable();
        TableLayout layout = new TableLayout();
        table.setLayout(layout);
        table.setHeaderVisible(true);
        table.setLinesVisible(true);

        TableColumn objectColumn = new TableColumn(table, SWT.NONE);
        layout.addColumnData(new ColumnWeightData(3, 100, true));
        objectColumn.setText(getString("_UI_ObjectColumn_label"));
        objectColumn.setResizable(true);

        TableColumn selfColumn = new TableColumn(table, SWT.NONE);
        layout.addColumnData(new ColumnWeightData(2, 100, true));
        selfColumn.setText(getString("_UI_SelfColumn_label"));
        selfColumn.setResizable(true);

        tableViewer.setColumnProperties(new String [] {"a", "b"});
        tableViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
        tableViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));

        createContextMenuFor(tableViewer);
        int pageIndex = addPage(viewerPane.getControl());
        setPageText(pageIndex, getString("_UI_TablePage_label"));
      }

      // This is the page for the table tree viewer.
      //
      {
        ViewerPane viewerPane =
          new ViewerPane(getSite().getPage(), URMLEditor.this) {
            @Override
            public Viewer createViewer(Composite composite) {
              return new TreeViewer(composite);
            }
            @Override
            public void requestActivation() {
              super.requestActivation();
              setCurrentViewerPane(this);
            }
          };
        viewerPane.createControl(getContainer());

        treeViewerWithColumns = (TreeViewer)viewerPane.getViewer();

        Tree tree = treeViewerWithColumns.getTree();
        tree.setLayoutData(new FillLayout());
        tree.setHeaderVisible(true);
        tree.setLinesVisible(true);

        TreeColumn objectColumn = new TreeColumn(tree, SWT.NONE);
        objectColumn.setText(getString("_UI_ObjectColumn_label"));
        objectColumn.setResizable(true);
        objectColumn.setWidth(250);

        TreeColumn selfColumn = new TreeColumn(tree, SWT.NONE);
        selfColumn.setText(getString("_UI_SelfColumn_label"));
        selfColumn.setResizable(true);
        selfColumn.setWidth(200);

        treeViewerWithColumns.setColumnProperties(new String [] {"a", "b"});
        treeViewerWithColumns.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
        treeViewerWithColumns.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));

        createContextMenuFor(treeViewerWithColumns);
        int pageIndex = addPage(viewerPane.getControl());
        setPageText(pageIndex, getString("_UI_TreeWithColumnsPage_label"));
      }
View Full Code Here

          contentOutlineViewer.addSelectionChangedListener(this);

          // Set up the tree viewer.
          //
          contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
          contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
          contentOutlineViewer.setInput(editingDomain.getResourceSet());

          // Make sure our popups work.
          //
          createContextMenuFor(contentOutlineViewer);
View Full Code Here

          contentOutlineViewer.addSelectionChangedListener(this);

          // Set up the tree viewer.
          //
          contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
          contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
          contentOutlineViewer.setInput(editingDomain.getResourceSet());

          // Make sure our popups work.
          //
          createContextMenuFor(contentOutlineViewer);
View Full Code Here

        viewerPane.createControl(getContainer());

        selectionViewer = (TreeViewer)viewerPane.getViewer();
        selectionViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));

        selectionViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
        selectionViewer.setInput(editingDomain.getResourceSet());
        selectionViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
        viewerPane.setTitle(editingDomain.getResourceSet());

        new AdapterFactoryTreeEditor(selectionViewer.getTree(), adapterFactory);

        createContextMenuFor(selectionViewer);
        int pageIndex = addPage(viewerPane.getControl());
        setPageText(pageIndex, getString("_UI_SelectionPage_label"));
      }

      // Create a page for the parent tree view.
      //
      {
        ViewerPane viewerPane =
          new ViewerPane(getSite().getPage(), OntoUMLEditor.this) {
            @Override
            public Viewer createViewer(Composite composite) {
              Tree tree = new Tree(composite, SWT.MULTI);
              TreeViewer newTreeViewer = new TreeViewer(tree);
              return newTreeViewer;
            }
            @Override
            public void requestActivation() {
              super.requestActivation();
              setCurrentViewerPane(this);
            }
          };
        viewerPane.createControl(getContainer());

        parentViewer = (TreeViewer)viewerPane.getViewer();
        parentViewer.setAutoExpandLevel(30);
        parentViewer.setContentProvider(new ReverseAdapterFactoryContentProvider(adapterFactory));
        parentViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));

        createContextMenuFor(parentViewer);
        int pageIndex = addPage(viewerPane.getControl());
        setPageText(pageIndex, getString("_UI_ParentPage_label"));
      }

      // This is the page for the list viewer
      //
      {
        ViewerPane viewerPane =
          new ViewerPane(getSite().getPage(), OntoUMLEditor.this) {
            @Override
            public Viewer createViewer(Composite composite) {
              return new ListViewer(composite);
            }
            @Override
            public void requestActivation() {
              super.requestActivation();
              setCurrentViewerPane(this);
            }
          };
        viewerPane.createControl(getContainer());
        listViewer = (ListViewer)viewerPane.getViewer();
        listViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
        listViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));

        createContextMenuFor(listViewer);
        int pageIndex = addPage(viewerPane.getControl());
        setPageText(pageIndex, getString("_UI_ListPage_label"));
      }

      // This is the page for the tree viewer
      //
      {
        ViewerPane viewerPane =
          new ViewerPane(getSite().getPage(), OntoUMLEditor.this) {
            @Override
            public Viewer createViewer(Composite composite) {
              return new TreeViewer(composite);
            }
            @Override
            public void requestActivation() {
              super.requestActivation();
              setCurrentViewerPane(this);
            }
          };
        viewerPane.createControl(getContainer());
        treeViewer = (TreeViewer)viewerPane.getViewer();
        treeViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
        treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));

        new AdapterFactoryTreeEditor(treeViewer.getTree(), adapterFactory);

        createContextMenuFor(treeViewer);
        int pageIndex = addPage(viewerPane.getControl());
        setPageText(pageIndex, getString("_UI_TreePage_label"));
      }

      // This is the page for the table viewer.
      //
      {
        ViewerPane viewerPane =
          new ViewerPane(getSite().getPage(), OntoUMLEditor.this) {
            @Override
            public Viewer createViewer(Composite composite) {
              return new TableViewer(composite);
            }
            @Override
            public void requestActivation() {
              super.requestActivation();
              setCurrentViewerPane(this);
            }
          };
        viewerPane.createControl(getContainer());
        tableViewer = (TableViewer)viewerPane.getViewer();

        Table table = tableViewer.getTable();
        TableLayout layout = new TableLayout();
        table.setLayout(layout);
        table.setHeaderVisible(true);
        table.setLinesVisible(true);

        TableColumn objectColumn = new TableColumn(table, SWT.NONE);
        layout.addColumnData(new ColumnWeightData(3, 100, true));
        objectColumn.setText(getString("_UI_ObjectColumn_label"));
        objectColumn.setResizable(true);

        TableColumn selfColumn = new TableColumn(table, SWT.NONE);
        layout.addColumnData(new ColumnWeightData(2, 100, true));
        selfColumn.setText(getString("_UI_SelfColumn_label"));
        selfColumn.setResizable(true);

        tableViewer.setColumnProperties(new String [] {"a", "b"});
        tableViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
        tableViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));

        createContextMenuFor(tableViewer);
        int pageIndex = addPage(viewerPane.getControl());
        setPageText(pageIndex, getString("_UI_TablePage_label"));
      }

      // This is the page for the table tree viewer.
      //
      {
        ViewerPane viewerPane =
          new ViewerPane(getSite().getPage(), OntoUMLEditor.this) {
            @Override
            public Viewer createViewer(Composite composite) {
              return new TreeViewer(composite);
            }
            @Override
            public void requestActivation() {
              super.requestActivation();
              setCurrentViewerPane(this);
            }
          };
        viewerPane.createControl(getContainer());

        treeViewerWithColumns = (TreeViewer)viewerPane.getViewer();

        Tree tree = treeViewerWithColumns.getTree();
        tree.setLayoutData(new FillLayout());
        tree.setHeaderVisible(true);
        tree.setLinesVisible(true);

        TreeColumn objectColumn = new TreeColumn(tree, SWT.NONE);
        objectColumn.setText(getString("_UI_ObjectColumn_label"));
        objectColumn.setResizable(true);
        objectColumn.setWidth(250);

        TreeColumn selfColumn = new TreeColumn(tree, SWT.NONE);
        selfColumn.setText(getString("_UI_SelfColumn_label"));
        selfColumn.setResizable(true);
        selfColumn.setWidth(200);

        treeViewerWithColumns.setColumnProperties(new String [] {"a", "b"});
        treeViewerWithColumns.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
        treeViewerWithColumns.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));

        createContextMenuFor(treeViewerWithColumns);
        int pageIndex = addPage(viewerPane.getControl());
        setPageText(pageIndex, getString("_UI_TreeWithColumnsPage_label"));
      }
View Full Code Here

          contentOutlineViewer.addSelectionChangedListener(this);

          // Set up the tree viewer.
          //
          contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
          contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
          contentOutlineViewer.setInput(editingDomain.getResourceSet());

          // Make sure our popups work.
          //
          createContextMenuFor(contentOutlineViewer);
View Full Code Here

          contentOutlineViewer.addSelectionChangedListener(this);

          // Set up the tree viewer.
          //
          contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
          contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
          contentOutlineViewer.setInput(editingDomain.getResourceSet());

          // Make sure our popups work.
          //
          createContextMenuFor(contentOutlineViewer);
View Full Code Here

    layoutData.widthHint = 300;
    modelViewer.getTree().setLayoutData(layoutData);
    modelViewer.setContentProvider(new AdapterFactoryContentProvider(
        OntoUML.diagram.part.OntoUMLDiagramEditorPlugin.getInstance()
            .getItemProvidersAdapterFactory()));
    modelViewer.setLabelProvider(new AdapterFactoryLabelProvider(
        OntoUML.diagram.part.OntoUMLDiagramEditorPlugin.getInstance()
            .getItemProvidersAdapterFactory()));
    if (selectedModelElement != null) {
      modelViewer.setInput(selectedModelElement.eResource());
      modelViewer.setSelection(new StructuredSelection(
View Full Code Here

    @Test
    public void testGetImageObject() {

        AdapterFactory adapterFactoryImpl = new ProjectItemProviderAdapterFactory();
        LayerItemProvider itemProvider = new LayerItemProvider(adapterFactoryImpl);
        AdapterFactoryLabelProvider fac=new AdapterFactoryLabelProvider(adapterFactoryImpl);
       
        Image image = null;
        Image image2 = null;
        try {
            layer.eAdapters().add(itemProvider);
            image = (Image) fac.getImage(layer);
            assertNotNull(image);
            image2 = (Image) fac.getImage(layer);
            assertSame(image, image2);

            layer.getProperties().put(LayerItemProvider.GENERATED_ICON,
                    Glyph.geometry(Color.RED, Color.BLACK));

            image2 = (Image) fac.getImage(layer);
            assertNotSame(image, image2);
           
            layer.getProperties().put(LayerItemProvider.GENERATED_ICON,
                    Glyph.geometry(Color.GREEN, Color.BLACK));

            image = (Image) fac.getImage(layer);
            assertNotSame(image, image2);
           
            layer.setIcon(Glyph.geometry(Color.GREEN, Color.RED));
            image2 = (Image) fac.getImage(layer);
            assertNotSame(image, image2);
           
            layer.getProperties().put(LayerItemProvider.GENERATED_ICON,
                    Glyph.geometry(Color.GREEN, Color.BLUE));
            image = (Image) fac.getImage(layer);
            assertSame(image, image2);
           
        } finally {
            fac.dispose();
            itemProvider.dispose();
        }
    }
View Full Code Here

TOP

Related Classes of org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.