本文整理匯總了Java中org.eclipse.ui.PlatformUI.createDisplay方法的典型用法代碼示例。如果您正苦於以下問題:Java PlatformUI.createDisplay方法的具體用法?Java PlatformUI.createDisplay怎麽用?Java PlatformUI.createDisplay使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.ui.PlatformUI
的用法示例。
在下文中一共展示了PlatformUI.createDisplay方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: startEclipseUI
import org.eclipse.ui.PlatformUI; //導入方法依賴的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.ui.PlatformUI; //導入方法依賴的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: start
import org.eclipse.ui.PlatformUI; //導入方法依賴的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 ();
}
}
示例4: start
import org.eclipse.ui.PlatformUI; //導入方法依賴的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();
}
}
示例5: start
import org.eclipse.ui.PlatformUI; //導入方法依賴的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();
}
}
}
示例6: getImageFromLocal
import org.eclipse.ui.PlatformUI; //導入方法依賴的package包/類
public static Image getImageFromLocal(String imageFilePath){
if(imageMap.containsKey(imageFilePath)){
return imageMap.get(imageFilePath);
}else{
Image image=new Image(PlatformUI.createDisplay(),imageFilePath);
imageMap.put(imageFilePath, image);
return image;
}
}