Пример #1
0
  private void createFeaturesToolbar(FormToolkit toolkit, Section section) {
    Composite headerComposite = toolkit.createComposite(section, SWT.NONE);
    RowLayout rowLayout = new RowLayout();
    rowLayout.marginTop = 0;
    rowLayout.marginBottom = 0;
    headerComposite.setLayout(rowLayout);
    headerComposite.setBackground(null);

    toolBarManager = new ToolBarManager(SWT.FLAT | SWT.HORIZONTAL);
    toolBarManager.createControl(headerComposite);

    installAction = new InstallAction();
    installAction.setEnabled(false);
    toolBarManager.add(installAction);

    toolBarManager.add(new CheckForUpdatesAction());

    CommandContributionItem item =
        JBossCentralActivator.createContributionItem(
            getSite(), "org.jboss.tools.central.refreshDiscovery");
    toolBarManager.add(item);

    toolBarManager.update(true);

    section.setTextClient(headerComposite);
  }
  private ToolBar createToolbar(final MUIElement element, Composite parent) {
    int orientation = getOrientation(element);

    ToolBarManager manager = getManager((MToolBar) element);
    if (manager == null) {
      manager = new ToolBarManager(orientation | SWT.WRAP | SWT.FLAT | SWT.RIGHT);
      IContributionManagerOverrides overrides = null;
      MApplicationElement parentElement = element.getParent();
      if (parentElement == null) {
        parentElement = (MApplicationElement) ((EObject) element).eContainer();
      }

      if (parentElement != null) {
        overrides =
            (IContributionManagerOverrides)
                parentElement.getTransientData().get(IContributionManagerOverrides.class.getName());
      }

      manager.setOverrides(overrides);
      linkModelToManager((MToolBar) element, manager);
    }
    ToolBar bar = manager.createControl(parent);
    bar.setData(manager);
    bar.setData(AbstractPartRenderer.OWNING_ME, element);
    bar.getShell().layout(new Control[] {bar}, SWT.DEFER);
    bar.addDisposeListener(
        new DisposeListener() {
          public void widgetDisposed(DisposeEvent e) {
            cleanUp((MToolBar) element);
          }
        });
    return bar;
  }
Пример #3
0
  private Control createToolBar(Composite parent) {
    toolBar = new ToolBarManager();

    picker = new ColorPicker(configurer.getPopupStyle(), configurer.getPalette());
    configureColorPicker(picker);

    toolBar.add(picker);
    toolBar.createControl(parent);
    return toolBar.getControl();
  }
  private void createMemoryBlocksTreeViewPane(Composite parent) {

    fMemBlkViewer = new MemoryBlocksTreeViewPane(this);
    fViewPanes.put(MemoryBlocksTreeViewPane.PANE_ID, fMemBlkViewer);
    ViewForm viewerViewForm = new ViewForm(parent, SWT.NONE);
    PlatformUI.getWorkbench()
        .getHelpSystem()
        .setHelp(
            viewerViewForm, IDebugUIConstants.PLUGIN_ID + ".MemoryView_context"); // $NON-NLS-1$
    fViewPaneControls.put(MemoryBlocksTreeViewPane.PANE_ID, viewerViewForm);
    fWeights.add(Integer.valueOf(15));

    fMemBlkViewer.addSelectionListener(fSelectionProvider);

    Control viewerControl =
        fMemBlkViewer.createViewPane(
            viewerViewForm,
            MemoryBlocksTreeViewPane.PANE_ID,
            DebugUIMessages.MemoryView_Memory_monitors);
    viewerViewForm.setContent(viewerControl);

    ISelection selection = fMemBlkViewer.getSelectionProvider().getSelection();
    if (selection != null) fSelectionProvider.setSelection(selection);

    ToolBarManager viewerToolBarMgr = new ToolBarManager(SWT.FLAT);
    IAction[] actions = fMemBlkViewer.getActions();
    for (int i = 0; i < actions.length; i++) {
      viewerToolBarMgr.add(actions[i]);
    }
    ToolBar viewerToolbar = viewerToolBarMgr.createControl(viewerViewForm);
    viewerViewForm.setTopRight(viewerToolbar);

    Label viewerLabel = new Label(viewerViewForm, SWT.WRAP);
    viewerLabel.setText(DebugUIMessages.MemoryView_Memory_monitors);
    viewerViewForm.setTopLeft(viewerLabel);

    fMemBlkViewer
        .getControl()
        .addFocusListener(
            new FocusAdapter() {
              @Override
              public void focusGained(FocusEvent e) {
                fActivePaneId = fMemBlkViewer.getId();
              }
            });
  }
Пример #5
0
  /** Creates the navigation buttons for this viewer. */
  protected void createNavigationButtons() {
    GridData gid;
    GridLayout layout;

    // Define layout.
    layout = new GridLayout();
    layout.marginHeight =
        layout.marginWidth = layout.horizontalSpacing = layout.verticalSpacing = 0;
    setLayout(layout);

    // Create a toolbar.
    toolBarMgr = new ToolBarManager(SWT.FLAT);
    ToolBar toolBar = toolBarMgr.createControl(this);
    gid = new GridData();
    gid.horizontalAlignment = GridData.FILL;
    gid.verticalAlignment = GridData.BEGINNING;
    toolBar.setLayoutData(gid);
  }
  private void createSectionToolbar(Section section, FormToolkit toolkit) {
    ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
    ToolBar toolbar = toolBarManager.createControl(section);
    final Cursor handCursor = new Cursor(Display.getCurrent(), SWT.CURSOR_HAND);
    toolbar.setCursor(handCursor);
    // Cursor needs to be explicitly disposed
    toolbar.addDisposeListener(
        new DisposeListener() {
          public void widgetDisposed(DisposeEvent e) {
            if (handCursor.isDisposed() == false) {
              handCursor.dispose();
            }
          }
        });
    fNewPluginAction = new NewPluginAction();
    fNewFragmentAction = new NewFragmentAction();
    toolBarManager.add(fNewPluginAction);
    toolBarManager.add(fNewFragmentAction);

    toolBarManager.update(true);
    section.setTextClient(toolbar);
  }
Пример #7
0
  protected void createSectionToolbar(Section section, FormToolkit toolkit) {
    ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
    ToolBar toolbar = toolBarManager.createControl(section);
    final Cursor handCursor = new Cursor(Display.getCurrent(), SWT.CURSOR_HAND);
    toolbar.setCursor(handCursor);
    // Cursor needs to be explicitly disposed
    toolbar.addDisposeListener(
        new DisposeListener() {
          @Override
          public void widgetDisposed(DisposeEvent e) {
            if ((handCursor != null) && (handCursor.isDisposed() == false)) {
              handCursor.dispose();
            }
          }
        });

    // save
    ActionContributionItem saveMenuAction =
        new ActionContributionItem(ActionFactory.SAVE.create(getEditorSite().getWorkbenchWindow()));
    toolBarManager.add(saveMenuAction);
    toolBarManager.update(true);

    section.setTextClient(toolbar);
  }
  private void createDialogUI(Composite parent) {
    GridLayoutFactory.fillDefaults().margins(12, 6).applyTo(parent);

    SashForm sashForm = new SashForm(parent, SWT.HORIZONTAL);
    GridDataFactory.fillDefaults()
        .grab(true, true)
        .align(SWT.FILL, SWT.FILL)
        .hint(725, 360)
        .applyTo(sashForm);

    Composite leftComposite = new Composite(sashForm, SWT.NONE);
    GridLayoutFactory.fillDefaults().applyTo(leftComposite);
    GridDataFactory.swtDefaults()
        .grab(false, true)
        .align(SWT.FILL, SWT.FILL)
        .applyTo(leftComposite);

    ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
    ToolBar toolBar = toolBarManager.createControl(leftComposite);
    toolBar.setBackground(parent.getBackground());
    GridDataFactory.swtDefaults().grab(true, false).align(SWT.BEGINNING, SWT.FILL).applyTo(toolBar);

    launchesViewer = new TableViewer(leftComposite, SWT.MULTI | SWT.V_SCROLL | SWT.BORDER);
    launchesViewer.setLabelProvider(
        new DelegatingStyledCellLabelProvider(new LaunchConfigLabelProvider()));
    launchesViewer.setComparator(new ViewerComparator(String.CASE_INSENSITIVE_ORDER));
    launchesViewer.setContentProvider(new LaunchConfigContentProvider());
    launchesViewer.setInput(ResourcesPlugin.getWorkspace().getRoot());
    launchesViewer.getTable().setFocus();
    launchesViewer.addSelectionChangedListener(
        new ISelectionChangedListener() {
          @Override
          public void selectionChanged(SelectionChangedEvent event) {
            handleSelectedConfigChanged();
          }
        });

    GridDataFactory.swtDefaults()
        .grab(false, true)
        .align(SWT.FILL, SWT.FILL)
        .hint(50, 50)
        .applyTo(launchesViewer.getControl());

    ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();

    for (final ILaunchConfigurationType configType : manager.getLaunchConfigurationTypes()) {
      CreateLaunchAction action = new CreateLaunchAction(this, configType);

      toolBarManager.add(action);
    }

    // toolBarManager.add(new Separator());
    toolBarManager.add(getDeleteAction());

    toolBarManager.update(true);

    configUI = new Composite(sashForm, SWT.NONE);
    GridLayoutFactory.fillDefaults().applyTo(configUI);
    GridDataFactory.swtDefaults()
        .grab(true, false)
        .align(SWT.FILL, SWT.BEGINNING)
        .applyTo(configUI);

    toolBar.pack();
    Label toolbarSpacer = new Label(configUI, SWT.NONE);
    GridDataFactory.swtDefaults().hint(SWT.NONE, toolBar.getSize().y).applyTo(toolbarSpacer);

    Composite nameComposite = new Composite(configUI, SWT.NONE);
    GridDataFactory.swtDefaults()
        .grab(true, false)
        .align(SWT.FILL, SWT.FILL)
        .applyTo(nameComposite);
    GridLayoutFactory.swtDefaults().margins(6, 0).applyTo(nameComposite);

    configNameText = new Text(nameComposite, SWT.SINGLE | SWT.BORDER);
    GridDataFactory.swtDefaults()
        .grab(true, false)
        .align(SWT.FILL, SWT.CENTER)
        .applyTo(configNameText);
    configNameText.addModifyListener(
        new ModifyListener() {
          @Override
          public void modifyText(ModifyEvent e) {
            if (workingCopy != null) {
              workingCopy.rename(configNameText.getText());
            }
          }
        });

    launchConfigArea = new ScrolledComposite(configUI, SWT.V_SCROLL);
    GridDataFactory.swtDefaults()
        .grab(true, true)
        .align(SWT.FILL, SWT.FILL)
        .applyTo(launchConfigArea);
    launchConfigArea.setExpandVertical(false);
    launchConfigArea.setExpandHorizontal(true);

    configNameText.setVisible(false);

    sashForm.setWeights(new int[] {33, 67});

    selectLaunchConfigFromPage();
  }
  /**
   * Get the toolbar for the container
   *
   * @return Control
   */
  Control getContainerToolBar(Composite composite) {

    final ToolBarManager historyManager = new ToolBarManager(SWT.HORIZONTAL | SWT.FLAT);
    historyManager.createControl(composite);

    history.createHistoryControls(historyManager.getControl(), historyManager);

    Action popupMenuAction =
        new Action() {
          @Override
          public ImageDescriptor getImageDescriptor() {
            return WorkbenchImages.getImageDescriptor(IWorkbenchGraphicConstants.IMG_LCL_VIEW_MENU);
          }

          @Override
          public void run() {
            MenuManager manager = new MenuManager();
            manager.add(
                new Action() {
                  @Override
                  public void run() {

                    sash.addFocusListener(
                        new FocusAdapter() {
                          @Override
                          public void focusGained(FocusEvent e) {
                            sash.setBackground(
                                sash.getDisplay().getSystemColor(SWT.COLOR_LIST_SELECTION));
                          }

                          @Override
                          public void focusLost(FocusEvent e) {
                            sash.setBackground(
                                sash.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
                          }
                        });
                    sash.setFocus();
                  }

                  @Override
                  public String getText() {
                    return WorkbenchMessages.FilteredPreferenceDialog_Resize;
                  }
                });
            manager.add(
                new Action() {
                  @Override
                  public void run() {
                    activeKeyScrolling();
                  }

                  @Override
                  public String getText() {
                    return WorkbenchMessages.FilteredPreferenceDialog_Key_Scrolling;
                  }
                });
            Menu menu = manager.createContextMenu(getShell());
            Rectangle bounds = historyManager.getControl().getBounds();
            Point topLeft = new Point(bounds.x + bounds.width, bounds.y + bounds.height);
            topLeft = historyManager.getControl().toDisplay(topLeft);
            menu.setLocation(topLeft.x, topLeft.y);
            menu.setVisible(true);
          }
        };
    popupMenuAction.setToolTipText(WorkbenchMessages.FilteredPreferenceDialog_FilterToolTip);
    historyManager.add(popupMenuAction);
    IHandlerService service = PlatformUI.getWorkbench().getService(IHandlerService.class);
    showViewHandler =
        service.activateHandler(
            IWorkbenchCommandConstants.WINDOW_SHOW_VIEW_MENU,
            new ActionHandler(popupMenuAction),
            new ActiveShellExpression(getShell()));

    historyManager.update(false);

    return historyManager.getControl();
  }
Пример #10
0
  /**
   * Add a new (SQL) Execution Tab
   *
   * @param AbstractSQLExecution
   */
  public void addSQLExecution(AbstractSQLExecution sqlExecution) {

    if (_tabFolder == null || _tabFolder.isDisposed()) {

      clearParent();

      // create tab folder for different sessions
      _tabFolder = new TabFolder(_parent, SWT.NULL);

      _parent.layout();
      _parent.redraw();
    }

    // create tab
    _lastTabNumber = _lastTabNumber + 1;
    final TabItem tabItem = new TabItem(_tabFolder, SWT.NULL);

    // set tab text & tooltip
    String labelText = "" + _lastTabNumber;
    tabItem.setText(labelText);
    tabItem.setData("tabLabel", labelText);
    tabItem.setToolTipText(TextUtil.getWrappedText(sqlExecution.getSqlStatement()));

    // create composite for our result
    Composite composite = new Composite(_tabFolder, SWT.NULL);

    GridLayout layout = new GridLayout();
    layout.numColumns = 1;
    layout.marginLeft = 0;
    layout.horizontalSpacing = 0;
    layout.verticalSpacing = 2;
    layout.marginWidth = 0;
    layout.marginHeight = 0;

    composite.setLayout(layout);
    composite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));

    tabItem.setControl(composite);
    tabItem.setData(sqlExecution);

    tabItem.addDisposeListener(
        new DisposeListener() {

          public void widgetDisposed(final DisposeEvent e) {

            BusyIndicator.showWhile(
                Display.getCurrent(),
                new Runnable() {

                  public void run() {

                    // stop all sql execution if still running
                    TabItem tabItem = (TabItem) e.getSource();
                    AbstractSQLExecution sqlExecution = (AbstractSQLExecution) tabItem.getData();
                    sqlExecution.stop();
                    tabItem.setData(null);

                    if (_tabFolder != null && !_tabFolder.isDisposed()) {

                      if (_tabFolder.getItemCount() == 0) {
                        // this is last tab..
                        clearParent();
                        setDefaultMessage();
                      }

                    } else if (_tabFolder.isDisposed()) {
                      clearParent();
                      setDefaultMessage();
                    }
                  }
                });
          }
        });

    // add sql statement, first create temp label to calculate correct size

    String sqlStatement = sqlExecution.getSqlStatement();

    int labelHeight = 60;
    int labelStyle = SWT.WRAP | SWT.MULTI;

    Text tmpLabel = new Text(composite, labelStyle);
    tmpLabel.setText(TextUtil.removeLineBreaks(sqlExecution.getSqlStatement()));
    tmpLabel.setLayoutData(new FillLayout());
    int parentWidth = _parent.getClientArea().width;
    Point idealSize = tmpLabel.computeSize(parentWidth - 30, SWT.DEFAULT);

    if (idealSize.y <= 60) {
      // we don't need a scroll bar. minimize
      labelHeight = idealSize.y;
    } else {
      // we need a scroll bar
      labelStyle = SWT.WRAP | SWT.MULTI | SWT.V_SCROLL;
    }

    tmpLabel.dispose();

    // now create real label
    // create spanned cell for table data

    Composite headerComposite = new Composite(composite, SWT.FILL);
    headerComposite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));

    GridLayout hLayout = new GridLayout();
    hLayout.numColumns = 2;
    hLayout.marginLeft = 0;
    hLayout.horizontalSpacing = 0;
    hLayout.verticalSpacing = 0;
    hLayout.marginWidth = 0;
    hLayout.marginHeight = 0;

    headerComposite.setLayout(hLayout);

    Text label = new Text(headerComposite, labelStyle);
    label.setEditable(false);
    label.setBackground(_parent.getBackground());
    label.setText(TextUtil.removeLineBreaks(sqlStatement));
    label.setToolTipText(TextUtil.getWrappedText(sqlStatement));

    GridData labelGridData = new GridData(SWT.FILL, SWT.TOP, true, false);
    labelGridData.heightHint = labelHeight;
    label.setLayoutData(labelGridData);

    // add action bar

    ToolBarManager toolBarMgr = new ToolBarManager(SWT.FLAT);
    toolBarMgr.createControl(headerComposite);
    toolBarMgr.add(new CloseSQLResultTab(tabItem));
    toolBarMgr.update(true);
    GridData gid = new GridData();
    gid.horizontalAlignment = SWT.RIGHT;
    gid.verticalAlignment = SWT.TOP;
    toolBarMgr.getControl().setLayoutData(gid);

    // add detail composite to show progress bar and results
    Composite detailComposite = new Composite(composite, SWT.FILL);
    detailComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    sqlExecution.setComposite(detailComposite);
    sqlExecution.setParentTab(tabItem);
    sqlExecution.startExecution();

    // set new tab as the active one
    _tabFolder.setSelection(_tabFolder.getItemCount() - 1);

    // refresh view
    composite.layout();
    _tabFolder.layout();
    _tabFolder.redraw();

    // bring this view to top of the view stack
    getSite().getPage().bringToTop(this);
  }
  @Override
  public void createPartControl(Composite parent) {

    final Composite main = new Composite(parent, SWT.NONE);
    main.setLayout(new GridLayout());
    GridUtils.removeMargins(main);

    final Composite tools = new Composite(main, SWT.RIGHT);
    tools.setLayout(new GridLayout(2, false));
    GridUtils.removeMargins(tools);
    tools.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));

    this.messageLabel = new CLabel(tools, SWT.NONE);
    final GridData gridData = new GridData(SWT.LEFT, SWT.CENTER, false, false);
    gridData.widthHint = 230;
    messageLabel.setLayoutData(gridData);
    messageLabel.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_DARK_GRAY));
    messageLabel.setToolTipText(
        "Insert variables to the template xml on the right,\nthis will be replaced and sent to EDNA when the workflow is run.");

    ToolBarManager toolMan = new ToolBarManager(SWT.FLAT | SWT.LEFT);
    final ToolBar toolBar = toolMan.createControl(tools);
    toolBar.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false));
    EdnaActorActions.createInputActions(toolMan);

    final SashForm sash = new SashForm(main, SWT.HORIZONTAL);
    sash.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    this.viewer =
        new TableViewer(
            sash, SWT.FULL_SELECTION | SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
    createColumns(viewer);
    viewer.getTable().setLinesVisible(true);
    viewer.getTable().setHeaderVisible(true);

    final Composite right = new Composite(sash, SWT.NONE);
    right.setLayout(new FillLayout());
    super.createPartControl(right);

    sash.setWeights(new int[] {20, 80});

    // Attached a painter to highlight the replacements
    final VariableCharacterMatcher matcher =
        new VariableCharacterMatcher(((SourceViewer) getSourceViewer()));
    final VariablePainter painter = new VariablePainter(getSourceViewer(), matcher);
    ((SourceViewer) getSourceViewer()).addPainter(painter);
    viewer.addSelectionChangedListener(matcher);
    viewer.addDoubleClickListener(
        new IDoubleClickListener() {
          @Override
          public void doubleClick(DoubleClickEvent event) {
            doInsert();
          }
        });
    ((SourceViewer) getSourceViewer())
        .addSelectionChangedListener(
            new ISelectionChangedListener() {
              @Override
              public void selectionChanged(SelectionChangedEvent event) {
                final ISelection sel = event.getSelection();
                if (sel instanceof TextSelection) {
                  XMLSubstitutionEditor.this.currentSelectedText = (TextSelection) sel;
                  updateMessageLabel();
                  return;
                }
                XMLSubstitutionEditor.this.currentSelectedText = null;
                updateMessageLabel();
              }
            });

    toolMan.update(true);
    setWritable(true);
    getSite().setSelectionProvider(viewer);
    createUndoRedoActions();
    createRightClickMenu();
  }
Пример #12
0
  @Override
  protected Composite createPageContainer(Composite parent) {
    this.editorParent = parent;
    Composite composite = super.createPageContainer(parent);

    EditorUtil.initializeScrollbars(getHeaderForm().getForm());

    // create left tool bar that replaces form heading label
    try {
      FormHeading heading = (FormHeading) getHeaderForm().getForm().getForm().getHead();

      Field field = FormHeading.class.getDeclaredField("titleRegion"); // $NON-NLS-1$
      field.setAccessible(true);

      TitleRegion titleRegion = (TitleRegion) field.get(heading);

      leftToolBarManager = new ToolBarManager(SWT.FLAT);
      leftToolBar = leftToolBarManager.createControl(titleRegion);
      leftToolBar.addControlListener(
          new ControlAdapter() {
            private boolean ignoreResizeEvents;

            @Override
            public void controlResized(ControlEvent e) {
              if (ignoreResizeEvents) {
                return;
              }
              ignoreResizeEvents = true;
              try {
                // the tool bar contents has changed, update state
                updateHeaderImage();
                updateHeaderLabel();
              } finally {
                ignoreResizeEvents = false;
              }
            }
          });

      // titleLabel = new Label(titleRegion, SWT.NONE);
      // need a viewer for copy support
      TextViewer titleViewer = new TextViewer(titleRegion, SWT.READ_ONLY);
      // Eclipse 3.3 needs a document, otherwise an NPE is thrown
      titleViewer.setDocument(new Document());

      titleLabel = titleViewer.getTextWidget();
      titleLabel.setForeground(heading.getForeground());
      titleLabel.setFont(heading.getFont());
      // XXX work-around problem that causes field to maintain selection when unfocused
      titleLabel.addFocusListener(
          new FocusAdapter() {
            @Override
            public void focusLost(FocusEvent e) {
              titleLabel.setSelection(0);
            }
          });

      titleRegion.addControlListener(
          new ControlAdapter() {
            @Override
            public void controlResized(ControlEvent e) {
              // do not create busyLabel to avoid recursion
              updateSizeAndLocations();
            }
          });

      IHandlerService handlerService =
          (IHandlerService) getSite().getService(IHandlerService.class);
      if (handlerService != null) {
        textSupport = new CommonTextSupport(handlerService);
        textSupport.install(titleViewer, false);
      }
    } catch (Exception e) {
      if (!toolBarFailureLogged) {
        StatusHandler.log(
            new Status(
                IStatus.ERROR,
                TasksUiPlugin.ID_PLUGIN,
                "Failed to obtain busy label toolbar",
                e)); //$NON-NLS-1$
      }
      if (titleLabel != null) {
        titleLabel.dispose();
        titleLabel = null;
      }
      if (leftToolBar != null) {
        leftToolBar.dispose();
        leftToolBar = null;
      }
      if (leftToolBarManager != null) {
        leftToolBarManager.dispose();
        leftToolBarManager = null;
      }
    }

    updateHeader();

    return composite;
  }
Пример #13
0
  public void createPartControl(Composite parent) {
    statusline = getViewSite().getActionBars().getStatusLineManager();
    statusline.setMessage(
        Activator.getImageDescriptor("icons/info.png").createImage(),
        Messages.StatusLine_DropFilesHint);
    makeActions();

    ScrolledComposite scrolledComposite = new ScrolledComposite(parent, SWT.V_SCROLL);
    scrolledComposite.setExpandVertical(true);
    scrolledComposite.setExpandHorizontal(true);
    Composite content = new Composite(scrolledComposite, SWT.NONE);
    content.setLayout(new GridLayout(1, false));
    scrolledComposite.setContent(content);

    toolBarManager = new ToolBarManager();
    toolBarManager.add(encryptFilesAction);
    toolBarManager.add(newFolderAction);
    toolBarManager.add(new Separator("static"));
    toolBarManager.add(exportSelectionAction);
    toolBarManager.add(renameAction);
    toolBarManager.add(deleteSelectionAction);
    toolBarManager.add(new Separator("static"));
    toolBarManager.add(expandAllAction);
    toolBarManager.add(collapseAllAction);

    ToolBar toolbar = toolBarManager.createControl(content);
    toolbar.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false));

    // Create the tree viewer as a child of the composite parent
    treeViewer =
        new TreeViewer(
            content, SWT.FULL_SELECTION | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);

    // Anpassungen für TreeTable
    tree = treeViewer.getTree();

    GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
    treeViewer.getControl().setLayoutData(gridData);

    treeViewer.setUseHashlookup(true);

    /** * Tree table specific code starts ** */
    tree.setHeaderVisible(true);
    tree.setLinesVisible(true);

    for (SteadyTableIdentifier identifier : SteadyTableIdentifier.values()) {
      new TreeColumn(tree, SWT.NONE).setText(Messages.getSteadyTableColumnTitle(identifier));
      tree.getColumn(identifier.ordinal()).setWidth(identifier.columnWidth);
    }

    /** * Tree table specific code ends ** */

    // layout the tree viewer below the text field
    gridData = new GridData();
    gridData.grabExcessHorizontalSpace = true;
    gridData.grabExcessVerticalSpace = true;
    gridData.horizontalAlignment = GridData.FILL;
    gridData.verticalAlignment = GridData.FILL;
    treeViewer.getControl().setLayoutData(gridData);

    treeViewer.setContentProvider(new SteadyTreeTableContentProvider());
    treeViewer.setLabelProvider(new SteadyTreeTableLabelProvider());

    root = getInitialInput();
    treeViewer.setInput(root);
    treeViewer.expandToLevel(1);

    // Drag-Part //////////////////////////////////////////////////////////
    DragSource source = new DragSource(tree, DND.DROP_COPY | DND.DROP_MOVE);
    source.setTransfer(new Transfer[] {TextTransfer.getInstance()});
    source.addDragListener(new TreeDragSourceListener(tree));

    // Drop-Part //////////////////////////////////////////////////////////
    DropTarget dropTarget = new DropTarget(tree, DND.DROP_COPY | DND.DROP_DEFAULT);
    dropTarget.setTransfer(new Transfer[] {TextTransfer.getInstance(), FileTransfer.getInstance()});
    dropTarget.addDropListener(new TreeDropTargetAdapter(treeViewer, root));

    addListeners();
    createContextMenu();
    createFiltersAndSorters();
  }