Search in sources :

Example 61 with Display

use of org.eclipse.swt.widgets.Display in project cubrid-manager by CUBRID.

the class BrokerLogTopMergeProgress method openSuccessDialog.

/**
	 * show success message to users
	 *
	 * @param showMess String
	 */
private void openSuccessDialog(final String showMess) {
    Display display = Display.getDefault();
    display.asyncExec(new Runnable() {

        public void run() {
            CommonUITool.openInformationBox(PlatformUI.getWorkbench().getDisplay().getActiveShell(), Messages.titleConfirm, showMess);
        }
    });
}
Also used : Display(org.eclipse.swt.widgets.Display)

Example 62 with Display

use of org.eclipse.swt.widgets.Display in project cubrid-manager by CUBRID.

the class Application method stop.

public void stop() {
    final IWorkbench workbench = PlatformUI.getWorkbench();
    if (workbench == null) {
        return;
    }
    final Display display = workbench.getDisplay();
    display.syncExec(new Runnable() {

        public void run() {
            if (!display.isDisposed()) {
                workbench.close();
            }
        }
    });
}
Also used : IWorkbench(org.eclipse.ui.IWorkbench) Display(org.eclipse.swt.widgets.Display)

Example 63 with Display

use of org.eclipse.swt.widgets.Display in project MonjaDB by Kanatoko.

the class SWTResourceManager method getImage.

/**
	 * Returns an {@link Image} encoded by the specified {@link InputStream}.
	 * 
	 * @param stream
	 *            the {@link InputStream} encoding the image data
	 * @return the {@link Image} encoded by the specified input stream
	 */
protected static Image getImage(InputStream stream) throws IOException {
    try {
        Display display = Display.getCurrent();
        ImageData data = new ImageData(stream);
        if (data.transparentPixel > 0) {
            return new Image(display, data, data.getTransparencyMask());
        }
        return new Image(display, data);
    } finally {
        stream.close();
    }
}
Also used : ImageData(org.eclipse.swt.graphics.ImageData) Image(org.eclipse.swt.graphics.Image) Display(org.eclipse.swt.widgets.Display)

Example 64 with Display

use of org.eclipse.swt.widgets.Display in project cubrid-manager by CUBRID.

the class ExportErrorDataProgress method export.

/**
	 * export to excel
	 * @return
	 */
public boolean export() {
    Display display = Display.getDefault();
    display.syncExec(new Runnable() {

        public void run() {
            try {
                new ProgressMonitorDialog(null).run(true, false, ExportErrorDataProgress.this);
            } catch (Exception e) {
                LOGGER.error("", e);
            }
        }
    });
    return success;
}
Also used : ProgressMonitorDialog(org.eclipse.jface.dialogs.ProgressMonitorDialog) InvocationTargetException(java.lang.reflect.InvocationTargetException) WriteException(jxl.write.WriteException) Display(org.eclipse.swt.widgets.Display)

Example 65 with Display

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

the class SWTResourceManager method getColor.

/**
	 * Returns a {@link Color} given its RGB value.
	 * 
	 * @param rgb
	 *            the {@link RGB} value of the color
	 * @return the {@link Color} matching the RGB value
	 */
public static Color getColor(RGB rgb) {
    Color color = m_colorMap.get(rgb);
    if (color == null) {
        Display display = Display.getCurrent();
        color = new Color(display, rgb);
        m_colorMap.put(rgb, color);
    }
    return color;
}
Also used : Color(org.eclipse.swt.graphics.Color) Display(org.eclipse.swt.widgets.Display)

Aggregations

Display (org.eclipse.swt.widgets.Display)485 Shell (org.eclipse.swt.widgets.Shell)184 Point (org.eclipse.swt.graphics.Point)76 Test (org.junit.Test)63 FillLayout (org.eclipse.swt.layout.FillLayout)62 Color (org.eclipse.swt.graphics.Color)52 Button (org.eclipse.swt.widgets.Button)50 Rectangle (org.eclipse.swt.graphics.Rectangle)48 GridLayout (org.eclipse.swt.layout.GridLayout)43 Composite (org.eclipse.swt.widgets.Composite)43 GridData (org.eclipse.swt.layout.GridData)39 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)32 Image (org.eclipse.swt.graphics.Image)32 Label (org.eclipse.swt.widgets.Label)32 SWT (org.eclipse.swt.SWT)29 InvocationTargetException (java.lang.reflect.InvocationTargetException)28 StyledText (org.eclipse.swt.custom.StyledText)24 Text (org.eclipse.swt.widgets.Text)24 ProgressMonitorDialog (org.eclipse.jface.dialogs.ProgressMonitorDialog)23 Font (org.eclipse.swt.graphics.Font)23