org.eclipse.jface.dialogs.IDialogConstants Java Examples

The following examples show how to use org.eclipse.jface.dialogs.IDialogConstants. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ContactSelectionDialog.java    From elexis-3-core with Eclipse Public License 1.0 6 votes vote down vote up
@Override
protected void createButtonsForButtonBar(Composite parent){
	if (enableEmptyField) {
		parent.setLayout(new GridLayout(3, false));
		Button btnClear =
			createButton(parent, IDialogConstants.NO_ID, Messages.KontaktSelector_clearField,
				false);
		btnClear.addSelectionListener(new SelectionAdapter() {
			@Override
			public void widgetSelected(SelectionEvent e){
				selection = null;
				vc.getContentProvider().stopListening();
				close();
			}
		});
	} else {
		parent.setLayout(new GridLayout(2, false));
	}
	
	createButton(parent, IDialogConstants.OK_ID, "OK", false);
	createButton(parent, IDialogConstants.CANCEL_ID, "Cancel", false);
}
 
Example #2
Source File: XmlConvertManagerDialog.java    From translationstudio8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 编辑选中的元素 ;
 */
protected void editElement() {
	ISelection selection = tableViewer.getSelection();
	if (selection != null && !selection.isEmpty() && selection instanceof IStructuredSelection) {
		IStructuredSelection structuredSelection = (IStructuredSelection) selection;
		@SuppressWarnings("unchecked")
		Iterator<ElementBean> iter = structuredSelection.iterator();
		ElementBean bean = iter.next();

		AddOrEditElementOfXmlConvertDialog dialog = new AddOrEditElementOfXmlConvertDialog(getShell(), false,
				elementsList);
		dialog.create();
		dialog.setInitEditData(bean);
		int result = dialog.open();
		if (result == IDialogConstants.OK_ID) {
			refreshTable(dialog.getCurrentElement());
		}
	} else {
		MessageDialog.openInformation(getShell(), Messages.getString("dialogs.XmlConvertManagerDialog.msgTitle2"),
				Messages.getString("dialogs.XmlConvertManagerDialog.msg3"));
	}
}
 
Example #3
Source File: ImportBirtRuntimeAction.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Open confirm dialog
 * 
 * @param file
 * @return
 */
private int openDialog( final String file )
{
	final int[] result = {IDialogConstants.CANCEL_ID};
	shell.getDisplay( ).syncExec( new Runnable( ) {

		public void run( )
		{
			String title = BirtWTPMessages.BIRTOverwriteQuery_title;
			String msg = NLS.bind(
					BirtWTPMessages.BIRTOverwriteQuery_message, file );
			String[] options = {IDialogConstants.YES_LABEL,
					IDialogConstants.NO_LABEL,
					IDialogConstants.YES_TO_ALL_LABEL,
					IDialogConstants.CANCEL_LABEL};
			MessageDialog dialog = new MessageDialog( shell, title,
					null, msg, MessageDialog.QUESTION, options, 0 );
			result[0] = dialog.open( );
		}
	} );
	return result[0];
}
 
Example #4
Source File: TestDatabaseConnectorOutputMode.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
@Test
public void testPatternExpressionViewer() {
    SWTBotTestUtil.createNewDiagram(bot);
    bot.viewById(SWTBotTestUtil.VIEWS_PROPERTIES_PROCESS_DATA).show();
    SWTBotTestUtil.selectTabbedPropertyView(bot, SWTBotConstants.VIEWS_PROPERTIES_POOL_DATA_VARIABLES);
    bot.buttonWithId(SWTBotConstants.SWTBOT_ID_ADD_PROCESS_DATA).click();
    SWTBotTestUtil.addNewData(bot, DATA_NAME_1, "Text", false, null);
    final String connectorLabel = getConnectorLabel(JDBC_DB_CONNECTOR_ID);
    final String connectorVersion = getConnectorVersion(JDBC_DB_CONNECTOR_ID);
    final String[] dbCategoryLabel = getCategoryLabels(new String[] { DB_CATEGORY_ID, GENERIC_DB_CATEGORY_ID });
    addDBConnectorWithPatternExpression(connectorLabel, connectorVersion, dbCategoryLabel, "patternDBConnector");
    bot.styledText().setText(QUERY1);
    bot.button(IDialogConstants.NEXT_LABEL).click();

    checkEnalbledChoices();
}
 
Example #5
Source File: RuleConfigurationEditDialog.java    From eclipse-cs with GNU Lesser General Public License v2.1 6 votes vote down vote up
/**
 * @see org.eclipse.jface.dialogs.Dialog#buttonPressed(int)
 */
@Override
protected void buttonPressed(int buttonId) {
  if (IDialogConstants.BACK_ID == buttonId) {

    if (MessageDialog.openConfirm(getShell(),
            Messages.RuleConfigurationEditDialog_titleRestoreDefault,
            Messages.RuleConfigurationEditDialog_msgRestoreDefault)) {

      if (mRule.getMetaData().hasSeverity()) {
        mSeverityCombo.setSelection(
                new StructuredSelection(mRule.getMetaData().getDefaultSeverityLevel()));
        mCommentText.setText(new String());
      }

      // restore the default value for the properties
      int size = mConfigPropertyWidgets != null ? mConfigPropertyWidgets.length : 0;
      for (int i = 0; i < size; i++) {
        mConfigPropertyWidgets[i].restorePropertyDefault();
      }
    }
  } else {
    super.buttonPressed(buttonId);
  }
}
 
Example #6
Source File: ActorDefinitionTranslationsTest.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
private void createWidget(String widgetId, String widgetType, int inputIndex)
        throws Exception {
    SWTBotShell activeShell = bot.activeShell();
    bot.button("Add...").click();
    assertFalse("button ok should be disabled",
            bot.button(IDialogConstants.OK_LABEL).isEnabled());
    bot.textWithLabel("Widget id*").setText(widgetId);
    bot.comboBoxWithLabel("Widget type").setSelection(widgetType);
    if (!widgetType.equals("Group")) {
        bot.comboBoxWithLabel("Input *").setSelection(inputIndex);
    } else {
        assertFalse("inputs combo box should be disabled for Group widget",
                bot.comboBoxWithLabel("Input *").isEnabled());
    }
    assertTrue("button ok should be enabled",
            bot.button(IDialogConstants.OK_LABEL).isEnabled());
    bot.button(IDialogConstants.OK_LABEL).click();
    activeShell.setFocus();
}
 
Example #7
Source File: RelationOutlineEditPart.java    From ermaster-b with Apache License 2.0 6 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public void performRequest(Request request) {
	Relation relation = (Relation) this.getModel();

	if (request.getType().equals(RequestConstants.REQ_OPEN)) {
		Relation copy = relation.copy();

		RelationDialog dialog = new RelationDialog(PlatformUI
				.getWorkbench().getActiveWorkbenchWindow().getShell(), copy);

		if (dialog.open() == IDialogConstants.OK_ID) {
			ChangeRelationPropertyCommand command = new ChangeRelationPropertyCommand(
					relation, copy);
			this.execute(command);
		}
	}

	super.performRequest(request);
}
 
Example #8
Source File: RLSStreamConnectionProvider.java    From corrosion with Eclipse Public License 2.0 6 votes vote down vote up
private static void showSetupRustNotification() {
	Display.getDefault().asyncExec(() -> {
		if (hasCancelledSetup) {
			return;
		}
		setHasCancelledSetup(true);
		Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
		int dialogResponse = MessageDialog.open(MessageDialog.CONFIRM, shell,
				Messages.RLSStreamConnectionProvider_rustSupportNotFound,
				Messages.RLSStreamConnectionProvider_requirementsNotFound, SWT.NONE,
				Messages.RLSStreamConnectionProvider_OpenPreferences, IDialogConstants.CANCEL_LABEL); // $NON-NLS-4$
		if (dialogResponse == 0) {
			PreferenceDialog preferenceDialog = PreferencesUtil.createPreferenceDialogOn(shell,
					CorrosionPreferencePage.PAGE_ID, new String[] { CorrosionPreferencePage.PAGE_ID }, null);
			preferenceDialog.setBlockOnOpen(true);
			preferenceDialog.open();
			setHasCancelledSetup(false);
		}
	});
}
 
Example #9
Source File: BatchQADialog.java    From tmxeditor8 with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected void createButtonsForButtonBar(Composite parent) {
	// ROBERTHELP 品质检查
	String language = CommonFunction.getSystemLanguage();
	final String helpUrl = MessageFormat.format(
			"/net.heartsome.cat.ts.ui.help/html/{0}/ch05s04.html#translation-qa-check", language);
	setHelpUrl(helpUrl);
	
	installBtn = createButton(parent, IDialogConstants.CLIENT_ID,
			Messages.getString("qa.dialogs.BatchQADialog.name1"), false);
	
	super.createButtonsForButtonBar(parent);
	Button okBtn = getButton(IDialogConstants.OK_ID);
	okBtn.setText(Messages.getString("qa.all.dialog.ok"));
	Button cancelBtn = getButton(IDialogConstants.CANCEL_ID);
	cancelBtn.setText(Messages.getString("qa.all.dialog.cancel"));
	initLister(parent.getShell());
}
 
Example #10
Source File: CreateTablespaceAction.java    From ermaster-b with Apache License 2.0 6 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public void execute(Event event) {
	ERDiagram diagram = this.getDiagram();

	TablespaceDialog dialog = EclipseDBManagerFactory.getEclipseDBManager(
			diagram).createTablespaceDialog();
	if (dialog == null) {
		Activator
				.showMessageDialog("dialog.message.tablespace.not.supported");

	} else {
		dialog.init(null, diagram);

		if (dialog.open() == IDialogConstants.OK_ID) {
			CreateTablespaceCommand command = new CreateTablespaceCommand(
					diagram, dialog.getResult());
			this.execute(command);
		}
	}
}
 
Example #11
Source File: AddSourceFolderWizardPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Opens a path variable selection dialog
 */
private void handleVariablesButtonPressed() {
	int variableTypes = IResource.FOLDER;
	PathVariableSelectionDialog dialog = new PathVariableSelectionDialog(getShell(), variableTypes);
	dialog.setResource(fParent);
	if (dialog.open() == IDialogConstants.OK_ID) {
		String[] variableNames = (String[]) dialog.getResult();
		if (variableNames != null && variableNames.length == 1) {
			fLinkLocation.setText(variableNames[0]);
			fRootDialogField.setText(new Path(variableNames[0]).lastSegment());
			if (fAdapter != null) {
				fAdapter.dialogFieldChanged(fRootDialogField);
			}
		}
	}
}
 
Example #12
Source File: FindBugsAction.java    From spotbugs with GNU Lesser General Public License v2.1 6 votes vote down vote up
protected static void askUserToSwitch(IWorkbenchPart part, int warningsNumber) {
    final IPreferenceStore store = FindbugsPlugin.getDefault().getPreferenceStore();
    String message = "SpotBugs analysis finished, " + warningsNumber
            + " warnings found.\n\nSwitch to the SpotBugs perspective?";

    MessageDialogWithToggle dialog = MessageDialogWithToggle.openYesNoCancelQuestion(null, "SpotBugs analysis finished",
            message, "Remember the choice and do not ask me in the future", false, store,
            FindBugsConstants.ASK_ABOUT_PERSPECTIVE_SWITCH);

    boolean remember = dialog.getToggleState();
    int returnCode = dialog.getReturnCode();

    if (returnCode == IDialogConstants.YES_ID) {
        if (remember) {
            store.setValue(FindBugsConstants.SWITCH_PERSPECTIVE_AFTER_ANALYSIS, true);
        }
        switchPerspective(part);
    } else if (returnCode == IDialogConstants.NO_ID) {
        if (remember) {
            store.setValue(FindBugsConstants.SWITCH_PERSPECTIVE_AFTER_ANALYSIS, false);
        }
    }
}
 
Example #13
Source File: JoinSessionWizard.java    From saros with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void createPageControls(Composite pageContainer) {
  descriptionPage.createControl(pageContainer);

  if (getContainer() instanceof WizardDialogAccessable) {
    ((WizardDialogAccessable) getContainer())
        .setWizardButtonLabel(IDialogConstants.FINISH_ID, Messages.JoinSessionWizard_accept);
  }

  isn.addCancelListener(cancelListener);

  if (isn.isCanceled()) {
    /*
     * FIXME error message is only available after negotiation
     * termination, but in most cases it should be null at this point
     * anyway
     */
    handleCanceledAsync(
        isn.isLocalCancellation() ? CancelLocation.LOCAL : CancelLocation.REMOTE, null);
  }
}
 
Example #14
Source File: ProcessDataViewer.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
protected void moveData(final IStructuredSelection structuredSelection) {
    final DataAware container = (DataAware) getDataContainerObservable().getValue();
    final MoveDataWizard moveDataWizard = new MoveDataWizard(container);
    if (createWizardDialog(moveDataWizard, IDialogConstants.FINISH_LABEL).open() == Dialog.OK) {
        final DataAware dataAware = moveDataWizard.getSelectedDataAwareElement();
        try {
            final MoveDataCommand cmd = new MoveDataCommand(TransactionUtil.getEditingDomain(dataAware), container,
                    structuredSelection.toList(), dataAware);
            OperationHistoryFactory.getOperationHistory().execute(cmd, null, null);

            if (!(cmd.getCommandResult().getStatus().getSeverity() == Status.OK)) {
                final List<Object> data = (List<Object>) cmd.getCommandResult().getReturnValue();
                String dataNames = "";
                for (final Object d : data) {
                    dataNames = dataNames + ((Element) d).getName() + ",";
                }
                dataNames = dataNames.substring(0, dataNames.length() - 1);
                MessageDialog.openWarning(Display.getDefault().getActiveShell(), Messages.PromoteDataWarningTitle,
                        Messages.bind(Messages.PromoteDataWarningMessage, dataNames));
            }

        } catch (final ExecutionException e1) {
            BonitaStudioLog.error(e1);
        }
    }
}
 
Example #15
Source File: TestLoadSaveConnectorConfiguration.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
public void createConnector(final String connectorDefinitionId) {
    final String widgetId = "textWidget";
    final String pageId = "connectorDefPageId";
    SWTBotConnectorTestUtil.activateConnectorDefinitionShell(bot);
    SWTBotShell activeShell = bot.activeShell();
    bot.textWithLabel("Definition id *").setText(connectorDefinitionId);
    bot.button(IDialogConstants.NEXT_LABEL).click();
    bot.button("Add...").click();
    bot.button(IDialogConstants.NEXT_LABEL).click();
    bot.button("Add...").click();
    bot.textWithLabel("Page id *").setText(pageId);
    bot.button("Add...").click();
    bot.textWithLabel("Widget id*").setText(widgetId);
    bot.textWithLabel("Display name").setText("text");
    bot.comboBoxWithLabel("Widget type").setSelection("Text");
    bot.comboBoxWithLabel("Input *").setSelection(0);
    bot.button(IDialogConstants.OK_LABEL).click();
    activeShell.setFocus();
    bot.button("Apply").click();
    bot.button(IDialogConstants.NEXT_LABEL).click();
    bot.button("Add...").click();
    bot.button(IDialogConstants.FINISH_LABEL).click();
}
 
Example #16
Source File: ValidationDialog.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected Control createButtonBar(Composite parent) {
	Composite blank = new Composite(parent, SWT.NONE);
	blank.setLayoutData(new GridData(1,1));
	Composite buttonbar = new Composite(parent, SWT.None);
	buttonbar.setLayout(new GridLayout(3,false));
	buttonbar.setLayoutData(new GridData(SWT.RIGHT, SWT.FILL, false, false));
	if(messageType == YES_NO_SEEDETAILS || messageType == YES_NO){
		super.createButton(buttonbar, YES, IDialogConstants.YES_LABEL, false);	
		super.createButton(buttonbar, NO, IDialogConstants.NO_LABEL, true);
	}
	if(messageType == OK_SEEDETAILS || messageType == OK_ONLY){
		super.createButton(buttonbar, OK, IDialogConstants.OK_LABEL, true);
	}
	if(messageType == YES_NO_SEEDETAILS || messageType == OK_SEEDETAILS ){
		super.createButton(buttonbar, SEE_DETAILS, seeDetails, false);
	}
	return buttonBar;
}
 
Example #17
Source File: DiagramProjectExplorerBot.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
public void renameDiagram(String oldDiagramName, String newDiagramName, String version, String newPoolName) {
    clickOnContextualMenu(getDiagramTreeItem(oldDiagramName, version), "Rename...");
    bot.waitUntil(Conditions.shellIsActive(org.bonitasoft.studio.common.Messages.openNameAndVersionDialogTitle));
    SWTBotShell activeShell = bot.activeShell();
    activeShell.setFocus();
    bot.textWithId("org.bonitasoft.studio.common.diagram.dialog.name.text").setText(newDiagramName);
    bot.textWithId("org.bonitasoft.studio.common.diagram.dialog.poolName.text").setText(newPoolName);
    bot.button(IDialogConstants.OK_LABEL).click();
    bot.waitUntil(Conditions.shellCloses(activeShell));
}
 
Example #18
Source File: EmacsPlusPreferencePage.java    From e4macs with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Pop up a message dialog to request the restart of the workbench
 */
private void requestRestart(String rePreference) {

	String reMessage = EmacsPlusActivator.getString("EmacsPlusPref_RestartMessage");	//$NON-NLS-1$ 
	IProduct product = Platform.getProduct();
	String productName = product != null && product.getName() != null ? product.getName() : 
		EmacsPlusActivator.getString("EmacsPlusPref_DefaultProduct");	//$NON-NLS-1$ 

	final String msg = String.format(reMessage, productName,rePreference);
	final String reTitle = EmacsPlusActivator.getString("EmacsPlusPref_RestartTitle");	//$NON-NLS-1$ 
	
	PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
		public void run() {
			if (PlatformUI.getWorkbench().isClosing())
				return;
			// yes == 0, no == 1
			MessageDialog dialog = new MessageDialog(getDefaultShell(),reTitle,null,msg, MessageDialog.QUESTION ,
					new String[] {IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL}, 0);
			if (dialog.open() != Window.CANCEL) {
				if (dialog.getReturnCode() == 0) {
					// restart workbench
					PlatformUI.getWorkbench().restart();
				}
			}
		}
	});
}
 
Example #19
Source File: EditAllAttributesAction.java    From ermaster-b with Apache License 2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public void execute(Event event) {
	ERDiagram diagram = this.getDiagram();

	EditAllAttributesDialog dialog = new EditAllAttributesDialog(PlatformUI
			.getWorkbench().getActiveWorkbenchWindow().getShell(), diagram);

	if (dialog.open() == IDialogConstants.OK_ID) {
		DiagramContents newDiagramContents = dialog.getDiagramContents();
		EditAllAttributesCommand command = new EditAllAttributesCommand(
				diagram, newDiagramContents);
		this.execute(command);
	}
}
 
Example #20
Source File: AlreadyExistsDialog.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
private void initializeComposite(Composite parent)
{
	fComposite = new Composite(parent, SWT.NULL);

	final GridLayout layout = new GridLayout();
	layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
	layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
	layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
	layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
	layout.numColumns = NUM_COLUMNS;

	fComposite.setLayout(layout);
}
 
Example #21
Source File: UserPromptDialog.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
public Button createButton(Composite parent, int id, String label, boolean isDefault) {
	Button button = super.createButton(parent, id, label, isDefault);
	if (id == IDialogConstants.OK_ID) {
	    okButton = button;
	    okButton.setEnabled(true);
	}
	return button;
}
 
Example #22
Source File: ProcessDataViewer.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void editData() {
    final IStructuredSelection selection = getStructuredSelection();
    if (onlyOneElementSelected(selection)) {
        final Data selectedData = (Data) selection.getFirstElement();;
        createWizardDialog(dataWizardFactory.createEditWizard(TransactionUtil.getEditingDomain(selectedData),
                selectedData), IDialogConstants.OK_LABEL).open();
    }
}
 
Example #23
Source File: ConnectorPropertyTest.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
private void createData(String dataName) {
    SWTBotTestUtil.selectTabbedPropertyView(bot, "Data");
    bot.button("Add...").click();
    assertFalse(IDialogConstants.FINISH_LABEL + " should be disabled", bot
            .button(IDialogConstants.FINISH_LABEL).isEnabled());
    bot.textWithLabel("Name").setText(dataName);
    assertTrue(IDialogConstants.FINISH_LABEL + " should be disabled", bot
            .button(IDialogConstants.FINISH_LABEL).isEnabled());
    bot.button(IDialogConstants.FINISH_LABEL).click();
}
 
Example #24
Source File: DataWizardIT.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
@Test
public void testCreateDataWithExistingId() {
    //Add the data myData on pool
    final String dataName = "myData_ToTestCreateDataWithExistingId";
    final String dataName1 = "myData_ToTestCreateDataWithExistingId1";
    final BotApplicationWorkbenchWindow botApplicationWorkbenchWindow = new BotApplicationWorkbenchWindow(bot);
    final BotProcessDiagramPerspective diagramPerspective = botApplicationWorkbenchWindow.createNewDiagram();
    final BotProcessDiagramPropertiesViewFolder diagramPropertiesPart = diagramPerspective.getDiagramPropertiesPart();
    bot.viewById(SWTBotTestUtil.VIEWS_PROPERTIES_PROCESS_DATA).show();
    bot.viewById(SWTBotTestUtil.VIEWS_PROPERTIES_PROCESS_DATA).setFocus();
    final BotDataPropertySection dataTab = diagramPropertiesPart.selectDataTab().selectPoolDataTab();

    BotAddDataWizardPage addDataDialog = dataTab.addData();

    addDataDialog.setName(dataName);
    addDataDialog.finish();

    //try to add a data myData on step
    diagramPerspective.activeProcessDiagramEditor().selectElement("Step1");
    addDataDialog = diagramPropertiesPart.selectDataTab().selectLocalDataTab().addData();;
    addDataDialog.setName(dataName);
    assertThat(bot.button(IDialogConstants.FINISH_LABEL).isEnabled()).isFalse();
    addDataDialog.setName(dataName1);
    addDataDialog.finish();

    //add a second task and add a data named myData1
    diagramPerspective.activeProcessDiagramEditor().addElement("Step1", "Human", PositionConstants.EAST);
    addDataDialog = diagramPropertiesPart.selectDataTab().selectLocalDataTab().addData();
    addDataDialog.setName(dataName1);
    addDataDialog.finish();
}
 
Example #25
Source File: KeySelectorDialog.java    From neoscada with Eclipse Public License 1.0 5 votes vote down vote up
@Override
protected void createButtonsForButtonBar ( final Composite parent )
{
    super.createButtonsForButtonBar ( parent );

    this.unlockButton = createButton ( parent, IDialogConstants.INTERNAL_ID, Messages.KeySelectorDialog_ButtonUnlock_Text, false );
}
 
Example #26
Source File: VarNamePicker.java    From XPagesExtensionLibrary with Apache License 2.0 5 votes vote down vote up
@Override
public String callDialog(CompositeEditor parent, String value) {
    VarPickerDialog dialog = new VarPickerDialog(parent, value);
    int result = dialog.open();
    if (result == IDialogConstants.OK_ID) {
        return dialog.getDialogValue();
    }
    return value;
}
 
Example #27
Source File: AddOrEditNontransElementDialog.java    From tmxeditor8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void createButtonsForButtonBar(Composite parent) {
	super.createButtonsForButtonBar(parent);
	Button okBtn = getButton(IDialogConstants.OK_ID);
	okBtn.setText(Messages.getString("qa.preference.NonTranslationQAPage.enterBtn"));
	
	Button cancelBtn = getButton(IDialogConstants.CANCEL_ID);
	cancelBtn.setText(Messages.getString("qa.preference.NonTranslationQAPage.cancelBtn"));
}
 
Example #28
Source File: TermDbManagerDialog.java    From translationstudio8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create contents of the button bar.
 * @param parent
 */
@Override
protected void createButtonsForButtonBar(Composite parent) {
	if (dialogType == TYPE_DBMANAGE) {
		createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CLOSE_LABEL, false);
	} else {
		super.createButtonsForButtonBar(parent);
	}

	getShell().setDefaultButton(searchBtn);
	initDataBindings();
}
 
Example #29
Source File: ChangeTrackingDialog.java    From ermaster-b with Apache License 2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
protected void buttonPressed(int buttonId) {
	if (buttonId == IDialogConstants.CLOSE_ID) {
		setReturnCode(buttonId);
		close();
	}

	super.buttonPressed(buttonId);
}
 
Example #30
Source File: ModifyDialogTabPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
protected GridLayout createGridLayout(int numColumns, boolean margins) {
	final GridLayout layout= new GridLayout(numColumns, false);
	layout.verticalSpacing= fPixelConverter.convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
	layout.horizontalSpacing= fPixelConverter.convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
	if (margins) {
		layout.marginHeight= fPixelConverter.convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
		layout.marginWidth= fPixelConverter.convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
	} else {
		layout.marginHeight= 0;
		layout.marginWidth= 0;
	}
	return layout;
}