Search in sources :

Example 41 with GridLayout

use of org.eclipse.swt.layout.GridLayout in project translationstudio8 by heartsome.

the class SelectionStatusDialog method createButtonBar.

/*
     * @see Dialog#createButtonBar(Composite)
     */
protected Control createButtonBar(Composite parent) {
    Font font = parent.getFont();
    Composite composite = new Composite(parent, SWT.NULL);
    GridLayout layout = new GridLayout();
    if (!fStatusLineAboveButtons) {
        layout.numColumns = 2;
    }
    layout.marginHeight = 0;
    layout.marginLeft = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
    layout.marginWidth = 0;
    composite.setLayout(layout);
    composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    composite.setFont(font);
    if (!fStatusLineAboveButtons && isHelpAvailable()) {
        createHelpControl(composite);
    }
    fStatusLine = new MessageLine(composite);
    fStatusLine.setAlignment(SWT.LEFT);
    GridData statusData = new GridData(GridData.FILL_HORIZONTAL);
    fStatusLine.setErrorStatus(null);
    fStatusLine.setFont(font);
    if (fStatusLineAboveButtons && isHelpAvailable()) {
        statusData.horizontalSpan = 2;
        createHelpControl(composite);
    }
    fStatusLine.setLayoutData(statusData);
    /*
		 * Create the rest of the button bar, but tell it not to
		 * create a help button (we've already created it).
		 */
    boolean helpAvailable = isHelpAvailable();
    setHelpAvailable(false);
    super.createButtonBar(composite);
    setHelpAvailable(helpAvailable);
    return composite;
}
Also used : MessageLine(org.eclipse.ui.internal.MessageLine) GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) GridData(org.eclipse.swt.layout.GridData) Font(org.eclipse.swt.graphics.Font)

Example 42 with GridLayout

use of org.eclipse.swt.layout.GridLayout in project translationstudio8 by heartsome.

the class HsImageLabel method createControl.

public Composite createControl(Composite parent) {
    parent.addDisposeListener(new DisposeListener() {

        public void widgetDisposed(DisposeEvent e) {
            dispose();
        }
    });
    Composite content = new Composite(parent, SWT.NONE);
    GridLayout contentLayout = new GridLayout(2, false);
    contentLayout.marginWidth = 0;
    contentLayout.marginHeight = 0;
    content.setLayout(contentLayout);
    content.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    this.control = content;
    imageLabel = createImageLabel(content);
    if (imageLabel != null) {
        imageLabel.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false, 1, 1));
    }
    Composite composite = new Composite(content, SWT.NONE);
    GridLayout comLayout = new GridLayout();
    comLayout.marginWidth = 0;
    comLayout.marginHeight = 0;
    composite.setLayout(comLayout);
    composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    descriptionLabel = createDescriptionLabel(composite);
    if (descriptionLabel != null) {
        descriptionLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    }
    body = new Composite(composite, SWT.NONE);
    GridLayout gd = new GridLayout();
    gd.marginRight = 0;
    gd.marginHeight = 0;
    body.setLayout(gd);
    if (body != null) {
        body.setLayoutData(new GridData(GridData.FILL_BOTH));
    }
    return body;
}
Also used : DisposeListener(org.eclipse.swt.events.DisposeListener) GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) GridData(org.eclipse.swt.layout.GridData) DisposeEvent(org.eclipse.swt.events.DisposeEvent)

Example 43 with GridLayout

use of org.eclipse.swt.layout.GridLayout in project translationstudio8 by heartsome.

the class TSWizardDialog method createDialogArea.

/*
	 * (non-Javadoc) Method declared on Dialog.
	 */
protected Control createDialogArea(Composite parent) {
    Composite composite = (Composite) super.createDialogArea(parent);
    // Build the Page container
    pageContainer = createPageContainer(composite);
    GridData gd = new GridData(GridData.FILL_BOTH);
    gd.widthHint = pageWidth;
    gd.heightHint = pageHeight;
    pageContainer.setLayoutData(gd);
    pageContainer.setFont(parent.getFont());
    // Insert a progress monitor
    progressMonitorPart = createProgressMonitorPart(composite, new GridLayout());
    GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
    progressMonitorPart.setLayoutData(gridData);
    progressMonitorPart.setVisible(false);
    // Build the separator line
    Label separator = new Label(composite, SWT.HORIZONTAL | SWT.SEPARATOR);
    separator.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    applyDialogFont(progressMonitorPart);
    return composite;
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) GridData(org.eclipse.swt.layout.GridData) Label(org.eclipse.swt.widgets.Label)

Example 44 with GridLayout

use of org.eclipse.swt.layout.GridLayout in project translationstudio8 by heartsome.

the class ExportFilterComposite method createContent.

/** 创建控件 */
private void createContent() {
    setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
    GridLayout gridLayout = new GridLayout(5, false);
    gridLayout.horizontalSpacing = 2;
    gridLayout.marginWidth = 0;
    gridLayout.marginHeight = 0;
    setLayout(gridLayout);
    conditionComboViewer = new ComboViewer(this, SWT.NONE | SWT.READ_ONLY);
    Combo conditionCombo = conditionComboViewer.getCombo();
    GridData gdConditionCombo = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1);
    gdConditionCombo.widthHint = 200;
    conditionCombo.setLayoutData(gdConditionCombo);
    conditionComboViewer.setContentProvider(new ArrayContentProvider());
    conditionComboViewer.setInput(filterNames);
    conditionComboViewer.addSelectionChangedListener(new ISelectionChangedListener() {

        public void selectionChanged(SelectionChangedEvent event) {
            IStructuredSelection sel = (IStructuredSelection) event.getSelection();
            if (sel.isEmpty()) {
                return;
            }
            baseDataBean.setOptionName((String) sel.getFirstElement());
            handlerFilterChangedEvent();
            opratorComboViewer.setInput(baseDataBean.getCurrentFilterExpressions());
            // 默认选中第一个
            opratorComboViewer.getCombo().select(0);
            baseDataBean.setCurrentExpression(opratorComboViewer.getCombo().getText());
        }
    });
    opratorComboViewer = new ComboViewer(this, SWT.NONE | SWT.READ_ONLY);
    Combo opratorCombo = opratorComboViewer.getCombo();
    GridData gd_opratorCombo = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1);
    gd_opratorCombo.widthHint = 100;
    opratorCombo.setLayoutData(gd_opratorCombo);
    opratorComboViewer.setContentProvider(new ArrayContentProvider());
    opratorComboViewer.setInput(this.baseDataBean.getCurrentFilterExpressions());
    opratorComboViewer.addSelectionChangedListener(new ISelectionChangedListener() {

        public void selectionChanged(SelectionChangedEvent event) {
            IStructuredSelection sel = (IStructuredSelection) event.getSelection();
            if (sel.isEmpty()) {
                return;
            }
            baseDataBean.setCurrentExpression((String) sel.getFirstElement());
        }
    });
    dynaComposite = new Composite(this, SWT.NONE);
    dynaComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    GridLayout gldynaComposite = new GridLayout(1, false);
    gldynaComposite.marginWidth = 0;
    gldynaComposite.marginHeight = 0;
    dynaComposite.setLayout(gldynaComposite);
    valueText = new Text(dynaComposite, SWT.BORDER);
    valueText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    addButton = new Button(this, SWT.NONE);
    GridData gdAddButton = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gdAddButton.widthHint = 25;
    addButton.setLayoutData(gdAddButton);
    addButton.setText("+");
    addButton.addListener(SWT.Selection, this);
    deleteButton = new Button(this, SWT.NONE);
    GridData gdDeletebutton = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gdDeletebutton.widthHint = 25;
    deleteButton.setLayoutData(gdDeletebutton);
    deleteButton.setText("-");
    deleteButton.addListener(SWT.Selection, this);
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) ComboViewer(org.eclipse.jface.viewers.ComboViewer) Button(org.eclipse.swt.widgets.Button) ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) GridData(org.eclipse.swt.layout.GridData) ArrayContentProvider(org.eclipse.jface.viewers.ArrayContentProvider) Combo(org.eclipse.swt.widgets.Combo) SelectionChangedEvent(org.eclipse.jface.viewers.SelectionChangedEvent) Text(org.eclipse.swt.widgets.Text) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection)

Example 45 with GridLayout

use of org.eclipse.swt.layout.GridLayout 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;
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) CTabFolder(org.eclipse.swt.custom.CTabFolder) GridData(org.eclipse.swt.layout.GridData) UIJob(org.eclipse.ui.progress.UIJob)

Aggregations

GridLayout (org.eclipse.swt.layout.GridLayout)1868 GridData (org.eclipse.swt.layout.GridData)1646 Composite (org.eclipse.swt.widgets.Composite)1417 Label (org.eclipse.swt.widgets.Label)839 Button (org.eclipse.swt.widgets.Button)672 SelectionEvent (org.eclipse.swt.events.SelectionEvent)597 Text (org.eclipse.swt.widgets.Text)510 Group (org.eclipse.swt.widgets.Group)491 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)481 Combo (org.eclipse.swt.widgets.Combo)215 ModifyListener (org.eclipse.swt.events.ModifyListener)199 SelectionListener (org.eclipse.swt.events.SelectionListener)197 ModifyEvent (org.eclipse.swt.events.ModifyEvent)190 Table (org.eclipse.swt.widgets.Table)138 Point (org.eclipse.swt.graphics.Point)131 TableViewer (org.eclipse.jface.viewers.TableViewer)112 ScrolledComposite (org.eclipse.swt.custom.ScrolledComposite)109 Shell (org.eclipse.swt.widgets.Shell)107 FillLayout (org.eclipse.swt.layout.FillLayout)96 ArrayList (java.util.ArrayList)89