本文整理汇总了Java中org.eclipse.swt.widgets.Display.dispose方法的典型用法代码示例。如果您正苦于以下问题:Java Display.dispose方法的具体用法?Java Display.dispose怎么用?Java Display.dispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.widgets.Display
的用法示例。
在下文中一共展示了Display.dispose方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: startEclipseUI
import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
/**
* Starts the eclipse UI.
* @param postWindowOpenRunnable the post window open runnable
* @return the integer
*/
public Integer startEclipseUI(Runnable postWindowOpenRunnable) {
Integer eclipseReturnValue = IApplication.EXIT_OK;
Display display = PlatformUI.createDisplay();
try {
// --- Returns if visualization was closed ----
int returnCode = PlatformUI.createAndRunWorkbench(display, new ApplicationWorkbenchAdvisor(postWindowOpenRunnable));
if (returnCode == PlatformUI.RETURN_RESTART) {
eclipseReturnValue = IApplication.EXIT_RESTART;
} else {
eclipseReturnValue = IApplication.EXIT_OK;
}
} finally {
display.dispose();
// --- Just in case of the Eclipse UI ---------
// --- usage or after an update + restart -----
if (this.getVisualisationPlatform()==ApplicationVisualizationBy.EclipseFramework || eclipseReturnValue==IApplication.EXIT_RESTART) {
appReturnValue = eclipseReturnValue;
Application.setQuitJVM(true);
}
}
return eclipseReturnValue;
}
示例2: start
import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
@Override
public Object start ( final IApplicationContext context ) throws Exception
{
Display display = PlatformUI.createDisplay ();
try
{
int returnCode = PlatformUI.createAndRunWorkbench ( display, new ApplicationWorkbenchAdvisor () );
if ( returnCode == PlatformUI.RETURN_RESTART )
{
return IApplication.EXIT_RESTART;
}
else
{
return IApplication.EXIT_OK;
}
}
finally
{
display.dispose ();
}
}
示例3: openShell
import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
public static void openShell(String format, int weight, int height, Function<Shell, Control> function) {
Display display = new Display();
Shell shell = new Shell(display);
shell.setSize(weight, height);
shell.setLayout(new FillLayout());
function.apply(shell);
shell.open();
while(!shell.isDisposed()) {
if(!display.readAndDispatch()) {
display.sleep();
}
}
display.dispose();
}
示例4: main
import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
public static void main (String [] args) {
DeviceData data = new DeviceData();
data.tracking = true;
Display display = new Display (data);
Sleak sleak = new Sleak ();
sleak.open ();
// Launch your application here
SwtAppleCommander ac = new SwtAppleCommander();
ac.launch(display);
// End of AC code...
while (!sleak.shell.isDisposed ()) {
if (!display.readAndDispatch ()) display.sleep ();
}
display.dispose ();
}
示例5: main
import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
public static void main(final String[] args) {
final Display display = new Display();
final Shell shell = new Shell(display);
Locale.setDefault(Locale.ENGLISH);
final TipDayEx tipDayEx = new TipDayEx();
for (String tipMessage : new String[] { "This is the first tip",
"This is the second tip", "This is the third tip",
"This is the forth tip", "This is the fifth tip" }) {
tipDayEx.addTip(String.format(
"<h4>%s</h4>" + "<b>%s</b> " + "<u>%s</u> " + "<i>%s</i> " + "%s "
+ "%s<br/>" + "<p color=\"#A00000\">%s</p>",
tipMessage, tipMessage, tipMessage, tipMessage, tipMessage,
tipMessage, tipMessage));
}
tipDayEx.open(shell, display);
display.dispose();
}
示例6: test
import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
@Test
public void test() {
JTouchBar jTouchBar = JTouchBarTestUtils.constructTouchBar();
assertNotNull(jTouchBar);
Display display = Display.getCurrent();
Shell shell = new Shell(display);
shell.setLayout(new FillLayout());
shell.open();
jTouchBar.show( shell );
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
break;
}
}
display.dispose();
}
示例7: start
import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
@Override
public Object start ( final IApplicationContext context ) throws Exception
{
final Display display = PlatformUI.createDisplay ();
try
{
final int returnCode = PlatformUI.createAndRunWorkbench ( display, new ApplicationWorkbenchAdvisor () );
if ( returnCode == PlatformUI.RETURN_RESTART )
{
return IApplication.EXIT_RESTART;
}
else
{
return IApplication.EXIT_OK;
}
}
finally
{
display.dispose ();
}
}
示例8: start
import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
public Object start(IApplicationContext context) throws Exception {
Display display = PlatformUI.createDisplay();
try {
int returnCode = PlatformUI.createAndRunWorkbench(display, new ApplicationWorkbenchAdvisor());
if (returnCode == PlatformUI.RETURN_RESTART)
return IApplication.EXIT_RESTART;
else
return IApplication.EXIT_OK;
} finally {
display.dispose();
}
}
示例9: main
import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
public static void main(String[] args) {
// create a shell...
Display display = new Display();
Shell shell = new Shell(display);
shell.setLayout(new FillLayout());
shell.setText("KTable examples");
// put a tab folder in it...
TabFolder tabFolder = new TabFolder(shell, SWT.NONE);
// Item 1: a Text Table
TabItem item1 = new TabItem(tabFolder, SWT.NONE);
item1.setText("Text Table");
Composite comp1 = new Composite(tabFolder, SWT.NONE);
item1.setControl(comp1);
comp1.setLayout(new FillLayout());
// put a table in tabItem1...
KTable table = new KTable(comp1, SWT.V_SCROLL | SWT.H_SCROLL);
table.setRowSelectionMode(true);
//table.setMultiSelectionMode(true);
table.setModel(new KTableModelExample());
// display the shell...
shell.setSize(600, 600);
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
}
示例10: main
import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
public static void main(String[] args) {
// create a shell...
Display display = new Display();
Shell shell = new Shell(display);
shell.setLayout(new FillLayout());
shell.setText("KTable examples");
// put a tab folder in it...
TabFolder tabFolder = new TabFolder(shell, SWT.NONE);
// Item 1: a Text Table
TabItem item1 = new TabItem(tabFolder, SWT.NONE);
item1.setText("Text Table");
Composite comp1 = new Composite(tabFolder, SWT.NONE);
item1.setControl(comp1);
comp1.setLayout(new FillLayout());
// put a table in tabItem1...
KTable table = new KTable(comp1, SWT.V_SCROLL | SWT.H_SCROLL);
table.setRowSelectionMode(true);
//table.setMultiSelectionMode(true);
table.setModel(new KTableModelExample());
// display the shell...
shell.setSize(600, 600);
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
}
示例11: AvoCADo
import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
public AvoCADo(){
display = new Display();
// splash screen.. loads before openGL is needed
// since that can take a few seconds. This gives
// more immediate feedback that the app has started.
new StartupSplashShell(display);
// create the main shell and display it
new MainAvoCADoShell(display);
display.dispose();
}
示例12: main
import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
public static void main(String[] args) {
display = new Display();
SimpleToolBarEx simpleToolBarEx = new SimpleToolBarEx();
simpleToolBarEx.setCodeGenImage("code_128.png");
simpleToolBarEx.open(display);
simpleToolBarEx.finalize();
display.dispose();
}
示例13: main
import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
public static void main(final String[] args) {
final Display display = new Display();
final Shell shell = new Shell(display);
Locale.setDefault(Locale.ENGLISH);
final TipDayEx tipDayEx = new TipDayEx();
String yamlFile = String.format("%s/src/main/resources/%s",
System.getProperty("user.dir"), "help.yaml");
help = YamlHelper.loadHelp(yamlFile);
for (Entry<String, String> helpdata : help.entrySet()) {
String title = helpdata.getKey();
String description = helpdata.getValue();
tipDayEx.addTip(String.format("<h4>%s</h4>%s", title, description));
}
if (tipDayEx.getTips().size() == 0) {
for (String tipMessage : new String[] { "This is the first tip",
"This is the second tip", "This is the third tip",
"This is the forth tip", "This is the fifth tip" }) {
tipDayEx.addTip(String.format(
"<h4>%s</h4>" + "<b>%s</b> " + "<u>%s</u> " + "<i>%s</i> " + "%s "
+ "%s<br/>" + "<p color=\"#A00000\">%s</p>",
tipMessage, tipMessage, tipMessage, tipMessage, tipMessage,
tipMessage, tipMessage));
}
}
tipDayEx.open(shell, display);
display.dispose();
}
示例14: start
import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
public Object start(IApplicationContext context) throws Exception {
Display display = PlatformUI.createDisplay();
Shell shell = WorkbenchPlugin.getSplashShell(display);
if (OSValidator.isWindows() && !PreStartActivity.isDevLaunchMode(context.getArguments())) {
PreStartActivity activity = new PreStartActivity(shell);
if (ToolProvider.getSystemJavaCompiler() == null) {
activity.performPreStartActivity();
} else {
activity.updateINIOnJDkUpgrade();
}
}
try {
Object instanceLocationCheck = checkInstanceLocation(shell, context.getArguments());
if (instanceLocationCheck != null) {
WorkbenchPlugin.unsetSplashShell(display);
context.applicationRunning();
return instanceLocationCheck;
}
int returnCode = PlatformUI.createAndRunWorkbench(display, new ApplicationWorkbenchAdvisor());
if (returnCode == PlatformUI.RETURN_RESTART)
return IApplication.EXIT_RESTART;
else
return IApplication.EXIT_OK;
} finally {
if (display != null) {
display.dispose();
}
Location instanceLoc = Platform.getInstanceLocation();
if (instanceLoc != null){
instanceLoc.release();
}
}
}
示例15: main
import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
public static void main(String args[]) {
Display display = new Display();
final SplashWindow splash = new SplashWindow(display);
Thread t = new Thread() {
@Override
public void run() {
try {
int percent = 0;
while (percent <= 100) {
splash.reportPercent(percent++);
splash.reportCurrentTask(percent
+ "% Loading dbnvsudn vjksfdh fgshdu fbhsduh bvsfd fbsd fbvsdb fsuid opnum supnum boopergood haha text doot subliminal.".substring(
0, (int) (1 + Math.random() * 110)));
Thread.sleep(100);
}
} catch (Exception e) {
// TODO: handle exception
}
splash.closeSplash();
}
};
t.start();
while (!splash.splash.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
display.dispose();
}