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;
}
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);
}
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);
}
}
}
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);
}
}
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);
}
Aggregations