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

The following examples show how to use org.eclipse.swt.custom.CTabFolder#setUnselectedCloseVisible() . 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: LogAnalysis.java    From AndroidRobot with Apache License 2.0 6 votes vote down vote up
public void createLogDetail() {
    tabFolderLogDetail = new CTabFolder(sashFormLog, SWT.CLOSE | SWT.BORDER);
    tabFolderLogDetail.setTabHeight(0);
    tabFolderLogDetail.marginHeight = 0;
    tabFolderLogDetail.marginWidth = 0;
    tabFolderLogDetail.setMaximizeVisible(false);
    tabFolderLogDetail.setMinimizeVisible(false);
    //tabFolderLogDetail.setSelectionBackground(new Color(display, new RGB(153, 186, 243)));
    tabFolderLogDetail.setSimple(false);
    tabFolderLogDetail.setUnselectedCloseVisible(true);

    CTabItem tabItemLogList = new CTabItem(tabFolderLogDetail, SWT.NONE | SWT.MULTI
                                                               | SWT.V_SCROLL);
    tabFolderLogDetail.setSelection(tabItemLogList);

    //styledTextLog = new List(tabFolderLogDetail, SWT.BORDER);
    styledTextLog = new StyledText(tabFolderLogDetail, SWT.BORDER | SWT.MULTI | SWT.H_SCROLL
                                                       | SWT.V_SCROLL | SWT.READ_ONLY);
    styledTextLog.addLineStyleListener(new LogLineStyleListener(shell));
    tabItemLogList.setControl(styledTextLog);
    //sTextLog.setFont(new Font(display,"Courier New",10,SWT.NONE));

}
 
Example 2
Source File: ComponentTitledBorder.java    From arx with Apache License 2.0 6 votes vote down vote up
/**
 * Creates a new instance.
 *
 * @param parent
 * @param controller
 * @param title
 * @param id
 */
public ComponentTitledBorder(Composite parent, Controller controller, String title, String id){

    folder = new CTabFolder(parent, SWT.TOP | SWT.BORDER | SWT.FLAT);
    folder.setUnselectedCloseVisible(false);
    folder.setSimple(false);
    
    // Create help button
    if (controller != null) SWTUtil.createHelpButton(controller, folder, id);

    // Prevent closing
    folder.addCTabFolder2Listener(new CTabFolder2Adapter() {
        @Override
        public void close(final CTabFolderEvent event) {
            event.doit = false;
        }
    });
    
    // Create general tab
    tab = new CTabItem(folder, SWT.NULL);
    tab.setText(title);
    tab.setShowClose(false);

    folder.setSelection(tab);
}
 
Example 3
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);
            }
        }
    });

}