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


Java Cursor類代碼示例

本文整理匯總了Java中org.eclipse.swt.graphics.Cursor的典型用法代碼示例。如果您正苦於以下問題:Java Cursor類的具體用法?Java Cursor怎麽用?Java Cursor使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: restoreDialog

import org.eclipse.swt.graphics.Cursor; //導入依賴的package包/類
private void restoreDialog(List<Application> list) {
    display.asyncExec(() -> { 
            composite.getParent().setCursor(new Cursor(display, SWT.CURSOR_ARROW));
            enableControls(true);
            if (list != null && ! list.isEmpty()) {
                applicationsList.addAll(list);
                currentAppBox.setItems(list.stream().map(Application::getName).toArray(size -> new String[size]));

            if (jsonConfig != null && !jsonConfig.isEmpty()) {
                JsonObject object = Json.createReader(new StringReader(jsonConfig)).readObject()
                        .getJsonObject("gluonCredentials");
                if (object != null) {
                    existingApp = list.stream()
                        .filter(app -> app.getIdentifier().equals(object.getString("applicationKey")) &&
                                app.getSecret().equals(object.getString("applicationSecret")))
                        .findFirst()
                        .orElse(null);
                    if (existingApp != null) {
                        currentAppBox.setText(existingApp.getName());
                    }
                }
            }
        }
    });
}
 
開發者ID:gluonhq,項目名稱:ide-plugins,代碼行數:26,代碼來源:ApplicationsSWT.java

示例2: run

import org.eclipse.swt.graphics.Cursor; //導入依賴的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

示例3: run

import org.eclipse.swt.graphics.Cursor; //導入依賴的package包/類
@Override
public void run(IAction action) {
	Display display = Display.getDefault();
	Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);		
	
	Shell shell = getParentShell();
	shell.setCursor(waitCursor);
	
       try {
		ImportWizard importWizard = new ImportWizard();
		importWizard.setWindowTitle("Convertigo project import Wizard");
   		WizardDialog wzdlg = new WizardDialog(shell, importWizard);
   		wzdlg.open();
       }
       catch (Throwable e) {
       	ConvertigoPlugin.logException(e, "Unable to import project!");
       }
       finally {
		shell.setCursor(null);
		waitCursor.dispose();
       }
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:23,代碼來源:ProjectExplorerImportAction.java

示例4: run

import org.eclipse.swt.graphics.Cursor; //導入依賴的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();
			if (treeObject instanceof TransactionTreeObject)
				((IEditableTreeObject) treeObject).launchEditor("JscriptTransactionEditor");
		}
	} catch (Throwable e) {
		ConvertigoPlugin.logException(e, "Unable to edit the transaction!");
	} finally {
		shell.setCursor(null);
		waitCursor.dispose();
	}
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:22,代碼來源:TransactionEditHandlersAction.java

示例5: setPropertyHelpText

import org.eclipse.swt.graphics.Cursor; //導入依賴的package包/類
private void setPropertyHelpText() {
	if(ShowHidePropertyHelpHandler.getInstance() != null 
			&& ShowHidePropertyHelpHandler.getInstance().isShowHidePropertyHelpChecked()){
		noOfPartitionsLabel.setToolTipText(Messages.NUMBER_OF_PARTITIONS);
		noOfPartitionsLabel.setCursor(new Cursor(noOfPartitionsLabel.getDisplay(), SWT.CURSOR_HELP));
		
		partitionKeysLabel.setToolTipText(Messages.PARTITONS_KEY);
		partitionKeysLabel.setCursor(new Cursor(partitionKeysLabel.getDisplay(), SWT.CURSOR_HELP));
		
		partitionKeyUpperBoundLabel.setToolTipText(Messages.UPPER_BOUND_LABEL);
		partitionKeyUpperBoundLabel.setCursor(new Cursor(partitionKeyUpperBoundLabel.getDisplay(), SWT.CURSOR_HELP));
		
		partitionKeyLowerBoundLabel.setToolTipText(Messages.LOWER_BOUND_LABEL);
		partitionKeyLowerBoundLabel.setCursor(new Cursor(partitionKeyLowerBoundLabel.getDisplay(), SWT.CURSOR_HELP));
		
		fetchSizeLabel.setToolTipText(Messages.FETCH_SIZE_PARAM);
		fetchSizeLabel.setCursor(new Cursor(fetchSizeLabel.getDisplay(), SWT.CURSOR_HELP));
		
		additionalDBParametersLabel.setToolTipText(Messages.ADDITIONAL_DB_PARAMETER);
		additionalDBParametersLabel.setCursor(new Cursor(additionalDBParametersLabel.getDisplay(), SWT.CURSOR_HELP));
		}
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:23,代碼來源:InputAdditionalParametersDialog.java

示例6: refreshLabel

import org.eclipse.swt.graphics.Cursor; //導入依賴的package包/類
void refreshLabel () {
	int colors = 0, cursors = 0, fonts = 0, gcs = 0, images = 0, regions = 0;
	for (int i=0; i<objects.length; i++) {
		Object object = objects [i];
		if (object instanceof Color) colors++;
		if (object instanceof Cursor) cursors++;
		if (object instanceof Font) fonts++;
		if (object instanceof GC) gcs++;
		if (object instanceof Image) images++;
		if (object instanceof Region) regions++;
	}
	String string = ""; //$NON-NLS-1$
	if (colors != 0) string += colors + " Color(s)\n"; //$NON-NLS-1$
	if (cursors != 0) string += cursors + " Cursor(s)\n"; //$NON-NLS-1$
	if (fonts != 0) string += fonts + " Font(s)\n"; //$NON-NLS-1$
	if (gcs != 0) string += gcs + " GC(s)\n"; //$NON-NLS-1$
	if (images != 0) string += images + " Image(s)\n"; //$NON-NLS-1$
	if (regions != 0) string += regions + " Region(s)\n"; //$NON-NLS-1$
	if (string.length () != 0) {
		string = string.substring (0, string.length () - 1);
	}
	label.setText (string);
}
 
開發者ID:marvinmalkowskijr,項目名稱:applecommander,代碼行數:24,代碼來源:Sleak.java

示例7: run

import org.eclipse.swt.graphics.Cursor; //導入依賴的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) {
   			UndoManager undoManager = explorerView.getUndoManager();
   			undoManager.undo();
   		}
	}
	catch (Throwable e) {
		ConvertigoPlugin.logException(e, "Unable to undo the last action.");
	}
       finally {
		shell.setCursor(null);
		waitCursor.dispose();
       }
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:23,代碼來源:UndoAction.java

示例8: run

import org.eclipse.swt.graphics.Cursor; //導入依賴的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();
   			projectTreeObject.save(false);
   			
  				explorerView.refreshTree();
   		}
	}
	catch (Throwable e) {
		ConvertigoPlugin.logException(e, "Unable to save project");
	}
	finally {
		shell.setCursor(null);
		waitCursor.dispose();
       }
       
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:26,代碼來源:ProjectSaveAction.java

示例9: run

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

示例10: run

import org.eclipse.swt.graphics.Cursor; //導入依賴的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) {
   			TraceTreeObject traceTreeObject = (TraceTreeObject)explorerView.getFirstSelectedTreeObject();
   			traceTreeObject.launchEditor("TextEditor");
   		}
	}
	catch (Throwable e) {
		ConvertigoPlugin.logException(e, "Unable to edit the trace!");
	}
       finally {
		shell.setCursor(null);
		waitCursor.dispose();
       }
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:23,代碼來源:TraceEditAction.java

示例11: disposeCursors

import org.eclipse.swt.graphics.Cursor; //導入依賴的package包/類
/**
 * Dispose all of the cached cursors.
 */
public static void disposeCursors() {
	for (Cursor cursor : m_idToCursorMap.values()) {
		cursor.dispose();
	}
	m_idToCursorMap.clear();
}
 
開發者ID:nbfontana,項目名稱:pdi,代碼行數:10,代碼來源:SWTResourceManager.java

示例12: restoreDialog

import org.eclipse.swt.graphics.Cursor; //導入依賴的package包/類
private void restoreDialog(List<String> functionsList) {
    display.asyncExec(() -> { 
        composite.getParent().setCursor(new Cursor(display, SWT.CURSOR_ARROW));
        enableControls(true);
        if (functionsList == null || functionsList.isEmpty()) {
            errorLabel.setVisible(true);
        } else {
            functionsBox.setItems(functionsList.stream().toArray(size -> new String[size]));
            errorLabel.setVisible(false);
        }
        getButton(IDialogConstants.OK_ID).setEnabled(! errorLabel.isVisible());
    });
}
 
開發者ID:gluonhq,項目名稱:ide-plugins,代碼行數:14,代碼來源:CodeSWT.java

示例13: disableDialog

import org.eclipse.swt.graphics.Cursor; //導入依賴的package包/類
private void disableDialog() {
    display.asyncExec(() -> {
        enableControls(false);
        errorLabel.setVisible(false);
        credentials.setUserKey(false, null);
        composite.getParent().setCursor(new Cursor(display, SWT.CURSOR_WAIT));
    });
}
 
開發者ID:gluonhq,項目名稱:ide-plugins,代碼行數:9,代碼來源:AccountSWT.java

示例14: restoreDialog

import org.eclipse.swt.graphics.Cursor; //導入依賴的package包/類
private void restoreDialog(String key) {
    display.asyncExec(() -> {
        errorLabel.setVisible(key == null); 
        composite.getParent().setCursor(new Cursor(display, SWT.CURSOR_ARROW));
        enableControls(true);
        if (key != null && ! key.isEmpty()) {
            credentials.setUserKey(rememberMe, key);
            close();
        }
    });
}
 
開發者ID:gluonhq,項目名稱:ide-plugins,代碼行數:12,代碼來源:AccountSWT.java

示例15: disableDialog

import org.eclipse.swt.graphics.Cursor; //導入依賴的package包/類
private void disableDialog() {
    display.asyncExec(() -> {
        applicationsList.clear();
        currentAppBox.removeAll();
        enableControls(false);
        composite.getParent().setCursor(new Cursor(display, SWT.CURSOR_WAIT));
    });
}
 
開發者ID:gluonhq,項目名稱:ide-plugins,代碼行數:9,代碼來源:ApplicationsSWT.java


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