Java 类org.eclipse.swt.graphics.Cursor 实例源码

项目:ide-plugins    文件:ApplicationsSWT.java   
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());
                    }
                }
            }
        }
    });
}
项目:convertigo-eclipse    文件:ProjectExplorerFindAction.java   
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();
       }
}
项目:convertigo-eclipse    文件:ProjectExplorerImportAction.java   
@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();
       }
}
项目:convertigo-eclipse    文件:TransactionEditHandlersAction.java   
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();
    }
}
项目:Hydrograph    文件:InputAdditionalParametersDialog.java   
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));
        }
}
项目:applecommander    文件:Sleak.java   
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);
}
项目:convertigo-eclipse    文件:UndoAction.java   
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();
       }
}
项目:convertigo-eclipse    文件:ProjectSaveAction.java   
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();
       }

}
项目:convertigo-eclipse    文件:ProjectOpenAction.java   
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();
       }
}
项目:convertigo-eclipse    文件:TraceEditAction.java   
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();
       }
}
项目:pdi    文件:SWTResourceManager.java   
/**
 * Dispose all of the cached cursors.
 */
public static void disposeCursors() {
    for (Cursor cursor : m_idToCursorMap.values()) {
        cursor.dispose();
    }
    m_idToCursorMap.clear();
}
项目:AgentWorkbench    文件:SWTResourceManager.java   
/**
 * Dispose all of the cached cursors.
 */
public static void disposeCursors() {
    for (Cursor cursor : m_idToCursorMap.values()) {
        cursor.dispose();
    }
    m_idToCursorMap.clear();
}
项目:APITools    文件:SWTResourceManager.java   
/**
 * Dispose all of the cached cursors.
 */
public static void disposeCursors() {
    for (Cursor cursor : m_idToCursorMap.values()) {
        cursor.dispose();
    }
    m_idToCursorMap.clear();
}
项目:ide-plugins    文件:CodeSWT.java   
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());
    });
}
项目:ide-plugins    文件:AccountSWT.java   
private void disableDialog() {
    display.asyncExec(() -> {
        enableControls(false);
        errorLabel.setVisible(false);
        credentials.setUserKey(false, null);
        composite.getParent().setCursor(new Cursor(display, SWT.CURSOR_WAIT));
    });
}
项目:ide-plugins    文件:AccountSWT.java   
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();
        }
    });
}
项目:ide-plugins    文件:ApplicationsSWT.java   
private void disableDialog() {
    display.asyncExec(() -> {
        applicationsList.clear();
        currentAppBox.removeAll();
        enableControls(false);
        composite.getParent().setCursor(new Cursor(display, SWT.CURSOR_WAIT));
    });
}
项目:JavaFX-FrameRateMeter    文件:SWTCursors.java   
static Cursor embedCursorToCursor(CursorFrame cursorFrame) {
    int id = SWT.CURSOR_ARROW;
    switch (cursorFrame.getCursorType()) {
        case DEFAULT:   id = SWT.CURSOR_ARROW; break;
        case CROSSHAIR: id = SWT.CURSOR_CROSS; break;
        case TEXT:      id = SWT.CURSOR_IBEAM; break;
        case WAIT:      id = SWT.CURSOR_WAIT; break;
        case SW_RESIZE: id = SWT.CURSOR_SIZESW; break;
        case SE_RESIZE: id = SWT.CURSOR_SIZESE; break;
        case NW_RESIZE: id = SWT.CURSOR_SIZENW; break;
        case NE_RESIZE: id = SWT.CURSOR_SIZENE; break;
        case N_RESIZE:  id = SWT.CURSOR_SIZEN; break;
        case S_RESIZE:  id = SWT.CURSOR_SIZES; break;
        case W_RESIZE:  id = SWT.CURSOR_SIZEW; break;
        case E_RESIZE:  id = SWT.CURSOR_SIZEE; break;
        case OPEN_HAND:
        case CLOSED_HAND:
        case HAND:      id = SWT.CURSOR_HAND; break;
        case MOVE:      id = SWT.CURSOR_SIZEALL; break;
        case DISAPPEAR:
            // NOTE: Not implemented
            break;
        case H_RESIZE:  id = SWT.CURSOR_SIZEWE; break;
        case V_RESIZE:  id = SWT.CURSOR_SIZENS; break;
        case NONE:
            return null;
        case IMAGE:
            // RT-27939: custom cursors are not implemented
            // return createCustomCursor((ImageCursorFrame) cursorFrame);
    }
    Display display = Display.getCurrent();
    return display != null ? display.getSystemCursor(id) : null;
}
项目:convertigo-eclipse    文件:MyAbstractAction.java   
public void run() {
    Display display = Display.getDefault();
    Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);       

    Shell shell = getParentShell();
    shell.setCursor(waitCursor);

    MessageDialog.openInformation(
        shell,
        "Convertigo Plug-in",
        "The choosen operation is not yet implemented : '"+ action.getId() + "'.");

    shell.setCursor(null);
    waitCursor.dispose();
}
项目:Hydrograph    文件:FTPWidgetUtility.java   
/**
 * 
 */
public void removeModifyListener(Text text, PropertyDialogButtonBar propertyDialogButtonBar, Cursor cursor, 
        ControlDecoration controlDecoration){
    controlDecoration.hide();
    ELTModifyListener eltModifyListener = new ELTModifyListener();
    ListenerHelper helper = new ListenerHelper();
    helper.put(HelperType.CONTROL_DECORATION, controlDecoration);
    text.setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 255, 255));
    text.removeListener(SWT.Modify, eltModifyListener.getListener(propertyDialogButtonBar, helper, text));
}
项目:convertigo-eclipse    文件:DatabaseObjectCreateAction.java   
public void run() {
    Display display = Display.getDefault();
    Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);       

    Shell shell = getParentShell();
    shell.setCursor(waitCursor);

       try {
        TreeObject parentTreeObject = null;
        DatabaseObject databaseObject = null;
        ProjectExplorerView explorerView = getProjectExplorerView();
        if (explorerView != null) {
            parentTreeObject = explorerView.getFirstSelectedTreeObject();

            if (parentTreeObject instanceof ObjectsFolderTreeObject) {
                parentTreeObject = ((ObjectsFolderTreeObject) parentTreeObject).getParent();
                databaseObject  = (DatabaseObject) parentTreeObject.getObject();
            }
            else {
                databaseObject = (DatabaseObject) parentTreeObject.getObject();
            }

            NewObjectWizard newObjectWizard = new NewObjectWizard(databaseObject, databaseObjectClassName);
            WizardDialog wzdlg = new WizardDialog(shell, newObjectWizard);
            wzdlg.setPageSize(850, 650);
            wzdlg.open();
            int result = wzdlg.getReturnCode();
            if ((result != Window.CANCEL) && (newObjectWizard.newBean != null)) {
                postCreate(parentTreeObject, newObjectWizard.newBean);
            }
        }
       }
       catch (Throwable e) {
        ConvertigoPlugin.logException(e, "Unable to create a new database object '"+ databaseObjectClassName +"'!");
       }
       finally {
        shell.setCursor(null);
        waitCursor.dispose();
       }
}
项目:convertigo-eclipse    文件:EnableMobileRouteComponentAction.java   
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(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 route!");
       }
       finally {
        shell.setCursor(null);
        waitCursor.dispose();
       }
}
项目:convertigo-eclipse    文件:SequenceExecuteSelectedFromStubAction.java   
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 SequenceTreeObject)) {

                SequenceTreeObject sequenceTreeObject = (SequenceTreeObject)treeObject;
                openEditors(explorerView, sequenceTreeObject);

                Sequence sequence = sequenceTreeObject.getObject();
                ProjectTreeObject projectTreeObject = sequenceTreeObject.getProjectTreeObject();
                SequenceEditor sequenceEditor = projectTreeObject.getSequenceEditor(sequence);
                if (sequenceEditor != null) {
                    getActivePage().activate(sequenceEditor);
                    sequenceEditor.getDocument(sequence.getName(), true);
                }
            }
        }
       }
       catch (Throwable e) {
        ConvertigoPlugin.logException(e, "Unable to execute the selected sequence!");
       }
       finally {
        shell.setCursor(null);
        waitCursor.dispose();
       }
}
项目:convertigo-eclipse    文件:DisableStepAction.java   
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();
       }
}
项目:convertigo-eclipse    文件:EnableMobileRouteActionComponentAction.java   
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(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 action!");
       }
       finally {
        shell.setCursor(null);
        waitCursor.dispose();
       }
}
项目:convertigo-eclipse    文件:StepExportVariablesToSequenceAction.java   
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();
       }
}
项目:convertigo-eclipse    文件:CustomStatisticsAction.java   
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();
       }
}
项目:convertigo-eclipse    文件:EnableMobileRouteEventComponentAction.java   
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();
       }
}
项目:convertigo-eclipse    文件:SequenceExecuteSelectedAction.java   
@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 SequenceTreeObject)) {
                SequenceTreeObject sequenceTreeObject = (SequenceTreeObject)treeObject;
                openEditors(explorerView, sequenceTreeObject);

                Sequence sequence = sequenceTreeObject.getObject();
                ProjectTreeObject projectTreeObject = sequenceTreeObject.getProjectTreeObject();
                SequenceEditor sequenceEditor = projectTreeObject.getSequenceEditor(sequence);
                if (sequenceEditor != null) {
                    getActivePage().activate(sequenceEditor);
                    sequenceEditor.getDocument(sequence.getName(), isStubRequested());
                }
            }
        }
       }
       catch (Throwable e) {
        ConvertigoPlugin.logException(e, "Unable to execute the selected sequence!");
       }
       finally {
        shell.setCursor(null);
        waitCursor.dispose();
       }
}
项目:Hydrograph    文件:LoadTypeConfigurationDialog.java   
/**
 * Set the Property Help Text
 */
private void setPropertyHelpText() {
    if(ShowHidePropertyHelpHandler.getInstance() != null 
            && ShowHidePropertyHelpHandler.getInstance().isShowHidePropertyHelpChecked()){
        newTableRadioButton.setToolTipText(Messages.LOADCONFIG_NEWTABLE);
        newTableRadioButton.setCursor(new Cursor(newTableRadioButton.getDisplay(), SWT.CURSOR_HELP));

        insertRadioButton.setToolTipText(Messages.LOADCONFIG_INSERT);
        insertRadioButton.setCursor(new Cursor(insertRadioButton.getDisplay(), SWT.CURSOR_HELP));

        replaceRadioButton.setToolTipText(Messages.LOADCONFIG_REPLACE);
        replaceRadioButton.setCursor(new Cursor(replaceRadioButton.getDisplay(), SWT.CURSOR_HELP));
    }
}
项目:BiglyBT    文件:SWTSkinTabSet.java   
private void setActiveTab(final SWTSkinObjectTab newTab, final boolean evenIfSame) {
    Utils.execSWTThread(new AERunnable() {
        @Override
        public void runSupport() {
            Composite shell = skin.getShell();
            Cursor cursor = shell.getCursor();
            try {
                shell.setCursor(shell.getDisplay().getSystemCursor(SWT.CURSOR_WAIT));
                swtSetActiveTab(newTab, evenIfSame);
            } finally {
                shell.setCursor(cursor);
            }
        }
    });
}
项目:convertigo-eclipse    文件:DeclareGlobalSymbolsFromThisProjectAction.java   
@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();

            //For each database object from the current project we find the undefined global symbols
            if ((databaseObject != null) && (databaseObject instanceof Project)) {
                Project project = (Project)treeObject.getObject();
                Engine.theApp.databaseObjectsManager.symbolsCreateUndefined(project.getName());

                //Reload the project
                explorerView.reloadProject(treeObject);

                ConvertigoPlugin.infoMessageBox("The global symbols file has been successfully updated!"); 
            }
        }

       }
       catch (Exception e) {
        ConvertigoPlugin.logException(e, "Unable to declare global symbols from the selected project!");
       }
       finally {
        shell.setCursor(null);
        waitCursor.dispose();
       }
}
项目:convertigo-eclipse    文件:EnableStepAction.java   
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(true);

                    stepTreeObject.setEnabled(true);
                    stepTreeObject.hasBeenModified(true);

                    TreeObjectEvent treeObjectEvent = new TreeObjectEvent(stepTreeObject, "isEnable", false, true);
                    explorerView.fireTreeObjectPropertyChanged(treeObjectEvent);
                }
            }

            explorerView.refreshSelectedTreeObjects();
        }
       }
       catch (Throwable e) {
        ConvertigoPlugin.logException(e, "Unable to enable step!");
       }
       finally {
        shell.setCursor(null);
        waitCursor.dispose();
       }
}
项目:convertigo-eclipse    文件:MobileComponentCreateAction.java   
public void run() {
    Display display = Display.getDefault();
    Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);       

    Shell shell = getParentShell();
    shell.setCursor(waitCursor);

       try {
        TreeObject parentTreeObject = null;
        DatabaseObject databaseObject = null;
        ProjectExplorerView explorerView = getProjectExplorerView();
        if (explorerView != null) {
            parentTreeObject = explorerView.getFirstSelectedTreeObject();

            if (parentTreeObject instanceof ObjectsFolderTreeObject) {
                parentTreeObject = ((ObjectsFolderTreeObject) parentTreeObject).getParent();
                databaseObject  = (DatabaseObject) parentTreeObject.getObject();
            }
            else {
                databaseObject = (DatabaseObject) parentTreeObject.getObject();
            }

            ComponentObjectWizard newObjectWizard = new ComponentObjectWizard(databaseObject, databaseObjectClassName);
            WizardDialog wzdlg = new WizardDialog(shell, newObjectWizard);
            wzdlg.setPageSize(850, 650);
            wzdlg.open();
            int result = wzdlg.getReturnCode();
            if ((result != Window.CANCEL) && (newObjectWizard.newBean != null)) {
                postCreate(parentTreeObject, newObjectWizard.newBean);
            }
        }
       }
       catch (Throwable e) {
        ConvertigoPlugin.logException(e, "Unable to create a new database object '"+ databaseObjectClassName +"'!");
       }
       finally {
        shell.setCursor(null);
        waitCursor.dispose();
       }
}
项目:convertigo-eclipse    文件:CreateDesignDocumentViewReduceAction.java   
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) {
            DesignDocumentViewTreeObject ddvto = (DesignDocumentViewTreeObject)explorerView.getFirstSelectedTreeObject();
            DesignDocumentFunctionTreeObject ddfto = ddvto.addReduce();
            DesignDocumentTreeObject ddto = (DesignDocumentTreeObject) ddvto.getParent().getParent();
            if (ddto.hasChanged()) {
                TreeParent treeParent = ddto.getParent();
                if (treeParent instanceof FolderTreeObject)
                    treeParent = treeParent.getParent();
                explorerView.objectChanged(new CompositeEvent(treeParent.getObject(),ddfto.getPath()));
            }
        }
       }
       catch (Throwable e) {
        ConvertigoPlugin.logException(e, "Unable to create a reduce function!");
       }
       finally {
        shell.setCursor(null);
        waitCursor.dispose();
       }
}
项目:convertigo-eclipse    文件:OutputStepAction.java   
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;
            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;
                    output((Step)stepTreeObject.getObject());
                    stepTreeObject.hasBeenModified(true);

                    // Updating the tree
                    explorerView.refreshTreeObject(stepTreeObject);

                    TreeObjectEvent treeObjectEvent = new TreeObjectEvent(stepTreeObject, "output", !output, output);
                    explorerView.fireTreeObjectPropertyChanged(treeObjectEvent);
                }
            }
        }
       }
       catch (Throwable e) {
        ConvertigoPlugin.logException(e, "Unable to output step!");
       }
       finally {
        shell.setCursor(null);
        waitCursor.dispose();
       }
}
项目:convertigo-eclipse    文件:DisableMobileRouteEventComponentAction.java   
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();
       }
}
项目:Hydrograph    文件:FTPProtocolWidget.java   
private void setPropertyHelpText(Label label, String message) {
    if(ShowHidePropertyHelpHandler.getInstance() != null 
            && ShowHidePropertyHelpHandler.getInstance().isShowHidePropertyHelpChecked()){
        label.setToolTipText(message);
        label.setCursor(new Cursor(label.getDisplay(), SWT.CURSOR_HELP));
    }

}
项目:Hydrograph    文件:FTPOperationConfigDialog.java   
protected FTPOperationConfigDialog(Shell parentShell, String windowTitle,PropertyDialogButtonBar propertyDialogButtonBar,
        Map<String, FTPAuthOperationDetails> initialMap, Cursor cursor, String[] optionList, String protocol) {
    super(parentShell);
    setShellStyle(SWT.CLOSE | SWT.TITLE | SWT.WRAP | SWT.APPLICATION_MODAL | SWT.RESIZE);
    if (StringUtils.isNotBlank(windowTitle))
        windowLabel = windowTitle;
    else
        windowLabel = Messages.ADDITIONAL_PARAMETERS_FOR_DB_WINDOW_LABEL;
    this.propertyDialogButtonBar = propertyDialogButtonBar;
    this.cursor = cursor;
    this.optionList = optionList;
    this.authOperationSelectionMap = initialMap;
    this.protocol = protocol;
}
项目:convertigo-eclipse    文件:TransactionExecuteSelectedAction.java   
@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();
       }
}