List of usage examples for org.eclipse.jface.dialogs IDialogConstants IGNORE_ID
int IGNORE_ID
To view the source code for org.eclipse.jface.dialogs IDialogConstants IGNORE_ID.
Click Source Link
From source file:cn.ieclipse.pde.signer.wizard.KeyAliasDialog.java
License:Apache License
/** * Create contents of the button bar./* ww w .j a v a2 s. c o m*/ * * @param parent */ @Override protected void createButtonsForButtonBar(Composite parent) { if (this.item != null) { createButton(parent, IDialogConstants.RETRY_ID, "&Delete", false); createButton(parent, IDialogConstants.IGNORE_ID, "&Export", true); } else { createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); } createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); }
From source file:cn.ieclipse.pde.signer.wizard.KeyAliasDialog.java
License:Apache License
@Override protected void buttonPressed(int buttonId) { if (IDialogConstants.RETRY_ID == buttonId) {// delete if (delKey()) { setReturnCode(-1);//from www.j a v a 2 s.c om close(); } } else if (IDialogConstants.IGNORE_ID == buttonId) {// export exportKey(); } super.buttonPressed(buttonId); }
From source file:com.aptana.ide.core.ui.dialogs.AptanaSignInDialog.java
License:Open Source License
/** * @see org.eclipse.jface.dialogs.TrayDialog#createButtonBar(org.eclipse.swt.widgets.Composite) *///from ww w . ja v a 2 s . c o m protected void createButtonsForButtonBar(Composite parent) { if (allowAnonymous) { createButton(parent, IDialogConstants.IGNORE_ID, Messages.AptanaSignInDialog_LBL_Anonymous, false); } super.createButtonsForButtonBar(parent); getButton(IDialogConstants.OK_ID).setText(Messages.AptanaSignInWidget_LBL_SignIn); getButton(IDialogConstants.OK_ID).setEnabled(false); }
From source file:com.aptana.ide.core.ui.dialogs.AptanaSignInDialog.java
License:Open Source License
/** * @see org.eclipse.jface.dialogs.Dialog#buttonPressed(int) *//*from w ww . java2s . c om*/ protected void buttonPressed(int buttonId) { if (IDialogConstants.IGNORE_ID == buttonId) { setReturnCode(IDialogConstants.IGNORE_ID); close(); } else { super.buttonPressed(buttonId); } }
From source file:com.google.gdt.eclipse.designer.gxt.model.property.MarginsPropertyEditor.java
License:Open Source License
@Override protected void openDialog(Property property) throws Exception { // prepare Margins to edit Margins margins;//from ww w . jav a 2s . c om { Object value = property.getValue(); if (Margins.isMargins(value)) { margins = new Margins(value); } else { margins = new Margins(); } } // prepare dialog MarginsDialog dialog = new MarginsDialog(property.getTitle(), margins); // open dialog int result = dialog.open(); if (result == IDialogConstants.IGNORE_ID) { property.setValue(Property.UNKNOWN_VALUE); } else if (result == IDialogConstants.OK_ID) { property.setValue(margins); } }
From source file:com.motorola.studio.android.launch.ui.StartedInstancesDialog.java
License:Apache License
@Override protected void createButtonsForButtonBar(Composite parent) { // create OK, Ignore and Abort buttons okButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); ignoreButton = createButton(parent, IDialogConstants.IGNORE_ID, IDialogConstants.IGNORE_LABEL, false); abortButton = createButton(parent, IDialogConstants.ABORT_ID, IDialogConstants.ABORT_LABEL, false); ignoreButton.addMouseListener(new MouseListener() { public void mouseUp(MouseEvent e) { setReturnCode(IDialogConstants.IGNORE_ID); close();//from w w w. j a v a2s . c o m } public void mouseDown(MouseEvent e) { //do nothing } public void mouseDoubleClick(MouseEvent e) { //do nothing } }); abortButton.addMouseListener(new MouseListener() { public void mouseUp(MouseEvent e) { setReturnCode(IDialogConstants.ABORT_ID); close(); } public void mouseDown(MouseEvent e) { //do nothing } public void mouseDoubleClick(MouseEvent e) { //do nothing } }); }
From source file:com.nokia.s60tools.compatibilityanalyser.ui.dialogs.BaselineEditor.java
License:Open Source License
protected void createButtonsForButtonBar(Composite parent) { saveBtn = this.createButton(parent, IDialogConstants.OK_ID, Messages.getString("BaselineEditor.SaveOK"), //$NON-NLS-1$ true);//from w w w .j av a2 s .co m saveBtn.addSelectionListener(this); deleteBtn = this.createButton(parent, IDialogConstants.IGNORE_ID, Messages.getString("BaselineEditor.Delete"), false); //$NON-NLS-1$ deleteBtn.addSelectionListener(this); cancelBtn = this.createButton(parent, IDialogConstants.CANCEL_ID, Messages.getString("BaselineEditor.Cancel"), false); //$NON-NLS-1$ cancelBtn.addSelectionListener(this); //It shows the information of the profile using the given profile name. //If that profile name is not valid then it is deleted from the list. if (selectedProfile != null) { openBaselineProfileIfExists(selectedProfile); } else { openBaselineProfileIfExists(profileCmb.getText()); } //Exclude hdr directories list GridData d = (GridData) hdr_dirs_comp.getLayoutData(); d.exclude = !radio_Hdr_dir.getSelection(); hdr_dirs_comp.setVisible(radio_Hdr_dir.getSelection()); //Exclude list of build targets for the first time GridData data = (GridData) list_build_Config.getLayoutData(); data.exclude = !radio_build_target.getSelection(); list_build_Config.setVisible(radio_build_target.getSelection()); //Exlude dll/dso path tabs for the first time GridData exData = (GridData) dllPaths_Folder.getLayoutData(); exData.exclude = !radio_dir_Libs.getSelection(); dllPaths_Folder.setVisible(radio_dir_Libs.getSelection()); if (hdrGrp != null && shell != null) { hdrGrp.layout(); shell.layout(); } }
From source file:com.nokia.s60tools.compatibilityanalyser.ui.dialogs.BaselineEditor.java
License:Open Source License
protected void buttonPressed(int buttonId) { if (buttonId == IDialogConstants.OK_ID) { setReturnCode(IDialogConstants.OK_ID); } else if (buttonId == IDialogConstants.CANCEL_ID) { setReturnCode(IDialogConstants.CANCEL_ID); } else if (buttonId == IDialogConstants.IGNORE_ID) { //For Delete button, IGNORE_ID is been used. setReturnCode(IDialogConstants.IGNORE_ID); }//w w w .j a va 2s . co m }
From source file:com.nokia.s60tools.compatibilityanalyser.ui.wizards.ProductSDKSelectionPage.java
License:Open Source License
public void widgetSelected(SelectionEvent e) { if ((e.widget == headersButton) || (e.widget == libsButton)) { this.getContainer().updateButtons(); } else if (e.widget == configure) { BaselineEditor dd = null;/*from w w w . j a va2 s .c om*/ if (profileCombo.getSelectionIndex() == 0) dd = new BaselineEditor(Display.getDefault().getActiveShell(), null); else dd = new BaselineEditor(Display.getDefault().getActiveShell(), profileCombo.getText()); dd.setBlockOnOpen(true); int status = dd.open(); if (status == IDialogConstants.OK_ID) { profileCombo.setItems(basics); String[] updatedProfiles = BaselineProfileUtils.getAllBaselinesProfiles(); if (updatedProfiles != null) { for (int i = 0; i < updatedProfiles.length; i++) if (profileCombo.indexOf(updatedProfiles[i]) == -1) { profileCombo.add(updatedProfiles[i]); } if (updatedProfiles.length > 0) { if (profileCombo.indexOf(updatedProfiles[0]) != -1) { Object obj = BaselineProfileUtils.getBaselineProfileData(updatedProfiles[0]); if (obj instanceof BaselineProfile && ((BaselineProfile) obj).isUpdated()) profileCombo.select(profileCombo.indexOf(updatedProfiles[0])); else profileCombo.select(0); } } } else profileCombo.select(0); } else if (status == IDialogConstants.IGNORE_ID) { profileCombo.setItems(basics); String[] updatedProfiles = BaselineProfileUtils.getAllBaselinesProfiles(); if (updatedProfiles != null) for (int i = 0; i < updatedProfiles.length; i++) if (profileCombo.indexOf(updatedProfiles[i]) == -1) profileCombo.add(updatedProfiles[i]); profileCombo.select(0); } engine.setBaselineProfile(profileCombo.getText()); this.getContainer().updateButtons(); } else if (e.widget == profileCombo) { this.setMessage(null); Object obj = BaselineProfileUtils.getBaselineProfileData(profileCombo.getText()); if (obj instanceof BaselineProfile) { BaselineProfile pro = (BaselineProfile) obj; if (pro.isPredefined()) { if (!pro.isUpdated()) { targetPath = "c:\\apps\\ca-baselines\\" + pro.getProfileName(); targetURL = pro.getSdkUrl(); IRunnableWithProgress op = new IRunnableWithProgress() { public void run(IProgressMonitor monitor) { if (new File(targetPath).exists()) FileMethods.deleteFolder(targetPath); downloadStatus = CompatibilityAnalyserEngine.downloadAndExtractFileFromWebServer( targetURL, targetPath, CompatibilityAnalyserEngine.ElementTypes.FolderType, "include", monitor); } }; IWorkbench wb = PlatformUI.getWorkbench(); IWorkbenchWindow win = wb.getActiveWorkbenchWindow(); Shell shell = win != null ? win.getShell() : null; try { new ProgressMonitorDialog(shell).run(true, true, op); } catch (InvocationTargetException err) { err.printStackTrace(); } catch (InterruptedException err) { err.printStackTrace(); } if (downloadStatus == null) { File epocRoot = new File(CompatibilityAnalyserEngine.getEpocFolderPath()); BaselineProfile profile = (BaselineProfile) obj; profile.setSdkName(profile.getProfileName()); profile.setRadio_default_hdr(true); profile.setRadio_dir_hdr(false); profile.setRadio_default_build_target(true); profile.setRadio_build_target(false); profile.setRadio_dir_libs(false); profile.setSdkEpocRoot( FileMethods.appendPathSeparator(epocRoot.getParentFile().getAbsolutePath())); profile.setUpdated(true); BaselineProfileUtils.saveProfileOnFileSystem(profile); prevData.saveValue(SavingUserData.ValueTypes.PROFILENAME, profile.getProfileName()); } else { profileCombo.select(0); MessageDialog.openError(this.getShell(), "Compatibility Analyser", downloadStatus); downloadStatus = null; } } } engine.setBaselineProfile(profileCombo.getText()); } this.getContainer().updateButtons(); } }
From source file:de.jcup.egradle.eclipse.ui.MultipleInputDialog.java
License:Apache License
protected void createBrowseField(String labelText, String initialValue, boolean allowEmpty) { Label label = new Label(panel, SWT.NONE); label.setText(labelText);//from ww w. j ava2 s. com label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING)); Composite comp = new Composite(panel, SWT.NONE); GridLayout layout = new GridLayout(); layout.marginHeight = 0; layout.marginWidth = 0; comp.setLayout(layout); comp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); final Text text = new Text(comp, SWT.SINGLE | SWT.BORDER); GridData data = new GridData(GridData.FILL_HORIZONTAL); data.widthHint = 200; text.setLayoutData(data); text.setData(FIELD_NAME, labelText); // make sure rows are the same height on both panels. label.setSize(label.getSize().x, text.getSize().y); if (initialValue != null) { text.setText(initialValue); } if (!allowEmpty) { validators.add(new Validator() { @Override public boolean validate() { return !text.getText().equals(EMPTY_STRING); } }); text.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent e) { validateFields(); } }); } Button button = createButton(comp, IDialogConstants.IGNORE_ID, "&Browse...", false); button.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { DirectoryDialog dialog = new DirectoryDialog(getShell()); dialog.setMessage("Select a file:"); String currentWorkingDir = text.getText(); if (!currentWorkingDir.trim().equals(EMPTY_STRING)) { File path = new File(currentWorkingDir); if (path.exists()) { dialog.setFilterPath(currentWorkingDir); } } String selectedDirectory = dialog.open(); if (selectedDirectory != null) { text.setText(selectedDirectory); } } }); controlList.add(text); }