Java Code Examples for org.eclipse.swt.custom.CTabFolder#setLayout()

The following examples show how to use org.eclipse.swt.custom.CTabFolder#setLayout() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CommandTerminalDebugView.java    From typescript.java with MIT License 6 votes vote down vote up
@Override
public void createPartControl(Composite parent) {
	Composite p = new Composite(parent, SWT.NONE);
	p.setLayout(new GridLayout());
	p.setLayoutData(new GridData(GridData.FILL_BOTH));

	folder = new CTabFolder(p, SWT.NONE);
	folder.setFont(parent.getFont());
	folder.setLayout(new GridLayout());
	folder.setLayoutData(new GridData(GridData.FILL_BOTH));

	// Text tab
	terminalText = addTab(folder, "Text");
	// ANSI tab
	terminalANSI = addTab(folder, "ANSI");

}
 
Example 2
Source File: LogAnalysis.java    From AndroidRobot with Apache License 2.0 4 votes vote down vote up
public void createLogList() {
    tabFolderLogList = new CTabFolder(sashFormLog, SWT.NONE | SWT.BORDER);
    tabFolderLogList.setTabHeight(0);
    tabFolderLogList.marginHeight = 0;
    tabFolderLogList.marginWidth = 0;
    tabFolderLogList.setLayout(new FillLayout());
    tabFolderLogList.setBounds(5, 5, 200, 465);
    tabFolderLogList.setSimple(false);
    tabFolderLogList.setUnselectedCloseVisible(true);

    CTabItem tabItemLogList = new CTabItem(tabFolderLogList, SWT.NONE | SWT.MULTI
                                                             | SWT.V_SCROLL);
    tabFolderLogList.setSelection(tabItemLogList);
    tabItemLogList.setText("日志浏览");

    Composite composite = new Composite(tabFolderLogList, SWT.NONE);
    composite.setLayout(new GridLayout());
    treeLog = new Tree(composite, SWT.BORDER);
    colorBlack = display.getSystemColor(SWT.COLOR_BLACK);

    tabItemLogList.setControl(composite);
    treeLog.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    treeLog.addListener(SWT.MouseDoubleClick, new Listener() {
        public void handleEvent(Event event) {
            Point point = new Point(event.x, event.y);
            TreeItem item = treeLog.getItem(point);
            if (item != null) {
                String taskName = (String) item.getData("task");
                String loop = String.valueOf(item.getData("loop"));
                String caseName = (String) item.getData("case");
                int index = (Integer) item.getData("index");
                //System.out.println("task:"+taskName+" loop:"+loop+" caseName:"+caseName+" index:"+index);
                if (index != 0)
                    Log.loadLogs(styledTextLog, display, logFile, taskName, loop, caseName,
                        index);
            }
        }
    });

}
 
Example 3
Source File: KGPrintView.java    From elexis-3-core with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public void createPartControl(Composite parent){
	ctab = new CTabFolder(parent, SWT.BOTTOM);
	ctab.setLayout(new FillLayout());
	
}
 
Example 4
Source File: TemplatePrintView.java    From elexis-3-core with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public void createPartControl(Composite parent){
	ctab = new CTabFolder(parent, SWT.BOTTOM);
	ctab.setLayout(new FillLayout());
	
}
 
Example 5
Source File: LaborView.java    From elexis-3-core with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public void createPartControl(final Composite parent){
	setTitleImage(Images.IMG_VIEW_LABORATORY.getImage());
	
	tabFolder = new CTabFolder(parent, SWT.TOP);
	tabFolder.setLayout(new FillLayout());
	
	final CTabItem resultsTabItem = new CTabItem(tabFolder, SWT.NULL);
	resultsTabItem.setText("Resultate");
	resultsComposite = new LaborResultsComposite(tabFolder, SWT.NONE);
	resultsTabItem.setControl(resultsComposite);
	
	final CTabItem ordersTabItem = new CTabItem(tabFolder, SWT.NULL);
	ordersTabItem.setText("Verordnungen");
	ordersComposite = new LaborOrdersComposite(tabFolder, SWT.NONE);
	ordersTabItem.setControl(ordersComposite);
	
	tabFolder.setSelection(0);
	tabFolder.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e){
			resultsComposite.reload();
			ordersComposite.reload();
		}
	});
	makeActions();
	menu = new ViewMenus(getViewSite());
	menu.createMenu(newAction, backAction, fwdAction, printAction, importAction, xmlAction);
	// Orders
	final LaborOrderPulldownMenuCreator menuCreator =
		new LaborOrderPulldownMenuCreator(parent.getShell());
	if (menuCreator.getSelected() != null) {
		IAction dropDownAction = menuCreator.getAction();
		
		IActionBars actionBars = getViewSite().getActionBars();
		IToolBarManager toolbar = actionBars.getToolBarManager();
		
		toolbar.add(dropDownAction);
		
		// Set data
		dropDownAction.setText(menuCreator.getSelected().getText());
		dropDownAction.setToolTipText(menuCreator.getSelected().getToolTipText());
		dropDownAction.setImageDescriptor(menuCreator.getSelected().getImageDescriptor());
	}
	// Importers
	IToolBarManager tm = getViewSite().getActionBars().getToolBarManager();
	List<IAction> importers =
		Extensions.getClasses(
			Extensions.getExtensions(ExtensionPointConstantsUi.LABORDATENIMPORT),
			"ToolbarAction", //$NON-NLS-1$ //$NON-NLS-2$
			false);
	for (IAction ac : importers) {
		tm.add(ac);
	}
	if (importers.size() > 0) {
		tm.add(new Separator());
	}
	tm.add(refreshAction);
	tm.add(newColumnAction);
	tm.add(newAction);
	tm.add(backAction);
	tm.add(fwdAction);
	tm.add(expandAllAction);
	tm.add(collapseAllAction);
	tm.add(printAction);
	
	// register event listeners
	ElexisEventDispatcher.getInstance().addListeners(eeli_labitem, eeli_laborder,
		eeli_labresult, eeli_pat);
	Patient act = (Patient) ElexisEventDispatcher.getSelected(Patient.class);
	if ((act != null && act != resultsComposite.getPatient())) {
		resultsComposite.selectPatient(act);
	}
	getSite().getPage().addPartListener(udpateOnVisible);
}