Search in sources :

Example 11 with Display

use of org.eclipse.swt.widgets.Display in project translationstudio8 by heartsome.

the class ColorPicker method getColorImage.

private Image getColorImage(Color color) {
    Display display = Display.getCurrent();
    image = new Image(display, new Rectangle(10, 10, 70, 20));
    GC gc = new GC(image);
    gc.setBackground(color);
    gc.fillRectangle(image.getBounds());
    gc.dispose();
    return image;
}
Also used : Rectangle(org.eclipse.swt.graphics.Rectangle) Image(org.eclipse.swt.graphics.Image) GC(org.eclipse.swt.graphics.GC) Display(org.eclipse.swt.widgets.Display)

Example 12 with Display

use of org.eclipse.swt.widgets.Display in project translationstudio8 by heartsome.

the class CustomMatchConditionDialog method main.

/**
	 * @param args ;
	 */
public static void main(String[] args) {
    Display display = new Display();
    final Shell shell = new Shell(display);
    shell.setLayout(new GridLayout(1, false));
    final Combo combo = new Combo(shell, SWT.READ_ONLY);
    combo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    Button button = new Button(shell, SWT.PUSH);
    button.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
    button.setText("OK");
    button.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            CustomMatchConditionDialog dialog = new CustomMatchConditionDialog(shell);
            int res = dialog.open();
            if (res == CustomMatchConditionDialog.OK) {
            }
        }
    });
    shell.open();
    while (!shell.isDisposed()) {
        if (!display.readAndDispatch()) {
            display.sleep();
        }
    }
}
Also used : Shell(org.eclipse.swt.widgets.Shell) GridLayout(org.eclipse.swt.layout.GridLayout) Button(org.eclipse.swt.widgets.Button) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) Combo(org.eclipse.swt.widgets.Combo) Display(org.eclipse.swt.widgets.Display)

Example 13 with Display

use of org.eclipse.swt.widgets.Display in project translationstudio8 by heartsome.

the class XLIFFEditorImplWithNatTable method close.

/**
	 * 关闭此编辑器。 <li>当编辑器关闭自己会抛出 PartInitException 异常警告,因此此方法最适合在 init(IEditorSite site, IEditorInput input) 方法中调用</li>
	 */
private void close() throws PartInitException {
    Display display = getSite().getShell().getDisplay();
    display.asyncExec(new Runnable() {

        public void run() {
            getSite().getPage().closeEditor(XLIFFEditorImplWithNatTable.this, false);
            // Add By Leakey 释放资源
            if (titleImage != null && !titleImage.isDisposed()) {
                titleImage.dispose();
                titleImage = null;
            }
            if (statusLineImage != null && !statusLineImage.isDisposed()) {
                statusLineImage.dispose();
                statusLineImage = null;
            }
            if (table != null && !table.isDisposed()) {
                table.dispose();
                table = null;
            }
            handler = null;
            System.gc();
            JFaceResources.getFontRegistry().removeListener(fFontPropertyChangeListener);
        }
    });
}
Also used : Display(org.eclipse.swt.widgets.Display)

Example 14 with Display

use of org.eclipse.swt.widgets.Display in project otertool by wuntee.

the class BuildAndSignApkDialog method open.

/**
	 * Open the dialog.
	 * @return the result
	 */
public BuildAndSignApkBean open() {
    createContents();
    shlBuildAndSign.open();
    shlBuildAndSign.layout();
    Display display = getParent().getDisplay();
    while (!shlBuildAndSign.isDisposed()) {
        if (!display.readAndDispatch()) {
            display.sleep();
        }
    }
    return result;
}
Also used : Display(org.eclipse.swt.widgets.Display)

Example 15 with Display

use of org.eclipse.swt.widgets.Display in project otertool by wuntee.

the class FindDialog method open.

/**
	 * Open the dialog.
	 * @return the result
	 */
public Object open() {
    createContents();
    shlFind.open();
    shlFind.layout();
    Display display = getParent().getDisplay();
    while (!shlFind.isDisposed()) {
        if (!display.readAndDispatch()) {
            display.sleep();
        }
    }
    return result;
}
Also used : Display(org.eclipse.swt.widgets.Display)

Aggregations

Display (org.eclipse.swt.widgets.Display)191 Shell (org.eclipse.swt.widgets.Shell)49 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)28 InvocationTargetException (java.lang.reflect.InvocationTargetException)25 ProgressMonitorDialog (org.eclipse.jface.dialogs.ProgressMonitorDialog)22 Point (org.eclipse.swt.graphics.Point)17 ITask (com.cubrid.common.core.task.ITask)15 IRunnableWithProgress (org.eclipse.jface.operation.IRunnableWithProgress)15 Color (org.eclipse.swt.graphics.Color)15 GridLayout (org.eclipse.swt.layout.GridLayout)14 Button (org.eclipse.swt.widgets.Button)14 FillLayout (org.eclipse.swt.layout.FillLayout)13 GridData (org.eclipse.swt.layout.GridData)12 CubridDatabase (com.cubrid.common.ui.spi.model.CubridDatabase)11 ServerInfo (com.cubrid.cubridmanager.core.common.model.ServerInfo)11 IStatus (org.eclipse.core.runtime.IStatus)11 Status (org.eclipse.core.runtime.Status)11 Composite (org.eclipse.swt.widgets.Composite)11 CubridNodeChangedEvent (com.cubrid.common.ui.spi.event.CubridNodeChangedEvent)10 ArrayList (java.util.ArrayList)10