Package org.eclipse.gef.ui.palette

Examples of org.eclipse.gef.ui.palette.PaletteViewer


            if (currentEditor instanceof MapEditorWithPalette) {
                MapEditorWithPalette editor2 = (MapEditorWithPalette) currentEditor;

                MapEditDomain editDomain = editor2.getEditDomain();

                PaletteViewer paletteViewer = editDomain.getPaletteViewer();
                if( paletteViewer != null ){
                    for( MapToolEntry entry : this.mapToolEntries ) {
   
                        if (paletteViewer.getEditPartRegistry().get(entry) != null) {
                            paletteViewer.setActiveTool(entry);
   
                            EditPart part = (EditPart) paletteViewer.getEditPartRegistry().get(entry);
   
                            paletteViewer.reveal(part);
                            break;
                        }
                    }
                }
            }
View Full Code Here


  public MapEditDomain(IEditorPart editorPart) {
    super(editorPart);
  }
  @Override
  public void setPaletteViewer(PaletteViewer palette) {
    PaletteViewer current = getPaletteViewer();
    if (current != null) {
      current.removePaletteListener(paletteListener);
    }
    super.setPaletteViewer(palette);
    if (palette != null) {
      palette.addPaletteListener(paletteListener);
    }
View Full Code Here

   * <p>
   * Used to allow MapTools top easily update the palette.
   * @param id
   */
    public void setActiveTool( String id ) {
        PaletteViewer paletteViewer = getPaletteViewer();
        if( id != null && id.equals( paletteViewer.getActiveTool().getId() ) ){
            return; // no change
        }
        ToolEntry entry = findToolEntry( paletteViewer.getPaletteRoot(), id );
        if( entry != null ){
            paletteViewer.setActiveTool( entry );
        }
    }
View Full Code Here

 
  /**
   * create controls and apply configurations.
   */
  public void createPartControl(Composite parent) {
    viewer = new PaletteViewer();
    viewer.createControl(parent);
   
    PaletteRoot root = new PaletteRoot();
   
    String[] category = getCategories();
View Full Code Here

   * (non-Javadoc)
   *
   * @see org.eclipse.gef.ui.palette.PaletteViewerProvider#createPaletteViewer(org.eclipse.swt.widgets.Composite)
   */
  public PaletteViewer createPaletteViewer(Composite parent) {
    PaletteViewer pViewer = new DesignerPaletteViewer();
    pViewer.createControl(parent);
    configurePaletteViewer(pViewer);
    pViewer.setCustomizer(new DesignerPaletteCustomizer());
    hookPaletteViewer(pViewer);

    PlatformUI
        .getWorkbench()
        .getHelpSystem()
View Full Code Here

  }

  public PaletteViewer createPaletteViewer(final Composite parent) {
    if (_paletteViewer == null) {
      // create graphical viewer
      _paletteViewer = new PaletteViewer();
      _paletteViewer.createControl(parent);
      // hook the viewer into the EditDomain (only one palette per EditDomain)
      _editDomain.setPaletteViewer(_paletteViewer);
      // important: the palette is initialized via EditDomain
      _editDomain.setPaletteRoot(getPaletteRoot());
View Full Code Here

    final NamedUuidEntity data = (NamedUuidEntity) getEditorInput().getAdapter(
      NamedUuidEntity.class);
    final Profile profile = data instanceof ScannedMap ? EditPlugin.getBL().getProfile(
      (ScannedMap) data) : EditPlugin.getBL().getDefaultProfile();
    _palette = new MapPalette(getEditDomain(), profile);
    final PaletteViewer paletteViewer = _palette.createPaletteViewer(split);
    final GridData gd = new GridData(GridData.FILL_VERTICAL);
    gd.widthHint = 175;
    paletteViewer.getControl().setLayoutData(gd);
    setPartName(data.getName());
  }
View Full Code Here

      }
     
      @Override
      public PaletteViewer createPaletteViewer(Composite parent)
      {
        PaletteViewer pViewer = new SapphirePaletteViewer();
        pViewer.createControl(parent);
        configurePaletteViewer(pViewer);
        hookPaletteViewer(pViewer);
        return pViewer;
      }
     
View Full Code Here

TOP

Related Classes of org.eclipse.gef.ui.palette.PaletteViewer

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.