當前位置: 首頁>>代碼示例>>Java>>正文


Java Shell.setCursor方法代碼示例

本文整理匯總了Java中org.eclipse.swt.widgets.Shell.setCursor方法的典型用法代碼示例。如果您正苦於以下問題:Java Shell.setCursor方法的具體用法?Java Shell.setCursor怎麽用?Java Shell.setCursor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.swt.widgets.Shell的用法示例。


在下文中一共展示了Shell.setCursor方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: run

import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
public void run() {
	Display display = Display.getDefault();
	Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);		
	
	Shell shell = getParentShell();
	shell.setCursor(waitCursor);
	
       try {
       	DatabaseObjectFindDialog dofd = new DatabaseObjectFindDialog(shell);
       	dofd.open();
       }
       catch (Throwable e) {
       	ConvertigoPlugin.logException(e, "Unable to find objects in projects treeview!");
       }
       finally {
		shell.setCursor(null);
		waitCursor.dispose();
       }
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:20,代碼來源:ProjectExplorerFindAction.java

示例2: run

import org.eclipse.swt.widgets.Shell; //導入方法依賴的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)
   			explorerView.unloadSelectedProjectTreeObject();
	}
	catch (Throwable e) {
		ConvertigoPlugin.logException(e, "Unable to close the project!");
	}
       finally {
		shell.setCursor(null);
		waitCursor.dispose();
       }
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:21,代碼來源:ProjectCloseAction.java

示例3: run

import org.eclipse.swt.widgets.Shell; //導入方法依賴的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)
   			explorerView.renameSelectedTreeObject();
	}
	catch (Throwable e) {
		ConvertigoPlugin.logException(e, "Unable to rename the "+ type +"!");
	}
       finally {
		shell.setCursor(null);
		waitCursor.dispose();
       }
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:21,代碼來源:TreeObjectRenameAction.java

示例4: run

import org.eclipse.swt.widgets.Shell; //導入方法依賴的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) {
			Object treeObject = explorerView.getFirstSelectedTreeObject();
			((IEditableTreeObject) treeObject).launchEditor(null);
		}
	} catch (Throwable e) {
		ConvertigoPlugin.logException(e, "Unable to edit the sheet!");
	} finally {
		shell.setCursor(null);
		waitCursor.dispose();
	}
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:21,代碼來源:SheetEditAction.java

示例5: run

import org.eclipse.swt.widgets.Shell; //導入方法依賴的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 TestCase)) {
   				TestCase testCase = (TestCase)databaseObject;
   				testCase.importRequestableVariables((RequestableObject)testCase.getParent());
   				if (testCase.hasChanged) {
   					explorerView.reloadTreeObject(treeObject);
					StructuredSelection structuredSelection = new StructuredSelection(treeObject);
					ConvertigoPlugin.getDefault().getPropertiesView().selectionChanged((IWorkbenchPart)explorerView, structuredSelection);
   				}
   			}
   		}
       }
       catch (Throwable e) {
       	ConvertigoPlugin.logException(e, "Unable to add requestable variables to test case!");
       }
       finally {
		shell.setCursor(null);
		waitCursor.dispose();
       }
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:32,代碼來源:TestCaseImportRequestableVariablesAction.java

示例6: run

import org.eclipse.swt.widgets.Shell; //導入方法依賴的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 CouchDbConnector) {
   				CouchDbConnector connector = (CouchDbConnector)databaseObject;
   				connector.importCouchDbDesignDocuments();
   				if (connector.hasChanged) {
   					explorerView.reloadTreeObject(treeObject);
   					explorerView.setSelectedTreeObject(treeObject);
   				}
   			}
   		}
       }
       catch (Throwable e) {
       	ConvertigoPlugin.logException(e, "Unable to import design documents from CouchDB database!");
       }
       finally {
		shell.setCursor(null);
		waitCursor.dispose();
       }
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:31,代碼來源:ImportDesignDocumentsFromDatabaseAction.java

示例7: run

import org.eclipse.swt.widgets.Shell; //導入方法依賴的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;
   			Statement statement = null;
   			
   			TreeObject[] treeObjects = explorerView.getSelectedTreeObjects();
			for (int i = treeObjects.length-1 ; i>=0  ; i--) {
				treeObject = (DatabaseObjectTreeObject) treeObjects[i];
				if (treeObject instanceof StatementTreeObject) {
					StatementTreeObject statementTreeObject = (StatementTreeObject)treeObject;
					statement = (Statement)statementTreeObject.getObject();
					statement.setEnabled(false);
					
					statementTreeObject.setEnabled(false);
					statementTreeObject.hasBeenModified(true);				
				}
			}
			
			explorerView.refreshSelectedTreeObjects();
   		}
       }
       catch (Throwable e) {
       	ConvertigoPlugin.logException(e, "Unable to disable statement!");
       }
       finally {
		shell.setCursor(null);
		waitCursor.dispose();
       }
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:38,代碼來源:DisableStatementAction.java

示例8: run

import org.eclipse.swt.widgets.Shell; //導入方法依賴的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) {
   			String sXml;
   			if (explorerView.isEditing()) {
   				sXml = explorerView.getEditingText();
   				explorerView.setEditingText("");
   			}
   			else {
    			// copy to clipboard manager
   				sXml = cut(explorerView);
   			}
   			
  				// copy to system clipboard
   			if (sXml != null) {
      				Clipboard clipboard = new Clipboard(display);
      				TextTransfer textTransfer = TextTransfer.getInstance();
      				clipboard.setContents(new String[]{sXml}, new Transfer[]{textTransfer});
      				clipboard.dispose();
   			}
   		}
	}
	catch (Throwable e) {
		ConvertigoPlugin.logException(e, "Unable to cut!");
	}
       finally {
		shell.setCursor(null);
		waitCursor.dispose();
       }
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:38,代碼來源:ClipboardCutAction.java

示例9: run

import org.eclipse.swt.widgets.Shell; //導入方法依賴的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;
   			Step step = null;
   			
   			TreeObject[] treeObjects = explorerView.getSelectedTreeObjects();
			for (int i = treeObjects.length-1 ; i>=0  ; i--) {
				treeObject = (DatabaseObjectTreeObject) treeObjects[i];
				if (treeObject instanceof StepTreeObject) {
					StepTreeObject stepTreeObject = (StepTreeObject)treeObject;
					step = (Step)stepTreeObject.getObject();
					step.setEnabled(false);
					
					stepTreeObject.setEnabled(false);
					stepTreeObject.hasBeenModified(true);
	                
	                TreeObjectEvent treeObjectEvent = new TreeObjectEvent(stepTreeObject, "isEnable", true, false);
	                explorerView.fireTreeObjectPropertyChanged(treeObjectEvent);
				}
			}
			
			explorerView.refreshSelectedTreeObjects();
   		}
       }
       catch (Throwable e) {
       	ConvertigoPlugin.logException(e, "Unable to disable step!");
       }
       finally {
		shell.setCursor(null);
		waitCursor.dispose();
       }
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:41,代碼來源:DisableStepAction.java

示例10: run

import org.eclipse.swt.widgets.Shell; //導入方法依賴的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

示例11: run

import org.eclipse.swt.widgets.Shell; //導入方法依賴的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 RequestableStep)) {
   				RequestableStep requestableStep = (RequestableStep)databaseObject;
   				requestableStep.exportVariableDefinition();
   				
   				Sequence sequence = requestableStep.getSequence();
   				if (sequence.hasChanged) {
   					SequenceTreeObject sequenceTreeObject = (SequenceTreeObject) explorerView.findTreeObjectByUserObject(sequence);
   					explorerView.reloadTreeObject(sequenceTreeObject);
   					explorerView.setSelectedTreeObject(sequenceTreeObject);
					StructuredSelection structuredSelection = new StructuredSelection(sequenceTreeObject);
					ConvertigoPlugin.getDefault().getPropertiesView().selectionChanged((IWorkbenchPart)explorerView, structuredSelection);
   				}
   			}
   		}
       }
       catch (Throwable e) {
       	ConvertigoPlugin.logException(e, "Unable to export step variables to main sequence!");
       }
       finally {
		shell.setCursor(null);
		waitCursor.dispose();
       }
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:36,代碼來源:StepExportVariablesToSequenceAction.java

示例12: run

import org.eclipse.swt.widgets.Shell; //導入方法依賴的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;
   			RouteEventComponent component = null;
   			
   			TreeObject[] treeObjects = explorerView.getSelectedTreeObjects();
			for (int i = treeObjects.length-1 ; i>=0  ; i--) {
				treeObject = (DatabaseObjectTreeObject) treeObjects[i];
				if (treeObject instanceof MobileRouteEventComponentTreeObject) {
					MobileRouteEventComponentTreeObject componentTreeObject = (MobileRouteEventComponentTreeObject)treeObject;
					component = (RouteEventComponent)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 event!");
       }
       finally {
		shell.setCursor(null);
		waitCursor.dispose();
       }
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:41,代碼來源:DisableMobileRouteEventComponentAction.java

示例13: run

import org.eclipse.swt.widgets.Shell; //導入方法依賴的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;
   			RouteEventComponent component = null;
   			
   			TreeObject[] treeObjects = explorerView.getSelectedTreeObjects();
			for (int i = treeObjects.length-1 ; i>=0  ; i--) {
				treeObject = (DatabaseObjectTreeObject) treeObjects[i];
				if (treeObject instanceof MobileRouteEventComponentTreeObject) {
					MobileRouteEventComponentTreeObject componentTreeObject = (MobileRouteEventComponentTreeObject)treeObject;
					component = (RouteEventComponent)componentTreeObject.getObject();
					component.setEnabled(true);
					
					componentTreeObject.setEnabled(true);
					componentTreeObject.hasBeenModified(true);
	                
	                TreeObjectEvent treeObjectEvent = new TreeObjectEvent(componentTreeObject, "isEnabled", false, true);
	                explorerView.fireTreeObjectPropertyChanged(treeObjectEvent);
				}
			}
			
			explorerView.refreshSelectedTreeObjects();
   		}
       }
       catch (Throwable e) {
       	ConvertigoPlugin.logException(e, "Unable to enable event!");
       }
       finally {
		shell.setCursor(null);
		waitCursor.dispose();
       }
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:41,代碼來源:EnableMobileRouteEventComponentAction.java

示例14: run

import org.eclipse.swt.widgets.Shell; //導入方法依賴的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 SequenceStep)) {
   				SequenceStep sequenceStep = (SequenceStep)databaseObject;
   				sequenceStep.importVariableDefinition();
   				if (sequenceStep.hasChanged) {
   					explorerView.reloadTreeObject(treeObject);
					StructuredSelection structuredSelection = new StructuredSelection(treeObject);
					ConvertigoPlugin.getDefault().getPropertiesView().selectionChanged((IWorkbenchPart)explorerView, structuredSelection);
   				}
   			}
   		}
       }
       catch (Throwable e) {
       	ConvertigoPlugin.logException(e, "Unable to add sequence variables to step!");
       }
       finally {
		shell.setCursor(null);
		waitCursor.dispose();
       }
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:32,代碼來源:StepImportSequenceVariablesAction.java

示例15: createBapiTransactions

import org.eclipse.swt.widgets.Shell; //導入方法依賴的package包/類
private void createBapiTransactions(final TableItem[] items)
{
	Display display = Display.getDefault();
	Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);		
	Shell shell = display.getActiveShell();
	if (shell != null) {
		try {
			shell.setCursor(waitCursor);
			
			for (int i=0; i < items.length; i++) {
				TableItem item = items[i];
				String bapiName = item.getText(0);
				String bapiDesc = item.getText(1);
				ConvertigoPlugin.logDebug("Creating transaction for BAPI '"+bapiName+"' ...");
				sapConnector.removeSerializedData(bapiName);
				SapJcoTransaction sapJcoTransaction = SapJcoConnector.createSapJcoTransaction(sapConnector, bapiName);
				if (sapJcoTransaction != null) {
					Transaction transaction = sapConnector.getTransactionByName(bapiName);
					if (transaction != null) {
						try {
							File xsdFile = new File(transaction.getSchemaFilePath());
							if (xsdFile.exists()) {
								xsdFile.delete();
							}
						}
						catch (Exception e) {}
						sapConnector.remove(transaction);			
					}
					sapJcoTransaction.setComment(bapiDesc);
					sapConnector.add(sapJcoTransaction);
					fireObjectChanged(new CompositeEvent(sapConnector));
					ConvertigoPlugin.logDebug("Transaction added.");
				}
			}
		} catch (Exception ee) {
			ConvertigoPlugin.logException(ee, "Error while creating transaction(s)");
		} finally {
			shell.setCursor(null);
			waitCursor.dispose();
		}
	}
	
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:44,代碼來源:SapJcoConnectorDesignComposite.java


注:本文中的org.eclipse.swt.widgets.Shell.setCursor方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。