Search in sources :

Example 6 with CTabFolder

use of org.eclipse.swt.custom.CTabFolder in project translationstudio8 by heartsome.

the class BrowserViewPart method createBrowserArea.

private Composite createBrowserArea(Composite parent) {
    GridLayout gridLayout = new GridLayout(1, false);
    parent.setLayout(gridLayout);
    GridData gd_displayArea = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1);
    parent.setLayoutData(gd_displayArea);
    tabFolder = new CTabFolder(parent, SWT.TOP | SWT.MULTI | SWT.FLAT);
    tabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
    UIJob job = new UIJob(Display.getDefault(), "refresh browser") {

        @Override
        public IStatus runInUIThread(IProgressMonitor monitor) {
            refreshTabContent();
            return Status.OK_STATUS;
        }

        /** (non-Javadoc)
			 * @see org.eclipse.core.runtime.jobs.Job#shouldRun()
			 */
        @Override
        public boolean shouldRun() {
            return !tabFolder.isDisposed();
        }
    };
    job.schedule();
    return parent;
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) CTabFolder(org.eclipse.swt.custom.CTabFolder) GridData(org.eclipse.swt.layout.GridData) UIJob(org.eclipse.ui.progress.UIJob)

Example 7 with CTabFolder

use of org.eclipse.swt.custom.CTabFolder in project otertool by wuntee.

the class Test method createContents.

/**
	 * Create contents of the window.
	 */
protected void createContents() {
    shell = new Shell();
    shell.setSize(450, 300);
    shell.setText("SWT Application");
    shell.setLayout(new GridLayout(1, false));
    CTabFolder tabFolder = new CTabFolder(shell, SWT.BORDER);
    tabFolder.setSimple(false);
    tabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
    tabFolder.setSelectionBackground(Display.getCurrent().getSystemColor(SWT.COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT));
    CTabItem tabItem = new CTabItem(tabFolder, SWT.NONE);
    tabItem.setText("New Item");
    tree = new Tree(tabFolder, SWT.BORDER);
    tabItem.setControl(tree);
    trtmTestTreeItem = new TreeItem(tree, SWT.NONE);
    trtmTestTreeItem.setText("test tree item");
    trtmNewTreeitem = new TreeItem(trtmTestTreeItem, SWT.NONE);
    trtmNewTreeitem.setText("New TreeItem");
    trtmTestTreeItem.setExpanded(true);
}
Also used : Shell(org.eclipse.swt.widgets.Shell) GridLayout(org.eclipse.swt.layout.GridLayout) CTabFolder(org.eclipse.swt.custom.CTabFolder) TreeItem(org.eclipse.swt.widgets.TreeItem) GridData(org.eclipse.swt.layout.GridData) Tree(org.eclipse.swt.widgets.Tree) CTabItem(org.eclipse.swt.custom.CTabItem)

Example 8 with CTabFolder

use of org.eclipse.swt.custom.CTabFolder in project tdi-studio-se by Talend.

the class AbstractMultiPageTalendEditor method createPages.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.ui.part.MultiPageEditorPart#createPages()
     */
@Override
protected void createPages() {
    createPage0();
    createPage1();
    createPage2();
    if (getPageCount() == 1) {
        Composite container = getContainer();
        if (container instanceof CTabFolder) {
            ((CTabFolder) container).setTabHeight(0);
        }
    }
}
Also used : CTabFolder(org.eclipse.swt.custom.CTabFolder) Composite(org.eclipse.swt.widgets.Composite)

Example 9 with CTabFolder

use of org.eclipse.swt.custom.CTabFolder in project tdi-studio-se by Talend.

the class AbstractMultiPageTalendEditor method onThemeChanging.

@Override
public void onThemeChanging(String newThemeId, String oldThemeId) {
    if (newThemeId == null) {
        return;
    }
    if (TalendThemeUtils.isThemeFromTalend(newThemeId)) {
        return;
    }
    Composite container = getContainer();
    if (container instanceof CTabFolder) {
        ((CTabFolder) container).setBackground(null, null, true);
        ((CTabFolder) container).setSelectionBackground(null, null, true);
    }
}
Also used : CTabFolder(org.eclipse.swt.custom.CTabFolder) Composite(org.eclipse.swt.widgets.Composite)

Example 10 with CTabFolder

use of org.eclipse.swt.custom.CTabFolder in project tdi-studio-se by Talend.

the class SetupProcessDependenciesRoutinesDialog method createTabFolderField.

private void createTabFolderField(Composite parent) {
    // tab
    folder = new CTabFolder(parent, SWT.NONE);
    folder.setLayoutData(new GridData(GridData.FILL_BOTH));
    folder.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            updateButtons();
        }
    });
    userTabItem = new CTabItem(folder, SWT.NONE);
    //$NON-NLS-1$
    userTabItem.setText(Messages.getString("SetupProcessDependenciesRoutinesDialog.userRoutineLabel"));
    systemTabItem = new CTabItem(folder, SWT.NONE);
    //$NON-NLS-1$
    systemTabItem.setText(Messages.getString("SetupProcessDependenciesRoutinesDialog.systemRoutineLabel"));
    folder.setSelection(userTabItem);
    folder.setSimple(false);
    ISelectionChangedListener listListener = new ISelectionChangedListener() {

        @Override
        public void selectionChanged(SelectionChangedEvent event) {
            updateButtons();
        }
    };
    // user
    Composite userComposite = new Composite(folder, SWT.NONE);
    userComposite.setLayout(new GridLayout());
    userComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
    userViewer = new ListViewer(userComposite, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
    userViewer.setLabelProvider(new RoutineRecordLabelProvider());
    userViewer.setContentProvider(ArrayContentProvider.getInstance());
    userViewer.setInput(userRoutines);
    userViewer.getList().setLayoutData(new GridData(GridData.FILL_BOTH));
    userViewer.addSelectionChangedListener(listListener);
    userTabItem.setControl(userComposite);
    // system
    Composite systemComposite = new Composite(folder, SWT.NONE);
    systemComposite.setLayout(new GridLayout());
    systemComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
    systemViewer = new ListViewer(systemComposite, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
    systemViewer.setLabelProvider(new RoutineRecordLabelProvider());
    systemViewer.setContentProvider(ArrayContentProvider.getInstance());
    systemViewer.setInput(systemRoutines);
    systemViewer.getList().setLayoutData(new GridData(GridData.FILL_BOTH));
    systemViewer.addSelectionChangedListener(listListener);
    systemTabItem.setControl(systemComposite);
}
Also used : ListViewer(org.eclipse.jface.viewers.ListViewer) GridLayout(org.eclipse.swt.layout.GridLayout) CTabFolder(org.eclipse.swt.custom.CTabFolder) Composite(org.eclipse.swt.widgets.Composite) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) SelectionChangedEvent(org.eclipse.jface.viewers.SelectionChangedEvent) CTabItem(org.eclipse.swt.custom.CTabItem)

Aggregations

CTabFolder (org.eclipse.swt.custom.CTabFolder)49 GridData (org.eclipse.swt.layout.GridData)28 CTabItem (org.eclipse.swt.custom.CTabItem)23 GridLayout (org.eclipse.swt.layout.GridLayout)21 Composite (org.eclipse.swt.widgets.Composite)20 SelectionEvent (org.eclipse.swt.events.SelectionEvent)17 FillLayout (org.eclipse.swt.layout.FillLayout)14 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)12 Label (org.eclipse.swt.widgets.Label)8 SelectionListener (org.eclipse.swt.events.SelectionListener)6 SashForm (org.eclipse.swt.custom.SashForm)5 StyledText (org.eclipse.swt.custom.StyledText)5 Point (org.eclipse.swt.graphics.Point)5 Button (org.eclipse.swt.widgets.Button)5 FormAttachment (org.eclipse.swt.layout.FormAttachment)4 FormData (org.eclipse.swt.layout.FormData)4 Menu (org.eclipse.swt.widgets.Menu)4 MenuItem (org.eclipse.swt.widgets.MenuItem)4 ToolBar (org.eclipse.swt.widgets.ToolBar)4 ToolItem (org.eclipse.swt.widgets.ToolItem)4