當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。