Search in sources :

Example 1 with PageBook

use of org.eclipse.ui.part.PageBook in project tdi-studio-se by Talend.

the class AbstractJvmPropertySection method createControls.

/*
     * @see AbstractPropertySection#createControls(Composite, TabbedPropertySheetPage)
     */
@Override
public final void createControls(Composite parent, final TabbedPropertySheetPage tabbedPropertySheetPage) {
    super.createControls(parent, tabbedPropertySheetPage);
    parent.setLayoutData(new GridData(GridData.FILL_BOTH));
    pageBook = new PageBook(parent, SWT.NONE);
    messagePage = createMessagePage(pageBook);
    contentPage = new Composite(pageBook, SWT.NONE);
    contentPage.setLayout(new FillLayout());
    pageBook.showPage(contentPage);
    propertySheet = getPropertySheet((PageSite) tabbedPropertySheetPage.getSite());
    createControls(contentPage);
    partListener = new PartListener(this, tabbedPropertySheetPage);
    perspectiveListener = new PerspectiveListener(this, tabbedPropertySheetPage.getSite(), propertySheet);
    JvmModel.getInstance().addJvmModelChangeListener(this);
    suspendRefresh = false;
}
Also used : PageSite(org.eclipse.ui.part.PageSite) PageBook(org.eclipse.ui.part.PageBook) Composite(org.eclipse.swt.widgets.Composite) GridData(org.eclipse.swt.layout.GridData) FillLayout(org.eclipse.swt.layout.FillLayout)

Example 2 with PageBook

use of org.eclipse.ui.part.PageBook in project tdi-studio-se by Talend.

the class MemorySection method createControls.

/*
     * @see AbstractPropertySection#createControls(Composite, TabbedPropertySheetPage)
     */
@Override
public void createControls(Composite parent) {
    tabFolder = getWidgetFactory().createTabFolder(parent, SWT.BOTTOM | SWT.FLAT);
    heapHistogramPageBook = new PageBook(tabFolder, SWT.NONE);
    heapHistogramMessageLabel = new Label(heapHistogramPageBook, SWT.NONE);
    heapHistogramPage = new HeapHistogramPage(this, heapHistogramPageBook, tabFolder, getActionBars());
    swtResourcePage = new SWTResourcesPage(this, tabFolder, getActionBars());
    defaultTabHeight = tabFolder.getTabHeight();
    tabFolder.setTabHeight(0);
    PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IHelpContextIds.MEMORY_PAGE);
}
Also used : PageBook(org.eclipse.ui.part.PageBook) Label(org.eclipse.swt.widgets.Label)

Example 3 with PageBook

use of org.eclipse.ui.part.PageBook in project tdi-studio-se by Talend.

the class JobHierarchyViewPart method createPartControl.

@Override
public void createPartControl(Composite container) {
    fParent = container;
    addResizeListener(fParent);
    fPagebook = new PageBook(container, SWT.NONE);
    // page 1 of page book (no hierarchy label)
    fNoHierarchyShownLabel = new Label(fPagebook, SWT.TOP + SWT.LEFT + SWT.WRAP);
    fNoHierarchyShownLabel.setText(showEmptyLabel);
    // page 2 of page book (viewers)
    fTypeMethodsSplitter = new SashForm(fPagebook, SWT.VERTICAL);
    fTypeMethodsSplitter.setVisible(false);
    fTypeViewerViewForm = new ViewForm(fTypeMethodsSplitter, SWT.NONE);
    Control typeViewerControl = createTypeViewerControl(fTypeViewerViewForm);
    fTypeViewerViewForm.setContent(typeViewerControl);
    dependencyViewerViewForm = new ViewForm(fTypeMethodsSplitter, SWT.NONE);
    fTypeMethodsSplitter.setWeights(new int[] { 65, 35 });
    Control dependencyViewerPart = createMethodViewerControl(dependencyViewerViewForm);
    dependencyViewerViewForm.setContent(dependencyViewerPart);
    dependencyViewerPaneLabel = new CLabel(dependencyViewerViewForm, SWT.NONE);
    dependencyViewerViewForm.setTopLeft(dependencyViewerPaneLabel);
    ToolBar methodViewerToolBar = new ToolBar(dependencyViewerViewForm, SWT.FLAT | SWT.WRAP);
    dependencyViewerViewForm.setTopCenter(methodViewerToolBar);
    initDragAndDrop();
    MenuManager menu = new MenuManager();
    menu.add(focusOnTypeAction);
    fNoHierarchyShownLabel.setMenu(menu.createContextMenu(fNoHierarchyShownLabel));
    fPagebook.showPage(fNoHierarchyShownLabel);
    int layout;
    try {
        layout = fDialogSettings.getInt(DIALOGSTORE_VIEWLAYOUT);
        if (layout < 0 || layout > 3) {
            layout = VIEW_LAYOUT_AUTOMATIC;
        }
    } catch (NumberFormatException e) {
        layout = VIEW_LAYOUT_AUTOMATIC;
    }
    // force the update
    fCurrentLayout = -1;
    // will fill the main tool bar
    setViewLayout(layout);
    // set the filter menu items
    IActionBars actionBars = getViewSite().getActionBars();
    IMenuManager viewMenu = actionBars.getMenuManager();
    // for (int i = 0; i < fViewActions.length; i++) {
    // ToggleViewAction action = fViewActions[i];
    // viewMenu.add(action);
    // action.setEnabled(false);
    // }
    // viewMenu.add(new Separator());
    // IMenuManager layoutSubMenu = new MenuManager(TypeHierarchyMessages.TypeHierarchyViewPart_layout_submenu);
    //$NON-NLS-1$
    IMenuManager layoutSubMenu = new MenuManager(Messages.getString("FocusOnJobAction.TypeHierarchyViewPart_layout_submenu"));
    viewMenu.add(layoutSubMenu);
    for (int i = 0; i < fToggleOrientationActions.length; i++) {
        layoutSubMenu.add(fToggleOrientationActions[i]);
    }
    viewMenu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
    // selection provider
    int nHierarchyViewers = fAllViewers.length;
    StructuredViewer[] trackedViewers = new StructuredViewer[nHierarchyViewers + 1];
    for (int i = 0; i < nHierarchyViewers; i++) {
        trackedViewers[i] = fAllViewers[i];
    }
    trackedViewers[nHierarchyViewers] = dependencyViewer;
    fSelectionProviderMediator = new SelectionProviderMediator(trackedViewers, getCurrentViewer());
    getSite().setSelectionProvider(fSelectionProviderMediator);
    ActionGroup[] actionGroups = new ActionGroup[] { new JobActionGroup() };
    fActionGroups = new CompositeActionGroup(actionGroups);
    fActionGroups.fillActionBars(actionBars);
}
Also used : CLabel(org.eclipse.swt.custom.CLabel) CompositeActionGroup(org.eclipse.jdt.internal.ui.actions.CompositeActionGroup) CLabel(org.eclipse.swt.custom.CLabel) Label(org.eclipse.swt.widgets.Label) SelectionProviderMediator(org.eclipse.jdt.internal.ui.viewsupport.SelectionProviderMediator) Point(org.eclipse.swt.graphics.Point) SashForm(org.eclipse.swt.custom.SashForm) ViewForm(org.eclipse.swt.custom.ViewForm) Control(org.eclipse.swt.widgets.Control) PageBook(org.eclipse.ui.part.PageBook) ActionGroup(org.eclipse.ui.actions.ActionGroup) CompositeActionGroup(org.eclipse.jdt.internal.ui.actions.CompositeActionGroup) ToolBar(org.eclipse.swt.widgets.ToolBar) MenuManager(org.eclipse.jface.action.MenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) StructuredViewer(org.eclipse.jface.viewers.StructuredViewer) IActionBars(org.eclipse.ui.IActionBars) Separator(org.eclipse.jface.action.Separator)

Example 4 with PageBook

use of org.eclipse.ui.part.PageBook in project tdi-studio-se by Talend.

the class JobHierarchyViewPart method createTypeViewerControl.

/**
     * bqian Comment method "createTypeViewerControl".
     * 
     * @param typeViewerViewForm
     * @return
     */
private Control createTypeViewerControl(Composite parent) {
    fViewerbook = new PageBook(parent, SWT.NULL);
    // Create the viewers
    JobHierarchyViewer superTypesViewer = new SuperJobHierarchyViewer(fViewerbook, fHierarchyLifeCycle, this);
    initializeTypesViewer(superTypesViewer);
    JobHierarchyViewer subTypesViewer = new SubJobHierarchyViewer(fViewerbook, fHierarchyLifeCycle, this);
    initializeTypesViewer(subTypesViewer);
    fAllViewers = new JobHierarchyViewer[2];
    fAllViewers[HIERARCHY_MODE_SUBTYPES] = subTypesViewer;
    fAllViewers[HIERARCHY_MODE_SUPERTYPES] = superTypesViewer;
    int currViewerIndex;
    try {
        // TODO
        // currViewerIndex = fDialogSettings.getInt(DIALOGSTORE_HIERARCHYVIEW);
        currViewerIndex = HIERARCHY_MODE_SUBTYPES;
        if (currViewerIndex < 0 || currViewerIndex > 1) {
            currViewerIndex = HIERARCHY_MODE_SUBTYPES;
        }
    } catch (NumberFormatException e) {
        currViewerIndex = HIERARCHY_MODE_SUBTYPES;
    }
    fEmptyTypesViewer = new Label(fViewerbook, SWT.TOP | SWT.LEFT | SWT.WRAP);
    for (int i = 0; i < fAllViewers.length; i++) {
        fAllViewers[i].setInput(fAllViewers[i]);
    }
    // force the update
    fCurrentViewerIndex = -1;
    setHierarchyMode(currViewerIndex);
    return fViewerbook;
}
Also used : PageBook(org.eclipse.ui.part.PageBook) CLabel(org.eclipse.swt.custom.CLabel) Label(org.eclipse.swt.widgets.Label) Point(org.eclipse.swt.graphics.Point)

Example 5 with PageBook

use of org.eclipse.ui.part.PageBook in project xtext-eclipse by eclipse.

the class ReferenceSearchViewPage method createControl.

@Override
public void createControl(Composite parent) {
    pagebook = new PageBook(parent, SWT.NULL);
    pagebook.setLayoutData(new GridData(GridData.FILL_BOTH));
    busyLabel = new Table(pagebook, SWT.NONE);
    TableItem item = new TableItem(busyLabel, SWT.NONE);
    item.setText(Messages.ReferenceSearchViewPage_busyLabel);
    busyLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    control = new Composite(pagebook, SWT.NULL);
    control.setLayoutData(new GridData(GridData.FILL_BOTH));
    control.setSize(100, 100);
    control.setLayout(new FillLayout());
    viewer = new TreeViewer(control, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
    viewer.setContentProvider(contentProvider);
    viewer.setLabelProvider(labelProvider);
    viewer.setSorter(sorter);
    createOpenAndLinkWithEditorHandler();
    IToolBarManager tbm = getSite().getActionBars().getToolBarManager();
    fillToolbar(tbm);
    tbm.update(true);
    pagebook.showPage(control);
    isBusyShowing = false;
    queryListener = createQueryListener();
    NewSearchUI.addQueryListener(queryListener);
}
Also used : Table(org.eclipse.swt.widgets.Table) PageBook(org.eclipse.ui.part.PageBook) Composite(org.eclipse.swt.widgets.Composite) IToolBarManager(org.eclipse.jface.action.IToolBarManager) TreeViewer(org.eclipse.jface.viewers.TreeViewer) TableItem(org.eclipse.swt.widgets.TableItem) GridData(org.eclipse.swt.layout.GridData) FillLayout(org.eclipse.swt.layout.FillLayout)

Aggregations

PageBook (org.eclipse.ui.part.PageBook)26 GridData (org.eclipse.swt.layout.GridData)12 Composite (org.eclipse.swt.widgets.Composite)10 GridLayout (org.eclipse.swt.layout.GridLayout)6 Label (org.eclipse.swt.widgets.Label)5 FormToolkit (org.eclipse.ui.forms.widgets.FormToolkit)4 IToolBarManager (org.eclipse.jface.action.IToolBarManager)3 FillLayout (org.eclipse.swt.layout.FillLayout)3 Control (org.eclipse.swt.widgets.Control)3 ExpandableComposite (org.eclipse.ui.forms.widgets.ExpandableComposite)3 Action (org.eclipse.jface.action.Action)2 IMenuManager (org.eclipse.jface.action.IMenuManager)2 MenuManager (org.eclipse.jface.action.MenuManager)2 ToolBarManager (org.eclipse.jface.action.ToolBarManager)2 TextSearchControl (org.eclipse.mylyn.commons.workbench.search.TextSearchControl)2 CLabel (org.eclipse.swt.custom.CLabel)2 SashForm (org.eclipse.swt.custom.SashForm)2 ScrolledComposite (org.eclipse.swt.custom.ScrolledComposite)2 ControlAdapter (org.eclipse.swt.events.ControlAdapter)2 ControlEvent (org.eclipse.swt.events.ControlEvent)2