Java 类org.eclipse.jface.dialogs.IDialogConstants 实例源码

项目:ide-plugins    文件:FunctionSWT.java   
@Override
protected void createButtonsForButtonBar(Composite parent) {
    super.createButtonsForButtonBar(parent);

    Button ok = getButton(IDialogConstants.OK_ID);
    ok.setText("Create");
    ok.setEnabled(false);
    setButtonLayoutData(ok);

    Button cancel = getButton(IDialogConstants.CANCEL_ID);
    cancel.setText("Cancel");
    setButtonLayoutData(cancel);
    cancel.addListener(SWT.Selection, e -> {
        function.setFunctionName(null);
        function.setPackageName(null);
    });
}
项目:ide-plugins    文件:CodeSWT.java   
@Override
protected void createButtonsForButtonBar(Composite parent) {
    super.createButtonsForButtonBar(parent);

    Button ok = getButton(IDialogConstants.OK_ID);
    ok.setText("Apply");
    ok.setEnabled(false);
    setButtonLayoutData(ok);

    Button cancel = getButton(IDialogConstants.CANCEL_ID);
    cancel.setText("Cancel");
    setButtonLayoutData(cancel);
    cancel.addListener(SWT.Selection, e -> {
        if (futureTask != null && ! futureTask.isDone()) {
            futureTask.cancel(true);
        }
        code.setFunctionName(null);
        code.setFunctionGivenName(null);
        code.setResultType(null);
        code.setReturnedType(null);
    });
}
项目:ide-plugins    文件:PluginsSWT.java   
private void redrawTables() {
    Table sourceTable = sourceTableViewer.getTable();
    sourceTable.setRedraw(false);
    clean(sourceTable);
    source.sort(Plugin::compareTo);
    sourceTableViewer.setInput(source);
    btnSelectAll.setEnabled(source.size() > 0);
    sourceTable.setRedraw(true);
    checkSelection(sourceTable);

    Table targetTable = targetTableViewer.getTable();
    targetTable.setRedraw(false);
    clean(targetTable);
    target.sort(Plugin::compareTo);
    targetTableViewer.setInput(target);
    btnDeselectAll.setEnabled(target.size() > 0);
    targetTable.setRedraw(true);
    checkSelection(targetTable);

    if (getButton(IDialogConstants.OK_ID) != null) {
        getButton(IDialogConstants.OK_ID).setEnabled(! targetOriginal.equals(target));
    }
}
项目:ide-plugins    文件:PluginDialog.java   
@Override
protected Control createButtonBar(Composite parent) {
    final Composite buttonBar = new Composite(parent, SWT.NONE);
    buttonBar.setBackground(backColor);

    final GridLayout layout = new GridLayout();
    layout.marginLeft = 10;
    layout.numColumns = 2;
    layout.makeColumnsEqualWidth = false;
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    buttonBar.setLayout(layout);

    final GridData data = new GridData(SWT.FILL, SWT.CENTER, true, false);
    data.grabExcessHorizontalSpace = true;
    data.grabExcessVerticalSpace = false;
    buttonBar.setLayoutData(data);

    buttonBar.setFont(parent.getFont());

    // add the dialog's button bar to the right
    buttonControl = super.createButtonBar(buttonBar);
    buttonControl.setBackground(backColor);
    buttonControl.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false));

    return buttonBar;
}
项目:ide-plugins    文件:ApplicationsSWT.java   
@Override
protected void createButtonsForButtonBar(Composite parent) {
    super.createButtonsForButtonBar(parent);

    Button ok = getButton(IDialogConstants.OK_ID);
    ok.setText("Apply");
    ok.setEnabled(false);
    setButtonLayoutData(ok);

    Button cancel = getButton(IDialogConstants.CANCEL_ID);
    cancel.setText("Cancel");
    setButtonLayoutData(cancel);
    cancel.addListener(SWT.Selection, e -> {
        if (futureTask != null && ! futureTask.isDone()) {
            futureTask.cancel(true);
        }
        credentials.setApplication(null); 
    });
}
项目:neoscada    文件:HiveTab.java   
protected void chooseWorkspace ()
{
    final ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog ( getShell (), new WorkbenchLabelProvider (), new WorkbenchContentProvider () );
    dialog.setTitle ( "Select driver exporter configuration file" );
    dialog.setMessage ( "Choose a driver exporter file for the configuration" );
    dialog.setInput ( ResourcesPlugin.getWorkspace ().getRoot () );
    dialog.setComparator ( new ResourceComparator ( ResourceComparator.NAME ) );
    dialog.setAllowMultiple ( true );
    dialog.setDialogBoundsSettings ( getDialogBoundsSettings ( HiveTab.WORKSPACE_SELECTION_DIALOG ), Dialog.DIALOG_PERSISTSIZE );
    if ( dialog.open () == IDialogConstants.OK_ID )
    {
        final IResource resource = (IResource)dialog.getFirstResult ();
        if ( resource != null )
        {
            final String arg = resource.getFullPath ().toString ();
            final String fileLoc = VariablesPlugin.getDefault ().getStringVariableManager ().generateVariableExpression ( "workspace_loc", arg ); //$NON-NLS-1$
            this.fileText.setText ( fileLoc );
            makeDirty ();
        }
    }
}
项目:convertigo-eclipse    文件:SchemaObjectsDialog.java   
@Override
protected void okPressed() {
    try {
        getButton(IDialogConstants.OK_ID).setEnabled(false);
        getButton(IDialogConstants.CANCEL_ID).setEnabled(false);

        if (schemaObjectsDialogComposite != null) {
            qname = (QName)schemaObjectsDialogComposite.getValue(null);
        }

        Thread thread = new Thread(this);
        thread.start();
    }
    catch (Throwable e) {
        ConvertigoPlugin.logException(e, "Unable to import objects");
    }
    finally {
        getButton(IDialogConstants.OK_ID).setEnabled(true);
        getButton(IDialogConstants.CANCEL_ID).setEnabled(true);
    }
}
项目:convertigo-eclipse    文件:XmlStructureDialog.java   
@Override
protected void okPressed() {
    try {
        getButton(IDialogConstants.OK_ID).setEnabled(false);
        getButton(IDialogConstants.CANCEL_ID).setEnabled(false);

        if (schemaObjectsDialogComposite != null) {
            xml = (String)schemaObjectsDialogComposite.getValue(null);
        }

        Thread thread = new Thread(this);
        thread.start();
    }
    catch (Throwable e) {
        ConvertigoPlugin.logException(e, "Unable to import objects");
    }
    finally {
        getButton(IDialogConstants.OK_ID).setEnabled(true);
        getButton(IDialogConstants.CANCEL_ID).setEnabled(true);
    }
}
项目:Equella    文件:NewJPFRegistryWizardPageOne.java   
private GridLayout initGridLayout(GridLayout layout, boolean margins)
{
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
    if( margins )
    {
        layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
        layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
    }
    else
    {
        layout.marginWidth = 0;
        layout.marginHeight = 0;
    }
    return layout;
}
项目:pgcodekeeper    文件:FilterDialog.java   
@Override
protected void createButtonsForButtonBar(Composite parent) {
    createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    Button btnReset = createButton(parent, IDialogConstants.NO_ID, Messages.FilterDialog_reset, false);
    createButton(parent, IDialogConstants.CANCEL_ID, Messages.FilterDialog_cancel, false);

    btnReset.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            text.setText(""); //$NON-NLS-1$
            btnRegEx.setSelection(false);
            objViewer.setAllChecked(false);
            chgViewer.setAllChecked(false);
        }
    });
}
项目:bdf2    文件:PropertyBrowser.java   
protected void buttonPressed(int buttonId) {
    if (IDialogConstants.OK_ID == buttonId) {
        okPressed();
    } else if (IDialogConstants.CANCEL_ID == buttonId) {
        cancelPressed();
    } else if (UPDATE_ID == buttonId) {

        Display.getDefault().asyncExec(new Runnable() {

            @Override
            public void run() {
                try {
                    propEditor.updatePropertyBrowser();
                    treeViewer.setInput(XmlReader.loadXmlReader(path));
                } catch (Exception e) {
                    e.printStackTrace();
                    // TODO: handle exception
                } finally {
                    treeViewer.refresh();
                }
            }
        });
    }
}
项目:com.onpositive.prefeditor    文件:FolderSelectionDialog.java   
/**
 * Sets or clears the error message.
 * If not <code>null</code>, the OK button is disabled.
 * 
 * @param errorMessage
 *            the error message, or <code>null</code> to clear
 * @since 3.0
 */
public void setErrorMessage(String errorMessage) {
    this.errorMessage = errorMessage;
    if (errorMessageText != null && !errorMessageText.isDisposed()) {
        errorMessageText.setText(errorMessage == null ? " \n " : errorMessage); //$NON-NLS-1$
        // Disable the error message text control if there is no error, or
        // no error text (empty or whitespace only).  Hide it also to avoid
        // color change.
        // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=130281
        boolean hasError = errorMessage != null && (StringConverter.removeWhiteSpaces(errorMessage)).length() > 0;
        errorMessageText.setEnabled(hasError);
        errorMessageText.setVisible(hasError);
        errorMessageText.getParent().update();
        // Access the ok button by id, in case clients have overridden button creation.
        // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=113643
        Control button = getButton(IDialogConstants.OK_ID);
        if (button != null) {
            button.setEnabled(errorMessage == null);
        }
    }
}
项目:Hydrograph    文件:ParamterValueDialog.java   
@Override
protected Control createButtonBar(Composite parent) {
    Composite composite = new Composite(parent, SWT.NONE);
    // create a layout with spacing and margins appropriate for the font
    // size.
    GridLayout layout = new GridLayout();
    layout.numColumns = 0; // this is incremented by createButton
    layout.makeColumnsEqualWidth = true;
    layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN );
    layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN - 4);
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING -2);

    composite.setLayout(layout);
    GridData data = new GridData(GridData.HORIZONTAL_ALIGN_END
            | GridData.VERTICAL_ALIGN_CENTER);

    composite.setLayoutData(data);
    composite.setFont(parent.getFont());

    // Add the buttons to the button bar.
    createButtonsForButtonBar(composite);
    return composite;
}
项目:Hydrograph    文件:FilterOperationClassUtility.java   
/**
 * @param filterExtension
 * @param fileName
 * Open the dialog to browse .xml file for expression, operation or outputfields
 */
private void browseXMLSelectionDialog(String filterExtension, Text fileName) {
    String externalSchemaTextBoxValue = "";
    ExternalSchemaFileSelectionDialog dialog = new ExternalSchemaFileSelectionDialog("Project",
            "Select Input File (.xml)",  new String[]{filterExtension,Extensions.XML.toString()}, this);
    if (dialog.open() == IDialogConstants.OK_ID) {
        String file = fileNameTextBoxValue;
        IResource resource = (IResource) dialog.getFirstResult();
        String path[] = resource.getFullPath().toString().split("/");
        if (file.isEmpty()) {
            for (int i = 1; i < path.length; i++) {
                externalSchemaTextBoxValue = externalSchemaTextBoxValue + path[i] + "/";
            }
        } else {
            for (int i = 1; i < path.length; i++) {
                if (!path[i].endsWith(".xml")) {
                    externalSchemaTextBoxValue = externalSchemaTextBoxValue + path[i] + "/";
                }
            }
            externalSchemaTextBoxValue = externalSchemaTextBoxValue + file;
        }
        fileName.setText(externalSchemaTextBoxValue);
    }
}
项目:n4js    文件:MultiElementListSelectionDialog.java   
@Override
protected void createButtonsForButtonBar(Composite parent) {
    fBackButton = createButton(parent, IDialogConstants.BACK_ID, IDialogConstants.BACK_LABEL, false);

    // XXX: Workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=279425
    boolean HAS_BUG_279425 = true;
    fNextButton = createButton(parent, IDialogConstants.NEXT_ID, IDialogConstants.NEXT_LABEL, !HAS_BUG_279425);
    fFinishButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.FINISH_LABEL, HAS_BUG_279425);

    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
}
项目:n4js    文件:MultiElementListSelectionDialog.java   
@Override
protected void buttonPressed(int buttonId) {
    if (buttonId == IDialogConstants.BACK_ID) {
        turnPage(false);
    } else if (buttonId == IDialogConstants.NEXT_ID) {
        turnPage(true);
    } else {
        super.buttonPressed(buttonId);
    }
}
项目:Hydrograph    文件:HydrographInstallationDialog.java   
protected void setButtonLayoutData(FontMetrics metrics, Control button,
        boolean visible) {
    GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
    int widthHint = Dialog.convertHorizontalDLUsToPixels(metrics,
            IDialogConstants.BUTTON_WIDTH);
    Point minSize = button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
    data.widthHint = Math.max(widthHint, minSize.x);
    data.exclude = !visible;
    button.setLayoutData(data);
}
项目:n4js    文件:N4JSBuilderPreferencePage.java   
/**
 * This method has been copied and adapted from org.eclipse.xtext.ui.preferences.OptionsConfigurationBlock.
 */
@Override
protected boolean processChanges(IWorkbenchPreferenceContainer container) {
    boolean needsBuild = !getPreferenceChanges().isEmpty() | projectSpecificChanged;
    boolean doBuild = false;
    if (needsBuild) {
        int count = getRebuildCount();
        if (count > rebuildCount) {
            needsBuild = false;
            rebuildCount = count;
        }
    }
    if (needsBuild) {
        String[] strings = getFullBuildDialogStrings(project == null);
        if (strings != null) {
            MessageDialog dialog = new MessageDialog(this.getShell(), strings[0], null, strings[1],
                    MessageDialog.QUESTION,
                    new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL,
                            IDialogConstants.CANCEL_LABEL },
                    2);
            int res = dialog.open();
            if (res == 0) {
                doBuild = true;
            } else if (res != 1) {
                return false;
            }
        }
    }
    if (container != null) {
        if (doBuild) {
            incrementRebuildCount();
            container.registerUpdateJob(getBuildJob(getProject()));
        }
    } else {
        if (doBuild) {
            getBuildJob(getProject()).schedule();
        }
    }
    return true;
}
项目:n4js    文件:AbstractExportToSingleFileWizardPage.java   
/**
 * Displays a Yes/No question to the user with the specified message and returns the user's response.
 *
 * @param message
 *            the question to ask
 * @return <code>true</code> for Yes, and <code>false</code> for No
 */
private boolean queryYesNoQuestion(String message) {
    MessageDialog dialog = new MessageDialog(getContainer().getShell(),
            IDEWorkbenchMessages.Question,
            (Image) null, message, MessageDialog.NONE,
            new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL }, 0) {
        @Override
        protected int getShellStyle() {
            return super.getShellStyle() | SWT.SHEET;
        }
    };
    return dialog.open() == 0;
}
项目:Hydrograph    文件:HydrographInstallationDialog.java   
public void update(String currentPageId) {
    if (composite == null || composite.isDisposed())
        return;
    GC metricsGC = new GC(composite);
    FontMetrics metrics = metricsGC.getFontMetrics();
    metricsGC.dispose();
    List buttons = (List) buttonMap.get(currentPageId);
    Control[] children = composite.getChildren();

    int visibleChildren = 0;
    Button closeButton = getButton(IDialogConstants.CLOSE_ID);

    for (int i = 0; i < children.length; i++) {
        Control control = children[i];
        if (closeButton == control)
            closeButton.dispose();
        else {
            control.setVisible(false);
            setButtonLayoutData(metrics, control, false);
        }
    }
    if (buttons != null) {
        for (int i = 0; i < buttons.size(); i++) {
            Button button = (Button) buttons.get(i);
            button.setVisible(true);
            setButtonLayoutData(metrics, button, true);
            GridData data = (GridData) button.getLayoutData();
            data.exclude = false;
            visibleChildren++;
        }
    }

    GridLayout compositeLayout = (GridLayout) composite.getLayout();
    compositeLayout.numColumns = visibleChildren;
    composite.layout(true);
}
项目: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());
    });
}
项目:Hydrograph    文件:WizardNewProjectCreationPage.java   
private GridLayout initGridLayout(GridLayout layout, boolean margins) {
    layout.horizontalSpacing= convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    layout.verticalSpacing= convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
    if (margins) {
        layout.marginWidth= convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
        layout.marginHeight= convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
    } else {
        layout.marginWidth= 0;
        layout.marginHeight= 0;
    }
    return layout;
}
项目:Hydrograph    文件:ViewDataPreferencesDialog.java   
/**
 * Create contents of the button bar.
 * 
 * @param parent
 */
@Override
protected void createButtonsForButtonBar(Composite parent) {
    parent.setLayout(new GridLayout(1, false));
    Composite composite = new Composite(parent, SWT.NONE);
    composite.setLayout(new GridLayout(2, false));
    composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));

    warningImageLabel = new Label(composite, SWT.NONE);
    warningImageLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, true, 1, 1));

    warningImageLabel.setImage(ImagePathConstant.WARNING_ICON.getImageFromRegistry());

    warningLabel = new Label(composite, SWT.NONE);
    warningLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, true, 1, 1));
    warningLabel.setText(Messages.WARNING_MESSAGE);

    warningLabel.setVisible(false);
    warningImageLabel.setVisible(false);
    if (!delimiterTextBox.getText().equalsIgnoreCase(",")
            || !quoteCharactorTextBox.getText().equalsIgnoreCase("\"")) {
        warningImageLabel.setVisible(true);
        warningLabel.setVisible(true);
    }
    createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
}
项目:ide-plugins    文件:ApplicationsSWT.java   
private void enableControls(boolean enable) {
    currentAppBox.setEnabled(enable);
    keyText.setEnabled(enable);
    secretText.setEnabled(enable);
    logout.setEnabled(enable);
    getButton(IDialogConstants.OK_ID).setEnabled(enable);
}
项目:android-uiautomatorviewer    文件:OpenDialog.java   
/**
 * Create contents of the button bar.
 */
@Override
protected void createButtonsForButtonBar(Composite parent) {
  mOkButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
  createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
  updateButtonState();
}
项目:Hydrograph    文件:TransformDialog.java   
/**
 * Create contents of the button bar.
 * 
 * @param parent
 */
@Override
protected void createButtonsForButtonBar(Composite parent) {
    Button okButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    Button cancelButton = createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
    propertyDialogButtonBar.setPropertyDialogButtonBar(okButton, null, cancelButton);
}
项目:neoscada    文件:KeySelectorDialog.java   
@Override
protected void createButtonsForButtonBar ( final Composite parent )
{
    super.createButtonsForButtonBar ( parent );

    this.unlockButton = createButton ( parent, IDialogConstants.INTERNAL_ID, Messages.KeySelectorDialog_ButtonUnlock_Text, false );
}
项目:neoscada    文件:KeySelectorDialog.java   
@Override
protected void buttonPressed ( final int buttonId )
{
    if ( buttonId == IDialogConstants.INTERNAL_ID )
    {
        performUnlock ( this.lockable );
    }
    super.buttonPressed ( buttonId );
}
项目:neoscada    文件:KeySelectorDialog.java   
protected void updateButtons ()
{
    final Button ok = getButton ( IDialogConstants.OK_ID );
    if ( ok != null )
    {
        ok.setEnabled ( hasKeySelected () );
    }
    this.unlockButton.setEnabled ( this.lockable != null && this.lockable.isLocked () );
}
项目:neoscada    文件:DataItemDetailsDialog.java   
@Override
protected void buttonPressed ( final int buttonId )
{
    if ( buttonId == IDialogConstants.CLOSE_ID )
    {
        closePressed ();
    }
}
项目:neoscada    文件:ConfirmationDialogFuture.java   
private Boolean showDialog ( final ConfirmationCallback cb, final Display display, final Shell parentShell, final String dialogTitle )
{
    switch ( cb.getConfirmationType () )
    {
        case CONFIRM:
            return MessageDialog.openConfirm ( parentShell, dialogTitle, cb.getLabel () ) ? true : null;
        case ERROR:
            MessageDialog.openError ( parentShell, dialogTitle, cb.getLabel () );
            return true;
        case WARNING:
            MessageDialog.openWarning ( parentShell, dialogTitle, cb.getLabel () );
            return true;
        case INFORMATION:
            MessageDialog.openInformation ( parentShell, dialogTitle, cb.getLabel () );
            return true;
        case QUESTION:
            return MessageDialog.openQuestion ( parentShell, dialogTitle, cb.getLabel () );
        case QUESTION_WITH_CANCEL:
        {
            final MessageDialog dialog = new MessageDialog ( parentShell, dialogTitle, null, cb.getLabel (), MessageDialog.QUESTION_WITH_CANCEL, new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.CANCEL_LABEL }, 0 );
            final int result = dialog.open ();
            if ( result == 2 /*CANCEL*/)
            {
                return null;
            }
            else
            {
                return result == Window.OK;
            }
        }
        default:
            throw new IllegalArgumentException ( String.format ( "Unable to process type: %s", cb.getConfirmationType () ) );
    }
}
项目:convertigo-eclipse    文件:ProjectChooseTestCasesDialog.java   
@Override
    protected Control createButtonBar(Composite parent) {
        Control buttonBar =  super.createButtonBar(parent);
        getButton(IDialogConstants.OK_ID).setText("OK");
//      getButton(IDialogConstants.OK_ID).setEnabled(false);
        getButton(IDialogConstants.CANCEL_ID).setText("Cancel");
        return buttonBar;
    }
项目:convertigo-eclipse    文件:ProjectDeployDialog.java   
@Override
protected Control createButtonBar(Composite parent) {
    Control buttonBar =  super.createButtonBar(parent);
    projectDeployDialogComposite = (ProjectDeployDialogComposite) dialogComposite;      
    getButton(IDialogConstants.OK_ID).setText("Deploy");
    projectDeployDialogComposite.setOkButton(getButton(IDialogConstants.OK_ID));
    return buttonBar;
}
项目:Hydrograph    文件:JdkPathDialog.java   
/**
 * Create contents of the button bar.
 * @param parent
 */
@Override
protected void createButtonsForButtonBar(Composite parent) {
    parent.setLayout(new GridLayout(3,false));
    parent.setLayoutData(new GridData(SWT.FILL,SWT.BOTTOM,true,true));
    createErrorLabel(parent);
okButton = createButton(parent, IDialogConstants.OK_ID, "Save and &Restart", true);
okButton.setEnabled(false);
createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
}
项目:convertigo-eclipse    文件:WsReferenceImportDialog.java   
protected void okPressed() {        
    try {
        progressBar = ( (WsReferenceImportDialogComposite)dialogComposite ).progressBar;

        getButton(IDialogConstants.OK_ID).setEnabled(false);
        getButton(IDialogConstants.CANCEL_ID).setEnabled(false);

        Thread thread = new Thread(this);
        thread.start();
    }
    catch (Throwable e) {
        ConvertigoPlugin.logException(e, "Unable to import WS reference!");
    }
}
项目:convertigo-eclipse    文件:SchemaObjectsDialog.java   
@Override
protected Control createButtonBar(Composite parent) {
    Control buttonBar =  super.createButtonBar(parent);
    getButton(IDialogConstants.OK_ID).setText("Import");
    getButton(IDialogConstants.OK_ID).setEnabled(false);
    return buttonBar;
}
项目:convertigo-eclipse    文件:ProjectVersionUpdateDialog.java   
@Override
protected Control createButtonBar(Composite parent) {
    Control buttonBar =  super.createButtonBar(parent);
    getButton(IDialogConstants.OK_ID).setText("Update");
    getButton(IDialogConstants.OK_ID).setEnabled(false);
    Button cancel = getButton(IDialogConstants.CANCEL_ID);
    cancel.setText("Skip");
    cancel.setFocus();
    return buttonBar;
}
项目:Hydrograph    文件:RunConfigDialog.java   
/**
 * Create contents of the button bar.
 * 
 * @param parent
 */
@Override
protected void createButtonsForButtonBar(Composite parent) {
    okButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);

    applyServerDetailsCrossTextEmptyValidationListener(txtEdgeNode);
    applyServerDetailsCrossTextEmptyValidationListener(txtPassword);
    applyServerDetailsCrossTextEmptyValidationListener(txtUserName);
    applyServerDetailsCrossTextEmptyValidationListener(txtBasePath);
    applyServerDetailsCrossTextEmptyValidationListener(txtKeyFile);
    applyServerDetailsCrossTextEmptyValidationListener(txtRunUtility);
    applyServerDetailsCrossTextEmptyValidationListener(txtProjectPath);
    loadBuildProperties();
}
项目:convertigo-eclipse    文件:XmlStructureDialog.java   
@Override
protected Control createButtonBar(Composite parent) {
    Control buttonBar =  super.createButtonBar(parent);
    getButton(IDialogConstants.OK_ID).setText("Import");
    getButton(IDialogConstants.OK_ID).setEnabled(true);
    return buttonBar;
}
项目:Hydrograph    文件:FilterLogicWidget.java   
private void addSelectionListerner() {
    button.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            FilterLogicDataStructure clonedDataStructure = (FilterLogicDataStructure) dataStructure.clone();
            FilterExpressionOperationDialog dialog = new FilterExpressionOperationDialog(
                    Display.getCurrent().getActiveShell(), clonedDataStructure, getComponent(),
                    propertyDialogButtonBar, widgetConfig, getInputSchema());

            if (StringUtils.equalsIgnoreCase(getComponent().getComponentName(), Constants.FILTER)) {
                dialog.setTitle("Filter Editor");
            } else if (StringUtils.equalsIgnoreCase(getComponent().getComponentName(),
                    Constants.PARTITION_BY_EXPRESSION)) {
                dialog.setTitle("Partition Logic Editor");
            }

            if (dialog.open() == IDialogConstants.OK_ID) {
                dataStructure=clonedDataStructure;
            }
            showHideErrorSymbol(widgets);

            if(dialog.isYesButtonPressed()) {
                propertyDialog.pressOK();
            }
            else if(dialog.isNoButtonPressed()) {
                propertyDialog.pressCancel();
            }
        }
    });
}