本文整理匯總了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());
}
}
}
}
});
}
示例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();
}
}
示例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();
}
}
示例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();
}
}
示例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));
}
}
示例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);
}
示例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();
}
}
示例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();
}
}
示例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();
}
}
示例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();
}
}
示例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();
}
示例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());
});
}
示例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));
});
}
示例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();
}
});
}
示例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));
});
}