当前位置: 首页>>代码示例>>Java>>正文


Java Display.dispose方法代码示例

本文整理汇总了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;
}
 
开发者ID:EnFlexIT,项目名称:AgentWorkbench,代码行数:30,代码来源:PlugInApplication.java

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

}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:23,代码来源:Application.java

示例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();
  }
 
开发者ID:TRUEJASONFANS,项目名称:JavaFX-FrameRateMeter,代码行数:21,代码来源:SWTTestUtil.java

示例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 ();
}
 
开发者ID:AppleCommander,项目名称:AppleCommander,代码行数:18,代码来源:Sleak.java

示例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();
}
 
开发者ID:sergueik,项目名称:SWET,代码行数:20,代码来源:TipDayEx.java

示例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();
}
 
开发者ID:Thizzer,项目名称:JTouchBar,代码行数:24,代码来源:JTouchBarSWTTest.java

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

}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:23,代码来源:Application.java

示例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();
	}
	
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:14,代码来源:Application.java

示例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();
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:33,代码来源:SWTX.java

示例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();
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:33,代码来源:KTable.java

示例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();
}
 
开发者ID:avoCADo-3d,项目名称:avoCADo,代码行数:14,代码来源:AvoCADo.java

示例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();
}
 
开发者ID:sergueik,项目名称:SWET,代码行数:11,代码来源:SimpleToolBarEx.java

示例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();
}
 
开发者ID:sergueik,项目名称:SWET,代码行数:31,代码来源:TipDayEx.java

示例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();
		}
	}
	
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:36,代码来源:Application.java

示例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();
}
 
开发者ID:BiglySoftware,项目名称:BiglyBT,代码行数:33,代码来源:SplashWindow.java


注:本文中的org.eclipse.swt.widgets.Display.dispose方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。