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


Java Display.getDefault方法代码示例

本文整理汇总了Java中org.eclipse.swt.widgets.Display.getDefault方法的典型用法代码示例。如果您正苦于以下问题:Java Display.getDefault方法的具体用法?Java Display.getDefault怎么用?Java Display.getDefault使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.swt.widgets.Display的用法示例。


在下文中一共展示了Display.getDefault方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: show

import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
/**
 * Build and show the Windows, dispose it after is is not longer needed.
 *
 * @throws IllegalStateException If the parent shell is unusable (null or disposed).
 */
public void show() {
	try {
		this.display = Display.getDefault();
		createShell();
		this.shell.open();

		while (!this.shell.isDisposed()) {
			if (!this.display.readAndDispatch())
				this.display.sleep();
			}
	} catch (Throwable t) {
		if (this.parentShell != null && !this.parentShell.isDisposed()) {
			StaticGuiSupport.processGuiError(t, "log", this.parentShell);
		}
	} finally {
		doExit();
	}
}
 
开发者ID:wwu-pi,项目名称:tap17-muggl-javaee,代码行数:24,代码来源:LogWindow.java

示例2: openChat

import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
@Override
public void
openChat(
	final ChatInstance chat )
{
	final Display display = Display.getDefault();

	if ( display.isDisposed()){

		return;
	}

	display.asyncExec(
		new Runnable()
		{
			@Override
			public void
			run()
			{
				if ( display.isDisposed()){

					return;
				}

				BuddyPluginViewBetaChat.createChatWindow( BuddyPluginView.this, plugin, chat );
			}
		});
}
 
开发者ID:BiglySoftware,项目名称:BiglyBT,代码行数:29,代码来源:BuddyPluginView.java

示例3: run

import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
public void run() {
	Display display = Display.getDefault();
	Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);		
	
	Shell shell = getParentShell();
	shell.setCursor(waitCursor);
	
       try {
   		ProjectExplorerView explorerView = getProjectExplorerView();
   		if (explorerView != null) {
   			TreeObject treeObject = explorerView.getFirstSelectedTreeObject();
   			if (treeObject instanceof MobileComponentTreeObject) {
   				if (treeObject instanceof MobileApplicationComponentTreeObject) {
   					MobileApplicationComponentTreeObject mpcto = (MobileApplicationComponentTreeObject) treeObject;
   					ApplicationComponentEditor editor = mpcto.activeEditor(false);
   					editor.launchBuilder(forceInstall, forceClean);
   				}
   			}
   		}
       }
       catch (Throwable e) {
       	ConvertigoPlugin.logException(e, "Unable to open the mobile builder!");
       }
       finally {
		shell.setCursor(null);
		waitCursor.dispose();
       }
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:29,代码来源:ExecuteMobileBuilderClassAction.java

示例4: run

import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
@Override
public void run() {
	Display display = Display.getDefault();
	Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);		
	
	Shell shell = getParentShell();
	shell.setCursor(waitCursor);
	
       try {
   		ProjectExplorerView explorerView = getProjectExplorerView();
   		if (explorerView != null) {
   			TreeObject treeObject = explorerView.getFirstSelectedTreeObject();
   			if ((treeObject != null) && (treeObject instanceof TransactionTreeObject)) {
   				TransactionTreeObject transactionTreeObject = (TransactionTreeObject)treeObject;
   				
   				Transaction transaction = transactionTreeObject.getObject();
   				transactionTreeObject.getConnectorTreeObject().openConnectorEditor();
   				
   				Connector connector = (Connector)transaction.getParent();
   				ProjectTreeObject projectTreeObject = transactionTreeObject.getProjectTreeObject();
   				ConnectorEditor connectorEditor = projectTreeObject.getConnectorEditor(connector);
   				if (connectorEditor != null) {
   					getActivePage().activate(connectorEditor);
   					connectorEditor.getDocument(transaction.getName(), isStubRequested());
   				}
   			}
   		}
       }
       catch (Throwable e) {
       	ConvertigoPlugin.logException(e, "Unable to execute the selected transaction!");
       }
       finally {
		shell.setCursor(null);
		waitCursor.dispose();
       }
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:37,代码来源:TransactionExecuteSelectedAction.java

示例5: run

import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
public void run() {
	Display display = Display.getDefault();
	Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);		
	
	Shell shell = getParentShell();
	shell.setCursor(waitCursor);
	
       try {
   		ProjectExplorerView explorerView = getProjectExplorerView();
   		if (explorerView != null) {
   			DatabaseObjectTreeObject treeObject = null;
   			Listener listener = null;
   			
   			TreeObject[] treeObjects = explorerView.getSelectedTreeObjects();
			for (int i = treeObjects.length-1 ; i>=0  ; i--) {
				treeObject = (DatabaseObjectTreeObject) treeObjects[i];
				if (treeObject instanceof ListenerTreeObject) {
					ListenerTreeObject listenerTreeObject = (ListenerTreeObject)treeObject;
					listener = (Listener)listenerTreeObject.getObject();
					listener.setEnabled(true);
					
					listenerTreeObject.setEnabled(true);
					listenerTreeObject.hasBeenModified(true);
					
	                // Updating the tree
	                explorerView.refreshTreeObject(listenerTreeObject);
				}
			}
   		}
       }
       catch (Throwable e) {
       	ConvertigoPlugin.logException(e, "Unable to enable listener!");
       }
       finally {
		shell.setCursor(null);
		waitCursor.dispose();
       }
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:39,代码来源:EnableListenerAction.java

示例6: run

import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
public void run() {
	Display display = Display.getDefault();
	Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);		
	
	Shell shell = getParentShell();
	shell.setCursor(waitCursor);
	
       try {
   		ProjectExplorerView explorerView = getProjectExplorerView();
   		if (explorerView != null) {
   			DatabaseObjectTreeObject treeObject = null;
   			PageComponent component = null;
   			
   			TreeObject[] treeObjects = explorerView.getSelectedTreeObjects();
			for (int i = treeObjects.length-1 ; i>=0  ; i--) {
				treeObject = (DatabaseObjectTreeObject) treeObjects[i];
				if (treeObject instanceof MobilePageComponentTreeObject) {
					MobilePageComponentTreeObject componentTreeObject = (MobilePageComponentTreeObject)treeObject;
					component = (PageComponent)componentTreeObject.getObject();
					component.setEnabled(false);
					
					componentTreeObject.setEnabled(false);
					componentTreeObject.hasBeenModified(true);
	                
	                TreeObjectEvent treeObjectEvent = new TreeObjectEvent(componentTreeObject, "isEnabled", true, false);
	                explorerView.fireTreeObjectPropertyChanged(treeObjectEvent);
				}
			}
			
			explorerView.refreshSelectedTreeObjects();
   		}
       }
       catch (Throwable e) {
       	ConvertigoPlugin.logException(e, "Unable to disable page!");
       }
       finally {
		shell.setCursor(null);
		waitCursor.dispose();
       }
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:41,代码来源:DisableMobilePageComponentAction.java

示例7: showPaletteToolTip

import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
/**
 * 
 * Show tooltip
 * 
 * @param toolTipMessage - text message to be display on tooltip
 */
private void showPaletteToolTip(String toolTipMessage) {
	paletteToolTip = new PaletteToolTip(Display.getDefault());
	java.awt.Point mouseLocation = MouseInfo.getPointerInfo().getLocation();
	paletteToolTip.setLocation(mouseLocation.x + 11 , mouseLocation.y +7);
	paletteToolTip.setToolTipText(toolTipMessage);
	paletteToolTip.setVisible(true);
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:14,代码来源:PaletteContainerListener.java

示例8: run

import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
public void run() {
	Display display = Display.getDefault();
	Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);		
	
	Shell shell = getParentShell();
	shell.setCursor(waitCursor);
	
       try {
   		ProjectExplorerView explorerView = getProjectExplorerView();
   		if (explorerView != null) {
   			ProjectTreeObject projectTreeObject = (ProjectTreeObject)explorerView.getFirstSelectedTreeObject();
   			if (projectTreeObject != null) {
   				StatisticsDialog stats = new StatisticsDialog(shell, 
   						projectTreeObject.getName(), projectTreeObject.getObject().getComment(), 
   						projectTreeObject.getObject().getVersion());
   			
   				stats.open();
   			}
   		}
       }
       catch (Throwable e) {
       	ConvertigoPlugin.logException(e, "Unable to compute statistics!");
       }
       finally {
		shell.setCursor(null);
		waitCursor.dispose();
       }
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:29,代码来源:CustomStatisticsAction.java

示例9: run

import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
public void run() {
	Display display = Display.getDefault();
	Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);		
	
	Shell shell = getParentShell();
	shell.setCursor(waitCursor);
	
       try {
   		ProjectExplorerView explorerView = getProjectExplorerView();
   		if (explorerView != null) {
   			TreeObject treeObject = explorerView.getFirstSelectedTreeObject();
   			Object databaseObject = treeObject.getObject();

   			if ((databaseObject != null) && (databaseObject instanceof Project)) {
   				Project project = (Project)treeObject.getObject();
   				Program.launch(
   						EnginePropertiesManager.PropertyName.APPLICATION_SERVER_CONVERTIGO_URL.getDefaultValue()+"/projects/" + project.getName());
   			}
   		}
       	
       }
       catch (Throwable e) {
       	ConvertigoPlugin.logException(e, "Unable to open the selected project!");
       }
       finally {
		shell.setCursor(null);
		waitCursor.dispose();
       }
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:30,代码来源:OpenProjectTestPlatformAction.java

示例10: show

import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
/**
 * Build and show the Windows, dispose it after is is not longer needed.
 * @param parentShell The parent windows' Shell.
 * @param classLoader The system MugglClassLoader.
 * @param classFile The classFile the initial Method belongs to.
 * @param method The initial Method.
 */
public void show(Shell parentShell, MugglClassLoader classLoader, ClassFile classFile, Method method) {
	try {
		this.parentShell = parentShell;
		this.display = Display.getDefault();
		if (createShell(parentShell, classLoader, classFile, method))
		this.shell.open();

		// Now make the parent shell invisible.
		parentShell.setVisible(false);

		// Keep the window alive.
		while (!this.shell.isDisposed()) {
			if (!this.display.readAndDispatch())
				this.display.sleep();
			}
	} catch (Throwable t) {
		StaticGuiSupport.processGuiError(t, "step by step execution", parentShell);
	} finally {
		// Make the parent shell visible.
		if (!parentShell.isDisposed())
			parentShell.setVisible(true);

		// Make sure execution is aborted. Otherwise the Thread would not be stopped and the memory released after this window is closed.
		if (this.executionComposite != null) this.executionComposite.abortExecution();
		doExit();
	}
}
 
开发者ID:wwu-pi,项目名称:tap17-muggl-javaee,代码行数:35,代码来源:ExecutionWindow.java

示例11: run

import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
public void run() {
	Display display = Display.getDefault();
	Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);		
	
	Shell shell = getParentShell();
	shell.setCursor(waitCursor);
	
       try {
   		ProjectExplorerView explorerView = getProjectExplorerView();
   		if (explorerView != null) {
   			DesignDocumentTreeObject ddto = (DesignDocumentTreeObject)explorerView.getFirstSelectedTreeObject();
   			DesignDocumentViewTreeObject ddvto = ddto.addNewView();
   			if (ddto.hasChanged()) {
				TreeParent treeParent = ddto.getParent();
				if (treeParent instanceof FolderTreeObject)
					treeParent = treeParent.getParent();
				explorerView.objectChanged(new CompositeEvent(treeParent.getObject(),ddvto.getPath()));
   			}
   		}
       }
       catch (Throwable e) {
       	ConvertigoPlugin.logException(e, "Unable to create a new view!");
       }
       finally {
		shell.setCursor(null);
		waitCursor.dispose();
       }
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:29,代码来源:CreateDesignDocumentViewAction.java

示例12: run

import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
public void run() {
	Display display = Display.getDefault();
	Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);		
	
	Shell shell = getParentShell();
	shell.setCursor(waitCursor);
	
       try {
   		ProjectExplorerView explorerView = getProjectExplorerView();
   		if (explorerView != null) {
   			DatabaseObjectTreeObject treeObject = null;
   			RouteActionComponent component = null;
   			
   			TreeObject[] treeObjects = explorerView.getSelectedTreeObjects();
			for (int i = treeObjects.length-1 ; i>=0  ; i--) {
				treeObject = (DatabaseObjectTreeObject) treeObjects[i];
				if (treeObject instanceof MobileRouteActionComponentTreeObject) {
					MobileRouteActionComponentTreeObject componentTreeObject = (MobileRouteActionComponentTreeObject)treeObject;
					component = (RouteActionComponent)componentTreeObject.getObject();
					component.setEnabled(false);
					
					componentTreeObject.setEnabled(false);
					componentTreeObject.hasBeenModified(true);
	                
	                TreeObjectEvent treeObjectEvent = new TreeObjectEvent(componentTreeObject, "isEnabled", true, false);
	                explorerView.fireTreeObjectPropertyChanged(treeObjectEvent);
				}
			}
			
			explorerView.refreshSelectedTreeObjects();
   		}
       }
       catch (Throwable e) {
       	ConvertigoPlugin.logException(e, "Unable to disable action!");
       }
       finally {
		shell.setCursor(null);
		waitCursor.dispose();
       }
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:41,代码来源:DisableMobileRouteActionComponentAction.java

示例13: run

import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
public void run() {
	Display display = Display.getDefault();
	Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);		
	
	Shell shell = getParentShell();
	shell.setCursor(waitCursor);
	
       try {
   		ProjectExplorerView explorerView = getProjectExplorerView();
   		if (explorerView != null) {
   			DatabaseObjectTreeObject treeObject = null;
   			RouteComponent component = null;
   			
   			TreeObject[] treeObjects = explorerView.getSelectedTreeObjects();
			for (int i = treeObjects.length-1 ; i>=0  ; i--) {
				treeObject = (DatabaseObjectTreeObject) treeObjects[i];
				if (treeObject instanceof MobileRouteComponentTreeObject) {
					MobileRouteComponentTreeObject componentTreeObject = (MobileRouteComponentTreeObject)treeObject;
					component = (RouteComponent)componentTreeObject.getObject();
					component.setEnabled(false);
					
					componentTreeObject.setEnabled(false);
					componentTreeObject.hasBeenModified(true);
	                
	                TreeObjectEvent treeObjectEvent = new TreeObjectEvent(componentTreeObject, "isEnabled", true, false);
	                explorerView.fireTreeObjectPropertyChanged(treeObjectEvent);
				}
			}
			
			explorerView.refreshSelectedTreeObjects();
   		}
       }
       catch (Throwable e) {
       	ConvertigoPlugin.logException(e, "Unable to disable route!");
       }
       finally {
		shell.setCursor(null);
		waitCursor.dispose();
       }
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:41,代码来源:DisableMobileRouteComponentAction.java

示例14: run

import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
@Override
public void run() {
	Display display = Display.getDefault();
	Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);		
	Shell shell = getParentShell();
	shell.setCursor(waitCursor);
	
	try {
   		ProjectExplorerView explorerView = getProjectExplorerView();
   		if (explorerView != null) {
   			TreeObject treeObject = explorerView.getFirstSelectedTreeObject();
   			Object databaseObject = treeObject.getObject();

   			if ((databaseObject != null) && (databaseObject instanceof MobileApplication)) {
   				MobileApplication mobileApplication = (MobileApplication) databaseObject;
   				
   				// Test plateform
   				Program.launch(
   						EnginePropertiesManager.PropertyName.APPLICATION_SERVER_CONVERTIGO_URL.getDefaultValue()+"/project.html#" 
   								+ mobileApplication.getProject() + "?launch=webapp");
   			}
   		}
       	
       }
       catch (Throwable e) {
       	ConvertigoPlugin.logException(e, "Unable to launch the mobile device selected project!");
       }
       finally {
		shell.setCursor(null);
		waitCursor.dispose();
       }
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:33,代码来源:LaunchMobileApplicationProjectAction.java

示例15: run

import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
@Override
public void run() {
	Display display = Display.getDefault();
	Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);		
	
	Shell shell = getParentShell();
	shell.setCursor(waitCursor);
	
       try {
   		ProjectExplorerView explorerView = getProjectExplorerView();
   		if (explorerView != null) {
   			DatabaseObjectTreeObject treeObject = (DatabaseObjectTreeObject) explorerView.getFirstSelectedTreeObject();
   			DatabaseObject databaseObject = treeObject.getObject();
   			if ((databaseObject != null) && (databaseObject instanceof IfXpathExistsThenElseStatement)) {
   				IfXpathExistsThenElseStatement ifThenElseStatement = (IfXpathExistsThenElseStatement) databaseObject;
   				// IfXpathExistsThenElse statement
   				if (ifThenElseStatement.hasThenElseStatements()) {
					DatabaseObjectTreeObject parentTreeObject = treeObject.getOwnerDatabaseObjectTreeObject();
					
	        		if (parentTreeObject != null) {
   						// New IfXpathExistsStatement statement
	        			IfXpathExistsStatement ifStatement  = new IfXpathExistsStatement();
   						ifStatement.bNew = true;
   						ifStatement.hasChanged = true;
   						
   						// Add new If statement to parent
   						StatementWithExpressions parentDbo = (StatementWithExpressions) ifThenElseStatement.getParent();
   						parentDbo.addStatementAfter(ifStatement, ifThenElseStatement); 
   						
       					for (Statement statement: ifThenElseStatement.getThenStatement().getStatements()) {
       						ifStatement.addStatement(statement);
       					}
   						
   						// Set properties
   						ifStatement.setCondition(ifThenElseStatement.getCondition());
   						ifStatement.setComment(ifThenElseStatement.getComment());
   						ifStatement.setEnabled(ifThenElseStatement.isEnabled());
   						ifStatement.setVersion(ifThenElseStatement.getVersion());
   						
   						String name = ifThenElseStatement.getName();
   						
   		   				// Delete IfThenElse statement
   						ifThenElseStatement.delete();
   						
   						ifStatement.setName(name);
   						
	        			parentTreeObject.hasBeenModified(true);
		                explorerView.reloadTreeObject(parentTreeObject);
		                explorerView.setSelectedTreeObject(parentTreeObject.findTreeObjectByUserObject(ifStatement));
	        		}
   				}
   			}
   		}
       	
       }
       catch (Throwable e) {
       	ConvertigoPlugin.logException(e, "Unable to change statement to If statement!");
       }
       finally {
		shell.setCursor(null);
		waitCursor.dispose();
       }
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:64,代码来源:ChangeToIfXpathExistsStatementAction.java


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