Search in sources :

Example 46 with SashForm

use of org.eclipse.swt.custom.SashForm in project bndtools by bndtools.

the class JARContentPage method createFormContent.

@Override
protected void createFormContent(IManagedForm managedForm) {
    managedForm.setInput(getEditorInput());
    FormToolkit toolkit = managedForm.getToolkit();
    ScrolledForm form = managedForm.getForm();
    form.setText("JAR File Viewer");
    toolkit.decorateFormHeading(form.getForm());
    titleImg = AbstractUIPlugin.imageDescriptorFromPlugin(PluginConstants.PLUGIN_ID, "/icons/jar_obj.gif").createImage(form.getDisplay());
    form.setImage(titleImg);
    // CREATE CONTROLS
    Composite body = form.getBody();
    SashForm sashForm = new SashForm(body, SWT.HORIZONTAL);
    Composite treePanel = toolkit.createComposite(sashForm);
    contentTreePart = new JARContentTreePart(treePanel, managedForm);
    managedForm.addPart(contentTreePart);
    Composite detailsPanel = toolkit.createComposite(sashForm);
    entryPart = new JAREntryPart(getEditor(), detailsPanel, toolkit);
    managedForm.addPart(entryPart);
    if (selectedPath != null)
        contentTreePart.setSelectedPath(selectedPath);
    // LAYOUT
    GridLayout layout;
    layout = new GridLayout();
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    body.setLayout(layout);
    sashForm.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
// treeSection.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
// detailsPanel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
}
Also used : SashForm(org.eclipse.swt.custom.SashForm) GridLayout(org.eclipse.swt.layout.GridLayout) FormToolkit(org.eclipse.ui.forms.widgets.FormToolkit) Composite(org.eclipse.swt.widgets.Composite) ScrolledForm(org.eclipse.ui.forms.widgets.ScrolledForm) GridData(org.eclipse.swt.layout.GridData)

Example 47 with SashForm

use of org.eclipse.swt.custom.SashForm in project eclipse.platform.swt by eclipse.

the class Tab method createTabFolderPage.

/**
 * Creates the tab folder page.
 *
 * @param tabFolder org.eclipse.swt.widgets.TabFolder
 * @return the new page for the tab folder
 */
Composite createTabFolderPage(TabFolder tabFolder) {
    /* Cache the shell and display. */
    shell = tabFolder.getShell();
    display = shell.getDisplay();
    /* Create a two column page with a SashForm*/
    tabFolderPage = new Composite(tabFolder, SWT.NONE);
    tabFolderPage.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    tabFolderPage.setLayout(new FillLayout());
    sash = new SashForm(tabFolderPage, SWT.HORIZONTAL);
    /* Create the "layout" and "control" columns */
    createLayoutGroup();
    createControlGroup();
    sash.setWeights(sashWeights());
    return tabFolderPage;
}
Also used : SashForm(org.eclipse.swt.custom.SashForm) Composite(org.eclipse.swt.widgets.Composite) GridData(org.eclipse.swt.layout.GridData) FillLayout(org.eclipse.swt.layout.FillLayout)

Example 48 with SashForm

use of org.eclipse.swt.custom.SashForm in project eclipse.platform.swt by eclipse.

the class Test_org_eclipse_swt_custom_CTabFolder method test_nestedTabHighlighting.

/**
 * Test for bug 528251.
 *
 * We define two {@link CTabFolder tab folders}, of which one has a nested tab folder.
 * We validate that selecting the nested tab does not break selection highlight for the top-level tabs.
 *
 * @see Bug528251_CTabFolder_nested_highlighting
 */
@Test
public void test_nestedTabHighlighting() {
    CTabFolder partStackTabFolder = new CTabFolder(shell, SWT.NONE);
    CTabItem consoleViewTab = new CTabItem(partStackTabFolder, SWT.NONE);
    consoleViewTab.setText("Console View");
    SashForm anotherView = new SashForm(partStackTabFolder, SWT.NONE);
    CTabItem anotherViewTab = new CTabItem(partStackTabFolder, SWT.NONE);
    anotherViewTab.setText("Other View");
    anotherViewTab.setControl(anotherView);
    CTabFolder anotherViewNestedTabFolder = new CTabFolder(anotherView, SWT.NONE);
    CTabItem anotherViewNestedTab = new CTabItem(anotherViewNestedTabFolder, SWT.NONE);
    anotherViewNestedTab.setText("nested tab");
    shell.pack();
    shell.open();
    processEvents();
    // nothing is selected, expect no highlight
    boolean shouldHighlightConsoleViewTab = reflection_shouldHighlight(partStackTabFolder);
    assertFalse("expected CTabFolder to not need highlighting without any selection", shouldHighlightConsoleViewTab);
    // "click" on the Console View tab
    partStackTabFolder.notifyListeners(SWT.Activate, new Event());
    partStackTabFolder.setSelection(consoleViewTab);
    // "click" on the Other View tab, per default the first sub-tab is also highlighted
    partStackTabFolder.setSelection(anotherViewTab);
    anotherViewNestedTabFolder.notifyListeners(SWT.Activate, new Event());
    // "click" on the nested tab
    anotherViewNestedTabFolder.setSelection(anotherViewNestedTab);
    partStackTabFolder.setSelection(consoleViewTab);
    // "click" on the Console View tab, this hides and deactivates the nested CTabFolder
    anotherViewNestedTabFolder.notifyListeners(SWT.Deactivate, new Event());
    processEvents();
    // the Console View tab is selected, so it should still be highlighted
    shouldHighlightConsoleViewTab = reflection_shouldHighlight(partStackTabFolder);
    assertTrue("Bug 528251 - View tab not highlighted due to another view with a CTabFolder", shouldHighlightConsoleViewTab);
}
Also used : SashForm(org.eclipse.swt.custom.SashForm) CTabFolder(org.eclipse.swt.custom.CTabFolder) Event(org.eclipse.swt.widgets.Event) CTabItem(org.eclipse.swt.custom.CTabItem) Test(org.junit.Test)

Example 49 with SashForm

use of org.eclipse.swt.custom.SashForm in project yamcs-studio by yamcs.

the class RuntimeView method createPartControl.

@Override
public void createPartControl(Composite parent) {
    SashForm horizontalSash = new SashForm(parent, SWT.HORIZONTAL);
    // delte?
    GridLayoutFactory.fillDefaults().generateLayout(horizontalSash);
    horizontalSash.setSashWidth(20);
    sidebar = new Sidebar(horizontalSash, SWT.NONE);
    GridLayoutFactory.fillDefaults().generateLayout(sidebar);
    Label b = new Label(horizontalSash, SWT.NONE);
    b.setText("b");
    horizontalSash.setWeights(new int[] { 20, 80 });
}
Also used : SashForm(org.eclipse.swt.custom.SashForm) Label(org.eclipse.swt.widgets.Label)

Example 50 with SashForm

use of org.eclipse.swt.custom.SashForm in project cubrid-manager by CUBRID.

the class TableSchemaCompareInfoPart method createPartControl.

public void createPartControl(final Composite parent) {
    ScrolledComposite scrolledComp = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL);
    scrolledComp.setLayout(new FillLayout());
    scrolledComp.setExpandHorizontal(true);
    scrolledComp.setExpandVertical(true);
    topSash = new SashForm(scrolledComp, SWT.VERTICAL);
    topSash.setBackground(ResourceManager.getColor(136, 161, 227));
    {
        GridLayout gridLayout = new GridLayout();
        gridLayout.verticalSpacing = 0;
        gridLayout.marginWidth = 0;
        gridLayout.marginHeight = 0;
        gridLayout.horizontalSpacing = 0;
        topSash.setLayout(gridLayout);
    }
    topSash.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    topSash.SASH_WIDTH = 1;
    scrolledComp.setContent(topSash);
    showTopButtons();
    Composite tableComposite = new Composite(topSash, SWT.NONE);
    {
        GridLayout layout = new GridLayout();
        layout.marginHeight = 0;
        tableComposite.setLayout(layout);
        createCommonColumnsOnTable(tableComposite);
    }
    labelComposite = new Composite(tableComposite, SWT.NONE);
    {
        GridLayout labelLayout = new GridLayout(6, false);
        labelComposite.setLayout(labelLayout);
        labelComposite.setLayoutData(CommonUITool.createGridData(GridData.FILL_HORIZONTAL, 1, 1, -1, 25));
    }
    Label labelRedIcon = new Label(labelComposite, SWT.NONE);
    Image redIcon = CommonUIPlugin.getImage("icons/compare/red_ball.png");
    labelRedIcon.setImage(redIcon);
    Label labelRedIconMsg = new Label(labelComposite, SWT.NONE);
    labelRedIconMsg.setText(Messages.differentSchemaMsg);
    boolean isERwinCompareMode = sourceDB.isVirtual() || targetDB.isVirtual();
    if (!isERwinCompareMode) {
        labelYellowIcon = new Label(labelComposite, SWT.NONE);
        labelYellowIcon.setVisible(false);
        {
            Image yellowIcon = CommonUIPlugin.getImage("icons/compare/yellow_ball.png");
            labelYellowIcon.setImage(yellowIcon);
        }
        labelYellowIconMsg = new Label(labelComposite, SWT.NONE);
        labelYellowIconMsg.setText(Messages.diffferntDataMsg);
        labelYellowIconMsg.setVisible(false);
    }
    Label labelGreenIcon = new Label(labelComposite, SWT.NONE);
    Image greenIcon = CommonUIPlugin.getImage("icons/compare/green_ball.png");
    labelGreenIcon.setImage(greenIcon);
    Label labelGreenIconMsg = new Label(labelComposite, SWT.NONE);
    if (isERwinCompareMode) {
        labelGreenIconMsg.setText(Messages.equalSchemaMsg);
    } else {
        labelGreenIconMsg.setText(Messages.totallyEqualMsg);
    }
    createTabFolder(topSash);
    topSash.setWeights(new int[] { 5, 60, 35 });
    // Virtual database is from a ER-Win xml file.
    if (compareRealDatabase) {
        createDetailColumnsOnTable();
    }
    this.setInputs();
}
Also used : SashForm(org.eclipse.swt.custom.SashForm) GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) GridData(org.eclipse.swt.layout.GridData) Label(org.eclipse.swt.widgets.Label) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) FillLayout(org.eclipse.swt.layout.FillLayout) Image(org.eclipse.swt.graphics.Image)

Aggregations

SashForm (org.eclipse.swt.custom.SashForm)96 GridData (org.eclipse.swt.layout.GridData)65 GridLayout (org.eclipse.swt.layout.GridLayout)57 Composite (org.eclipse.swt.widgets.Composite)56 SelectionEvent (org.eclipse.swt.events.SelectionEvent)31 FillLayout (org.eclipse.swt.layout.FillLayout)30 Label (org.eclipse.swt.widgets.Label)26 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)25 CTabItem (org.eclipse.swt.custom.CTabItem)14 Button (org.eclipse.swt.widgets.Button)13 StyledText (org.eclipse.swt.custom.StyledText)12 ToolBar (org.eclipse.swt.widgets.ToolBar)12 ArrayList (java.util.ArrayList)11 Point (org.eclipse.swt.graphics.Point)11 Table (org.eclipse.swt.widgets.Table)11 ToolItem (org.eclipse.swt.widgets.ToolItem)11 TableViewer (org.eclipse.jface.viewers.TableViewer)10 Event (org.eclipse.swt.widgets.Event)10 Listener (org.eclipse.swt.widgets.Listener)9 Tree (org.eclipse.swt.widgets.Tree)9