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);
}
});
}
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();
}
}
});
}
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();
}
}
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;
}
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;
}
Aggregations