Example usage for org.eclipse.jface.dialogs IMessageProvider INFORMATION

List of usage examples for org.eclipse.jface.dialogs IMessageProvider INFORMATION

Introduction

In this page you can find the example usage for org.eclipse.jface.dialogs IMessageProvider INFORMATION.

Prototype

int INFORMATION

To view the source code for org.eclipse.jface.dialogs IMessageProvider INFORMATION.

Click Source Link

Document

Constant for an info message (value 1).

Usage

From source file:org.bbaw.pdr.ae.view.identifiers.dialogs.BrowserDialog.java

License:Open Source License

@Override
public final void create() {
    super.create();

    _currentPerson = _facade.getCurrentPerson();
    _requestType = _facade.getRequestedIdentifierType();

    // System.out.println("browser requestType " + _requestType);
    // choose what kind of identifier is requested.
    if (_requestType != null) {
        if (_requestType.equalsIgnoreCase("pnd")) //$NON-NLS-1$
        {//from w w w.  j ava  2 s.co m
            _message = NLMessages.getString("BrowserDialog_PNDnameFor");
        } else if (_requestType.equalsIgnoreCase("lccn")) //$NON-NLS-1$
        {
            _message = NLMessages.getString("BrowserDialog_LCCNnameFor");
        } else if (_requestType.equalsIgnoreCase("iccu")) //$NON-NLS-1$
        {
            _message = NLMessages.getString("BrowserDialog_ICCUnameFor");
        } else if (_requestType.equalsIgnoreCase("viaf")) //$NON-NLS-1$
        {
            _message = NLMessages.getString("BrowserDialog_VIAFnameFor");
        } else {
            _message = NLMessages.getString("BrowserDialog_errorMessageError");
        }
    }

    if (_currentPerson.getBasicPersonData() != null
            && _currentPerson.getBasicPersonData().getComplexNames() != null
            && _currentPerson.getBasicPersonData().getComplexNames().firstElement() != null) {
        if (_currentPerson.getBasicPersonData().getComplexNames().firstElement().getSurName() != null) {
            _message += _currentPerson.getBasicPersonData().getComplexNames().firstElement().getSurName()
                    + ", ";
        }
        if (_currentPerson.getBasicPersonData().getComplexNames().firstElement().getForeName() != null) {
            _message += _currentPerson.getBasicPersonData().getComplexNames().firstElement().getForeName();
        }
    }
    // Set the title
    setTitle(NLMessages.getString("BrowserDialog_titleExternalPersonIdentifier"));
    // set message
    setMessage(_message, IMessageProvider.INFORMATION);

}

From source file:org.bbaw.pdr.ae.view.main.dialogs.AdvancedSearchDialog.java

License:Open Source License

/**
 * @see org.eclipse.jface.dialogs.Dialog#create()
 *//*w  w  w .j a  v  a 2  s  .com*/
@Override
public final void create() {
    super.create();
    // Set the title
    setTitle(NLMessages.getString("AdvancedDialog_title")); //$NON-NLS-1$
    // Set the message
    setMessage(NLMessages.getString("Dialog_message"), IMessageProvider.INFORMATION); //$NON-NLS-1$

}

From source file:org.bbaw.pdr.ae.view.main.dialogs.ExpertSearchDialog.java

License:Open Source License

@Override
public final void create() {
    super.create();
    // Set the title
    setTitle(NLMessages.getString("ExpertDialog_title")); //$NON-NLS-1$
    // Set the message
    setMessage(NLMessages.getString("Dialog_message"), IMessageProvider.INFORMATION); //$NON-NLS-1$

}

From source file:org.bbaw.pdr.ae.view.main.dialogs.FilterSelectionDialog.java

License:Open Source License

@Override
public final void create() {
    super.create();

    // Set the title
    setTitle(NLMessages.getString("Dialog_filter_selection_dialog_title"));
    // Set the message
    if (_type.equals("reference")) {
        setMessage(NLMessages.getString("Dialog_message_select_references_filter"), //$NON-NLS-1$
                IMessageProvider.INFORMATION);
    } else if (_type.equals("semantic")) {
        setMessage(NLMessages.getString("Dialog_message_select_semantic_filter"), IMessageProvider.INFORMATION); //$NON-NLS-1$
    } else if (_type.startsWith("user")) {
        setMessage(NLMessages.getString("Dialog_message_select_user_filter"), IMessageProvider.INFORMATION); //$NON-NLS-1$
    } else if (_type.equals("person")) {
        setMessage(NLMessages.getString("Dialog_message_select_persons_filter"), IMessageProvider.INFORMATION); //$NON-NLS-1$
    } else if (_type.equals("year")) {
        setMessage(NLMessages.getString("Dialog_message_select_time_filter"), IMessageProvider.INFORMATION); //$NON-NLS-1$
    }/* ww w.  jav a2s.  co m*/

}

From source file:org.bbaw.pdr.ae.view.main.dialogs.LoginDialog.java

License:Open Source License

@Override
public final void create() {
    super.create();

    // Set the title
    setTitle(NLMessages.getString("LoginDialog_enterUserName")); //$NON-NLS-1$
    // Set the message
    setMessage(NLMessages.getString("LoginDialog_messagePleaseEnterUserName"), IMessageProvider.INFORMATION); //$NON-NLS-1$

}

From source file:org.bbaw.pdr.ae.view.main.editors.AspectEditorDialog.java

License:Open Source License

/**
 * laods values of current aspect throws exception because it commands the
 * the XMLProcessor to parse and load the xml-text of aspect. TODO add
 * missing fields to be loaded TODO alter XMLProcessor so that exceptions
 * are not thrown in dialog class./*from   w  ww.j  a v  a2s  .  c  o m*/
 * @throws SAXException sax exception
 * @throws IOException inout exception
 * @throws ParserConfigurationException sax parser exception
 */
private void loadValues() throws SAXException, IOException, ParserConfigurationException {
    Revision revision = new Revision();
    revision.setRevisor(new String(_facade.getCurrentUser().getDisplayName()));
    revision.setTimeStamp(_facade.getCurrentDate());
    revision.setAuthority(_facade.getCurrentUser().getPdrId().clone());
    if (_currentAspect.isNew()) {
        revision.setRef(0);
        Record record = new Record();
        record.getRevisions().add(revision);
        _currentAspect.setRecord(record);
    }

    _mayWrite = new UserRichtsChecker().mayWrite(_currentAspect);
    if (!_mayWrite) {
        setMessage("You may open this aspect but not modify it.");
    }
    // addFurtherClassifier.setEnabled(_mayWrite);
    _addBelongsToButton.setEnabled(_mayWrite);
    _addRelationsButton.setEnabled(_mayWrite);
    _addReferencesButton.setEnabled(_mayWrite);
    _addSpatialStmButton.setEnabled(_mayWrite);
    _addTimeStmButton.setEnabled(_mayWrite);
    _buttonTaggingSet.setEnabled(_mayWrite);
    _buttonTaggingInsertSet.setEnabled(_mayWrite);
    _buttonTaggingInsertMarkup.setEnabled(_mayWrite);

    _comboTaggingElement.setEnabled(_mayWrite);
    _comboTaggingType.setEnabled(_mayWrite);
    _comboTaggingSubtype.setEnabled(_mayWrite);
    _comboTaggingRole.setEnabled(_mayWrite);

    // textTaggingAna.setEditable(_mayWrite);
    _findAna.setEnabled(_mayWrite);
    _textTaggingKey.setEditable(_mayWrite);
    _findKey.setEnabled(_mayWrite);
    // contentText.setEditable(_mayWrite);

    _buttonTDate.setEnabled(_mayWrite);
    _buttonTDateRange.setEnabled(_mayWrite);
    _comboTDateAfter.setEnabled(_mayWrite);
    _comboTDateBefore.setEnabled(_mayWrite);
    _comboTDateDay.setEnabled(_mayWrite);
    _comboTDateMonth.setEnabled(_mayWrite);
    _comboTDatePointOT.setEnabled(_mayWrite);
    _comboTDateRangeFromDay.setEnabled(_mayWrite);
    _comboTDateRangeFromMonth.setEnabled(_mayWrite);
    _comboTDateRangeToDay.setEnabled(_mayWrite);
    _comboTDateRangeToMonth.setEnabled(_mayWrite);
    _spinnerTDateRangeFromYear.setEnabled(_mayWrite);
    _spinnerTDateRangeToYear.setEnabled(_mayWrite);
    _spinnerTDateYear.setEnabled(_mayWrite);

    _markupProvider = Platform.getPreferencesService().getString(CommonActivator.PLUGIN_ID,
            "PRIMARY_TAGGING_PROVIDER", AEConstants.TAGGING_LIST_PROVIDER, null).toUpperCase(); //$NON-NLS-1$
    _relationProvider = Platform.getPreferencesService().getString(CommonActivator.PLUGIN_ID,
            "PRIMARY_RELATION_PROVIDER", AEConstants.RELATION_CLASSIFICATION_PROVIDER, null).toUpperCase(); //$NON-NLS-1$
    _semanticProvider = Platform.getPreferencesService().getString(CommonActivator.PLUGIN_ID,
            "PRIMARY_SEMANTIC_PROVIDER", AEConstants.CLASSIFICATION_AUTHORITY, null).toUpperCase(); //$NON-NLS-1$
    String standard = "PDR";
    if (!_facade.getConfigs().containsKey(standard)) {
        for (String s : _facade.getConfigs().keySet()) {
            standard = s;
            break;
        }
    }
    if (!_facade.getConfigs().containsKey(_markupProvider)) {
        _markupProvider = standard;
    }

    if (!_facade.getConfigs().containsKey(_relationProvider)) {
        _relationProvider = standard;
    }

    if (!_facade.getConfigs().containsKey(_semanticProvider)) {
        _semanticProvider = standard;
    }
    _preferedYear = PRESELECTED_YEAR;
    _clasView = false;
    _sourceView = false;
    _relView = false;
    _timePlaceView = false;
    _frontViewed = false;
    _sourceViewed = false;
    _relViewed = false;
    _timePlaceViewed = false;

    AEConstants.getCurrentLocale().getLanguage();
    if (_currentAspect != null) {
        // Front
        _pdrID.setText(_currentAspect.getPdrId().toString());

        if ((_currentAspect.getRecord() != null) && !_currentAspect.getRecord().getRevisions().isEmpty()) {
            if (_currentAspect.getRecord().getRevisions().get(0).getRevisor() != null) {
                _creatorNameText.setText(_currentAspect.getRecord().getRevisions().get(0).getRevisor());
            } else {
                _creatorNameText.setText(_facade
                        .getObjectDisplayName(_currentAspect.getRecord().getRevisions().get(0).getAuthority()));
            }
            _creationTimeText.setText(
                    _adminDateFormat.format(_currentAspect.getRecord().getRevisions().get(0).getTimeStamp()));
            // creatorNameText.pack();
            // creationTimeText.pack();

            if (_currentAspect.getRecord().getRevisions().size() > 1) {
                if (_currentAspect.getRecord().getRevisions().lastElement().getAuthority() != null) {
                    _revisorName.setText(_facade.getObjectDisplayName(
                            _currentAspect.getRecord().getRevisions().lastElement().getAuthority()));
                } else {
                    _revisorName.setText("Revisor not found");
                }
                _revisionTimeText.setText(_adminDateFormat
                        .format(_currentAspect.getRecord().getRevisions().lastElement().getTimeStamp()));
            }
        } else {
            _creatorNameText.setText(_facade.getCurrentUser().getDisplayName());
            _creationTimeText.setText(_adminDateFormat.format(_facade.getCurrentDate()));
            _currentAspect.setNew(true);
        }
        if (_currentAspect.isNew()) {
            setMessage(_message, IMessageProvider.INFORMATION); //$NON-NLS-1$
        }

        _markupEditor.setAspect(_currentAspect);

        _markupEditor.setEditable(_mayWrite);

        if (_currentAspect.getRelationDim() != null) {
            loadRelationDim(0, null, null);
            if (_currentAspect.getRelationDim().getRelationStms().firstElement().getSubject()
                    .equals(_currentAspect.getPdrId())) {
                PdrId id = _currentAspect.getRelationDim().getRelationStms().firstElement().getRelations()
                        .firstElement().getObject();
                if (id != null) {
                    _textTaggingAna.setData("id", id.toString());
                    PdrObject o = _facade.getPdrObject(id);
                    if (o != null) {
                        _textTaggingAna.setText(o.getDisplayNameWithID());
                    }
                }
            } else {

                PdrId id = _currentAspect.getRelationDim().getRelationStms().firstElement().getSubject();
                if (id != null) {
                    _textTaggingAna.setData("id", id.toString());
                    PdrObject obj = _facade.getPdrObject(id);
                    if (obj != null) {
                        _textTaggingAna.setText(obj.getDisplayNameWithID());
                    }
                }
            }
        } else {
            loadRelationDim(5, null, null);
        }
        // Sources
        if (_currentAspect.getValidation() != null) {
            loadValidation(0, null);
        } else {
            loadValidation(1, null);
        }

        // TODO dynamisieren fr mehrere Labels!!!!!!!!!!!
        // Classification
        if (_currentAspect.getSemanticDim() != null) {
            loadClassification(0, null);
        } else {
            loadClassification(1, null);
        }

    }

    //      ((Composite)_markupEditor.getControl()).pack();
    //
    //      ((Composite)_markupEditor.getControl()).layout();
    //      _editorComposite.pack();
    //      _editorComposite.layout();
    System.out.println("end of load values - layout maintabfolder");
    //      _mainTabFolder.pack();
    //      _mainTabFolder.layout();
    //      _mainTabFolder.update();
    _frontComposite.layout();
}

From source file:org.bbaw.pdr.ae.view.main.editors.PersonEditorDialog.java

License:Open Source License

/**
 * loads values into fields.//from ww w  .j a  va 2  s  .c  om
 * @throws XQException
 */
private void loadValues() {
    Revision revision = new Revision();
    revision.setRevisor(new String(_facade.getCurrentUser().getDisplayName()));
    revision.setTimeStamp(_facade.getCurrentDate());
    revision.setAuthority(_facade.getCurrentUser().getPdrId().clone());
    if (_currentPerson.isNew()) {
        revision.setRef(0);
        Record record = new Record();
        record.getRevisions().add(revision);
        _currentPerson.setRecord(record);
    }

    _mayWrite = new UserRichtsChecker().mayWrite(_currentPerson);
    _addConcurrence.setEnabled(_mayWrite);
    _addIdentifier.setEnabled(_mayWrite);
    if (!_mayWrite) {
        setMessage(NLMessages.getString("Editor_message_noWriting_person"));
    }
    if (_currentPerson != null) {

        //         System.out.println("im person editor person not null"); //$NON-NLS-1$
        // Front
        if (_currentPerson.getPdrId() != null) {
            _pdrID.setText(_currentPerson.getPdrId().toString());
            // _pdrID.pack();
        }

        if ((_currentPerson.getRecord() != null) && !_currentPerson.getRecord().getRevisions().isEmpty()) {
            if (_currentPerson.getRecord().getRevisions().get(0).getRevisor() != null) {
                _creatorNameText.setText(_currentPerson.getRecord().getRevisions().get(0).getRevisor());
            } else {
                _creatorNameText.setText(_facade
                        .getObjectDisplayName(_currentPerson.getRecord().getRevisions().get(0).getAuthority()));
            }
            _creationTimeText.setText(
                    _adminDateFormat.format(_currentPerson.getRecord().getRevisions().get(0).getTimeStamp()));
            // _creatorNameText.pack();
            // _creationTimeText.pack();

            if (_currentPerson.getRecord().getRevisions().size() > 1) {
                if (_currentPerson.getRecord().getRevisions().lastElement().getAuthority() != null) {

                    _creatorNameText.setText(_facade.getObjectDisplayName(
                            _currentPerson.getRecord().getRevisions().lastElement().getAuthority()));

                } else {
                    _revisorNameText.setText(NLMessages.getString("Editor_revisor_name_notFound"));
                }
                _revisionTimeText.setText(_adminDateFormat
                        .format(_currentPerson.getRecord().getRevisions().lastElement().getTimeStamp()));
                // revisorName.pack();
                // _revisionTimeText.pack();

                // String ttHist = NLMessages.getString("Editor_createdBy")
                //               + _currentPerson.getRecord().getRevisions().firstElement().getAuthority().toString() //$NON-NLS-1$
                // + NLMessages.getString("Editor_date")
                // + adminDateFormat.format(_currentPerson.getRecord()
                //               .getRevisions().firstElement().getTimeStamp()) + "\n"; //$NON-NLS-1$ //$NON-NLS-2$
                // for (int i = 1; i <
                // _currentPerson.getRecord().getRevisions().size(); i++)
                // {
                // if
                // (_currentPerson.getRecord().getRevisions().get(i).getAuthority()
                // != null
                // &&
                // _currentPerson.getRecord().getRevisions().get(i).getTimeStamp()
                // != null)
                // {
                //                        ttHist = ttHist + i + NLMessages.getString("Editor_revisionedBy"); //$NON-NLS-1$
                // String id =
                // _currentPerson.getRecord().getRevisions().get(i).getAuthority().toString();
                // User user = null;
                // try {
                // user = userManager.getUserById(id);
                // } catch (XQException e) {
                // id =
                // NLMessages.getString("Editor_user_name_notFound + id");
                // e.printStackTrace();
                // }
                // if (user != null) ttHist += user.getDisplayName();
                // else ttHist += id;
                // ttHist += NLMessages
                // .getString("Editor_space_date_space") + adminDateFormat
                //               .format(_currentPerson.getRecord().getRevisions().get(i).getTimeStamp()) + "\n"; //$NON-NLS-1$ //$NON-NLS-2$
                // }
                // }
                final RevisionHistoryToolTip historyToolTip = new RevisionHistoryToolTip(_historyLabel,
                        _currentPerson.getRecord());
                historyToolTip.setShift(new Point(-25, -25));
                historyToolTip.setPopupDelay(0);
                historyToolTip.setHideOnMouseDown(true);
                historyToolTip.activate();
                _historyLabel.addMouseListener(new MouseListener() {

                    @Override
                    public void mouseDoubleClick(final MouseEvent e) {
                    }

                    @Override
                    public void mouseDown(final MouseEvent e) {
                        historyToolTip.show(new Point(e.x, e.y));
                    }

                    @Override
                    public void mouseUp(final MouseEvent e) {
                        historyToolTip.show(new Point(e.x, e.y));
                    }
                });
                // _historyLabel.setToolTipText(ttHist);

            }
        } else {
            _creatorNameText.setText(_facade.getCurrentUser().getDisplayName());
            _creationTimeText.setText(_adminDateFormat.format(_facade.getCurrentDate()));
            _currentPerson.setNew(true);

        }
        // _creationTimeText.setText(cp.getRecord().getRevisions().get(0).getTimeStamp());

        // Identifier
        if (_currentPerson.getIdentifiers() != null) {
            loadIdentifiers(false, null);
        }

        // Concurrence
        if (_currentPerson.getConcurrences() != null) {
            loadConcurrences(0, null, null);

        }

        // new RightsChecker();
        // if(!rc._mayWrite(_currentPerson)){
        // if(false){
        //
        // pndID.setEnabled(false);
        //
        // for(int i=0;i<3;i++){
        // pndRadios[i].setEnabled(false);
        // }
        // lccnID.setEnabled(false);
        // for(int i=0;i<3;i++){
        // lccnRadios[i].setEnabled(false);
        // }
        // iccuID.setEnabled(false);
        // for(int i=0;i<3;i++){
        // iccuRadios[i].setEnabled(false);
        // }
        // viafID.setEnabled(false);
        // for(int i=0;i<3;i++){
        // viafRadios[i].setEnabled(false);
        // }
        // _conComposite.setEnabled(false);
        // _rightsComposite.setEnabled(false);
        // setMessage(NLMessages.getString("Editor_errorMessageNoWritingRights"),
        // IMessageProvider.INFORMATION);
        // }else{
        // _identifierComposite.setEnabled(true);
        // _conComposite.setEnabled(true);
        // _rightsComposite.setEnabled(true);
        // }

    } else { // if currentPerson = null, create new person.
        _creatorNameText.setText(_facade.getCurrentUser().getDisplayName()); //$NON-NLS-1$
        _creationTimeText.setText(_facade.getCurrentDateAsString());
        setMessage("", IMessageProvider.INFORMATION); //$NON-NLS-1$

    }

    validate();

}

From source file:org.bbaw.pdr.ae.view.main.editors.ReferenceGenreEditor.java

License:Open Source License

@Override
public final void create() {
    super.create();
    // Set the title
    setTitle(NLMessages.getString("Editor_refGenreEditor_title"));
    // Set the message
    setMessage(NLMessages.getString("Editor_refGenreEditor_title_message"), IMessageProvider.INFORMATION);
    dialogArea.addListener(SWT.Traverse, new Listener() {
        @Override//from   www. ja v a  2s .  c  o  m
        public void handleEvent(final Event e) {
            if (e.detail == SWT.TRAVERSE_ESCAPE) {
                e.doit = false;
            }
        }
    });
}

From source file:org.bbaw.pdr.ae.view.main.editors.SourceEditorDialog.java

License:Open Source License

@Override
public final void create() {
    super.create();
    // Set the title
    setTitle(NLMessages.getString("Editor_0")); //$NON-NLS-1$
    // Set the message
    setMessage("", IMessageProvider.INFORMATION); //$NON-NLS-1$
    dialogArea.addListener(SWT.Traverse, new Listener() {
        @Override//from   ww  w.ja v  a 2 s.co m
        public void handleEvent(final Event e) {
            if (e.detail == SWT.TRAVERSE_ESCAPE) {
                e.doit = false;
            }
        }
    });
}

From source file:org.becausecucumber.eclipse.plugin.ui.preference.searcherPage.ValidationResult.java

License:Open Source License

/**
 * Convert the status code of this validation results into an
 * IMessageProvider status code./* w ww  .  j  av a  2s.c  o m*/
 */
public int getMessageProviderStatus() {
    switch (status) {
    case IStatus.OK:
        return IMessageProvider.NONE;
    case IStatus.CANCEL:
        // There's no corresponding statis in IMessageProvider. Treat
        // cancelation like an error.
        return IMessageProvider.ERROR;
    case IStatus.ERROR:
        return IMessageProvider.ERROR;
    case IStatus.INFO:
        return IMessageProvider.INFORMATION;
    case IStatus.WARNING:
        return IMessageProvider.WARNING;
    default:
        // Shouldn't happen since all cases should be covered above... byt
        // anyhow
        return IMessageProvider.ERROR;
    }
}