Search in sources :

Example 1 with TableWrapLayout

use of org.eclipse.ui.forms.widgets.TableWrapLayout in project cubrid-manager by CUBRID.

the class NoticeDashboardPage method createFormContent.

protected void createFormContent(IManagedForm managedForm) {
    super.createFormContent(managedForm);
    toolkit = managedForm.getToolkit();
    form = managedForm.getForm();
    toolkit.decorateFormHeading(form.getForm());
    String title = client.equals("CMT") ? Messages.titleCUBRIDMigration : client.equals("CQB") ? Messages.titleCUBRIDQuery : Messages.titleCUBRIDManager;
    form.setText(title);
    form.setFont(new Font(Display.getCurrent(), "Arial", 13, SWT.BOLD));
    Composite composite = form.getBody();
    TableWrapLayout layout2 = new TableWrapLayout();
    layout2.numColumns = 2;
    layout2.makeColumnsEqualWidth = true;
    composite.setLayout(layout2);
    TableWrapLayout layout1 = new TableWrapLayout();
    layout1.numColumns = 1;
    TableWrapData twd;
    left = toolkit.createComposite(composite, SWT.None);
    left.setLayout(layout1);
    twd = new TableWrapData(TableWrapData.FILL_GRAB);
    left.setLayoutData(twd);
    layout1 = new TableWrapLayout();
    layout1.numColumns = 1;
    right = toolkit.createComposite(composite, SWT.None);
    right.setLayout(layout1);
    twd = new TableWrapData(TableWrapData.FILL_GRAB);
    right.setLayoutData(twd);
    createContentSections(left, right);
    ScheduledExecutorService pool = Executors.newSingleThreadScheduledExecutor();
    pool.schedule(new Runnable() {

        public void run() {
            initData();
            Display.getDefault().syncExec(new Runnable() {

                public void run() {
                    setContent();
                }
            });
        }
    }, 10, TimeUnit.MILLISECONDS);
    pool.shutdown();
}
Also used : TableWrapData(org.eclipse.ui.forms.widgets.TableWrapData) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) Composite(org.eclipse.swt.widgets.Composite) TableWrapLayout(org.eclipse.ui.forms.widgets.TableWrapLayout) Font(org.eclipse.swt.graphics.Font)

Example 2 with TableWrapLayout

use of org.eclipse.ui.forms.widgets.TableWrapLayout in project cubrid-manager by CUBRID.

the class NoticeDashboardPage method createSection.

private Section createSection(Composite parent, String title, String category, int sectionStyle) {
    Section section = toolkit.createSection(parent, sectionStyle);
    section.clientVerticalSpacing = 5;
    section.setLayout(new GridLayout());
    section.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB));
    section.setText(title);
    if (category != null) {
        TableWrapLayout layout = new TableWrapLayout();
        layout.numColumns = 1;
        Composite composite = toolkit.createComposite(section, SWT.None);
        composite.setLayout(layout);
        composite.setLayoutData(new GridData(GridData.FILL_BOTH));
        section.setClient(composite);
        FormText text = createFormText(composite);
        formTexts.put(category, text);
    }
    sections.add(section);
    return section;
}
Also used : TableWrapData(org.eclipse.ui.forms.widgets.TableWrapData) GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) TableWrapLayout(org.eclipse.ui.forms.widgets.TableWrapLayout) FormText(org.eclipse.ui.forms.widgets.FormText) GridData(org.eclipse.swt.layout.GridData) Section(org.eclipse.ui.forms.widgets.Section)

Aggregations

Composite (org.eclipse.swt.widgets.Composite)2 TableWrapData (org.eclipse.ui.forms.widgets.TableWrapData)2 TableWrapLayout (org.eclipse.ui.forms.widgets.TableWrapLayout)2 ScheduledExecutorService (java.util.concurrent.ScheduledExecutorService)1 Font (org.eclipse.swt.graphics.Font)1 GridData (org.eclipse.swt.layout.GridData)1 GridLayout (org.eclipse.swt.layout.GridLayout)1 FormText (org.eclipse.ui.forms.widgets.FormText)1 Section (org.eclipse.ui.forms.widgets.Section)1