List of usage examples for org.eclipse.jface.dialogs IMessageProvider ERROR
int ERROR
To view the source code for org.eclipse.jface.dialogs IMessageProvider ERROR.
Click Source Link
From source file:ag.ion.noa4e.ui.wizards.application.LocalApplicationWizardDefinePage.java
License:LGPL
/** * Checks page state.//from w w w .j av a 2s . c om * * @author Andreas Brker */ private void checkPageState() { System.out.println("LOAWDP: checkPageState"); String home = textHome.getText(); if (home.length() != 0) { File file = new File(home); if (file.canRead()) { try { IApplicationAssistant applicationAssistant = OfficeApplicationRuntime .getApplicationAssistant(EditorCorePlugin.getDefault().getLibrariesLocation()); ILazyApplicationInfo applicationInfo = applicationAssistant.findLocalApplicationInfo(home); if (applicationInfo == null) { setPageComplete(true); setMessage(Messages.LocalApplicationWizardDefinePage_message_warning_path_invalid, IMessageProvider.WARNING); } else { if (applicationInfo.getMajorVersion() == 1 && applicationInfo.getMinorVersion() == 9) { setPageComplete(true); setMessage(Messages.LocalApplicationWizardDefinePage_message_warning_beta_release, IMessageProvider.WARNING); } else if (applicationInfo.getMajorVersion() == 1) { setPageComplete(true); setMessage(Messages.LocalApplicationWizardDefinePage_message_warning_version_old, IMessageProvider.WARNING); } else { setPageComplete(true); setMessage(null); } } } catch (Throwable throwable) { setPageComplete(true); setMessage(null); } } else { setPageComplete(false); setMessage(Messages.LocalApplicationWizardDefinePage_message_error_path_not_available, IMessageProvider.ERROR); } } else { setPageComplete(false); setMessage(null); } }
From source file:amltransformation.dialogs.ImportRemoteAMLDialog.java
License:Open Source License
private void createFileNameComposite(Composite container) { Composite top = new Composite(container, SWT.NONE); top.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create()); top.setLayout(GridLayoutFactory.fillDefaults().margins(5, 5).equalWidth(false).numColumns(4).create()); Label lbtFirstName = new Label(top, SWT.NONE); lbtFirstName.setText("File name:"); lbtFirstName.setLayoutData(GridDataFactory.swtDefaults().create()); fileNameText = new Text(top, SWT.BORDER); fileNameText//from w w w .j a va2 s . c o m .setLayoutData(GridDataFactory.swtDefaults().align(SWT.FILL, SWT.FILL).grab(true, false).create()); fileNameText.setText(initialAMLFileSearchString); Button button = new Button(top, SWT.PUSH); button.setLayoutData(GridDataFactory.swtDefaults().create()); button.setText("Choose"); button.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { try { viewer.setInput(getFileList()); } catch (RemoteException e1) { setMessage("Couldn't obtain file list. Please check credentials! See log for more details.", IMessageProvider.ERROR); // TODO log! e1.printStackTrace(); } viewer.refresh(); } }); }
From source file:at.bestsolution.efxclipse.tooling.fxgraph.ui.wizards.FXGraphWizardPage.java
License:Open Source License
protected void revalidate() { if (getClazz().getName() == null || getClazz().getName().trim().length() == 0) { setPageComplete(false);/* w ww.j a va 2 s . com*/ setMessage("Enter a name", IMessageProvider.ERROR); } else if (Character.isLowerCase(getClazz().getName().charAt(0))) { setPageComplete(true); setMessage("An FXGraph file should start with an uppercase", IMessageProvider.WARNING); } else { setPageComplete(true); setMessage(null); } }
From source file:at.bestsolution.efxclipse.tooling.fxml.wizards.FXMLWizardPage.java
License:Open Source License
protected void revalidate() { if (getClazz().getName() == null || getClazz().getName().trim().length() == 0) { setPageComplete(false);//from ww w .j av a2 s. c om setMessage("Enter a name", IMessageProvider.ERROR); } else if (Character.isLowerCase(getClazz().getName().charAt(0))) { setPageComplete(true); setMessage("An FXML file should start with an uppercase", IMessageProvider.WARNING); } else { setPageComplete(true); setMessage(null); } }
From source file:at.bestsolution.efxclipse.tooling.ui.wizards.AbstractHtmlElementPage.java
License:Open Source License
protected void revalidate() { if (getClazz().getName() == null || getClazz().getName().trim().length() == 0) { setPageComplete(false);//from ww w .ja v a 2s.c om setMessage("Enter a name", IMessageProvider.ERROR); } else { setPageComplete(true); setMessage(null); } }
From source file:at.rc.tacos.client.editors.AddressEditor.java
License:Open Source License
@Override public void doSave(IProgressMonitor arg0) { // reset error message form.setMessage(null, IMessageProvider.NONE); // name must be provided if (street.getText().trim().isEmpty()) { form.getDisplay().beep();//w w w.j av a 2 s . co m form.setMessage("Bitte geben Sie den Namen der Strae eine", IMessageProvider.ERROR); return; } address.setStreet(street.getText()); // city must be provided if (city.getText().trim().isEmpty()) { form.getDisplay().beep(); form.setMessage("Bittge geben Sie den Namen der Stadt ein", IMessageProvider.ERROR); return; } address.setCity(city.getText()); // zip must be provided and a number if (zip.getText().trim().isEmpty()) { form.getDisplay().beep(); form.setMessage("Bitte geben Sie das Gemeindekennzeichen ein", IMessageProvider.ERROR); return; } // validate the zip String pattern = "6\\d{4}"; if (!zip.getText().matches(pattern)) { form.getDisplay().beep(); form.setMessage("Bitte geben Sie ein gltiges Gemeindekennzeichen in der Form 6xxxx ein", IMessageProvider.ERROR); return; } address.setZip(Integer.valueOf(zip.getText())); // add or update the staff member and the login if (isNew) { NetWrapper.getDefault().sendAddMessage(Address.ID, address); } else { NetWrapper.getDefault().sendUpdateMessage(Address.ID, address); } }
From source file:at.rc.tacos.client.editors.CompetenceEditor.java
License:Open Source License
@Override public void doSave(IProgressMonitor monitor) { // reset error message form.setMessage(null, IMessageProvider.NONE); // name must be provided and because of the varchar(30) in the database, // mustn't have a length more than 30 characters if (name.getText().length() > 30 || name.getText().trim().isEmpty()) { form.getDisplay().beep();/*from w w w.j a v a 2 s. com*/ form.setMessage("Bitte geben sie eine gltige Bezeichnung fr die Kompetenz ein (max. 30 Zeichen)", IMessageProvider.ERROR); return; } competence.setCompetenceName(name.getText()); // create new or send update request if (isNew) NetWrapper.getDefault().sendAddMessage(Competence.ID, competence); else NetWrapper.getDefault().sendUpdateMessage(Competence.ID, competence); }
From source file:at.rc.tacos.client.editors.DiseaseEditor.java
License:Open Source License
@Override public void doSave(IProgressMonitor monitor) { // reset error message form.setMessage(null, IMessageProvider.NONE); // name must be provided if (name.getText().length() > 30 || name.getText().trim().isEmpty()) { form.getDisplay().beep();//from w w w .j ava 2 s .c o m form.setMessage("Bitte geben sie eine gltige Bezeichnung fr die Erkrankung an (max. 30 Zeichen)", IMessageProvider.ERROR); return; } disease.setDiseaseName(name.getText()); // add or update the disease if (isNew) NetWrapper.getDefault().sendAddMessage(Disease.ID, disease); else NetWrapper.getDefault().sendUpdateMessage(Disease.ID, disease); }
From source file:at.rc.tacos.client.editors.JobEditor.java
License:Open Source License
@Override public void doSave(IProgressMonitor monitor) { // reset error message form.setMessage(null, IMessageProvider.NONE); // name must be provided if (name.getText().length() > 30 || name.getText().trim().isEmpty()) { form.getDisplay().beep();/*from w w w .j a v a 2 s . co m*/ form.setMessage("Bitte geben sie eine gltige Bezeichnung fr die Verwendung an(max. 30 Zeichen)", IMessageProvider.ERROR); return; } job.setJobName(name.getText()); // add or update the job if (isNew) NetWrapper.getDefault().sendAddMessage(Job.ID, job); else NetWrapper.getDefault().sendUpdateMessage(Job.ID, job); }
From source file:at.rc.tacos.client.editors.LocationEditor.java
License:Open Source License
@Override public void doSave(IProgressMonitor monitor) { // reset error message form.setMessage(null, IMessageProvider.NONE); // save the name if (locationName.getText().length() > 30 || locationName.getText().trim().isEmpty()) { form.getDisplay().beep();/* w ww. j a v a 2 s. co m*/ form.setMessage("Bitte geben Sie eine gltige Bezeichnung fr die Ortsstelle ein(max. 30 Zeichen)", IMessageProvider.ERROR); return; } location.setLocationName(locationName.getText()); // save the street if (street.getText().length() > 30 || street.getText().trim().isEmpty()) { form.getDisplay().beep(); form.setMessage("Bitte geben Sie eine Strae ein", IMessageProvider.ERROR); return; } location.setStreet(street.getText()); // save the street number if (streetNumber.getText().length() > 10 || streetNumber.getText().trim().isEmpty()) { form.getDisplay().beep(); form.setMessage("Bitte geben Sie eine gltige Hausnummer ein(max. 10 Zeichen)", IMessageProvider.ERROR); return; } location.setStreetNumber(streetNumber.getText()); // save the city if (city.getText().trim().isEmpty()) { form.getDisplay().beep(); form.setMessage("Bitte geben Sie eine gltige Stadt ein(max. 30 Zeichen)", IMessageProvider.ERROR); return; } location.setCity(city.getText()); // save the zip if (zipCode.getText().trim().isEmpty()) { form.getDisplay().beep(); form.setMessage("Bitte geben Sie eine Postleitzahl ein", IMessageProvider.ERROR); return; } // validate the number String pattern = "\\d{4}"; if (!zipCode.getText().matches(pattern)) { form.getDisplay().beep(); form.setMessage("Bitte geben Sie eine gltige Postleitzahl ein", IMessageProvider.ERROR); return; } location.setZipcode(Integer.valueOf(zipCode.getText())); // the notes can be empty location.setNotes(notesViewer.getTextWidget().getText()); int index = phoneViewer.getCombo().getSelectionIndex(); if (index == -1) { form.getDisplay().beep(); form.setMessage("Bitte whlen Sie ein Telefon fr die Ortsstelle aus.\n" + "Neue Telefone knnen Sie im Administrationsbereich unter \"Mobiltelefone\" anlegen und dann der Ortsstelle zuweisen", IMessageProvider.ERROR); return; } location.setPhone((MobilePhoneDetail) phoneViewer.getElementAt(index)); // add or update the location if (isNew) NetWrapper.getDefault().sendAddMessage(Location.ID, location); else NetWrapper.getDefault().sendUpdateMessage(Location.ID, location); }