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

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

Introduction

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

Prototype

int NONE

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

Click Source Link

Document

Constant for a regular message (value 0).

Usage

From source file:net.enilink.commons.ui.editor.MessageManager.java

License:Open Source License

private void update(ArrayList<Message> mergedList) {
    pruneControlDecorators();//from w  ww. j  a v a2 s  .  c o m
    if (mergedList.isEmpty() || mergedList == null) {
        messageContainer.setMessage(null, IMessageProvider.NONE);
        return;
    }
    ArrayList<Message> peers = createPeers(mergedList);
    int maxType = peers.get(0).getMessageType();
    String messageText;
    IMessage[] array = peers.toArray(new IMessage[peers.size()]);
    if (peers.size() == 1 && peers.get(0).prefix == null) {
        // a single message
        IMessage message = peers.get(0);
        messageText = message.getMessage();
        messageContainer.setMessage(messageText, maxType, array);
    } else {
        // show a summary message for the message
        // and list of errors for the details
        if (peers.size() > 1)
            messageText = Messages.bind(MULTIPLE_MESSAGE_SUMMARY_KEYS[maxType],
                    new String[] { peers.size() + "" }); //$NON-NLS-1$
        else
            messageText = SINGLE_MESSAGE_SUMMARY_KEYS[maxType];

        messageContainer.setMessage(messageText, maxType, array);
    }
}

From source file:net.enilink.rap.workbench.auth.LoginDialog.java

License:Open Source License

private void createTextoutputHandler(Composite composite, TextOutputCallback callback) {
    int messageType = callback.getMessageType();
    int dialogMessageType = IMessageProvider.NONE;
    switch (messageType) {
    case TextOutputCallback.INFORMATION:
        dialogMessageType = IMessageProvider.INFORMATION;
        break;//  w w  w.  j  ava2 s .  co m
    case TextOutputCallback.WARNING:
        dialogMessageType = IMessageProvider.WARNING;
        break;
    case TextOutputCallback.ERROR:
        dialogMessageType = IMessageProvider.ERROR;
        break;
    }
    setMessage(callback.getMessage(), dialogMessageType);
}

From source file:net.refractions.udig.style.sld.editor.internal.EditorDialog.java

License:Open Source License

public void updateMessage() {
    String message = null;/*ww  w.j a va2 s  . com*/
    String errorMessage = null;
    if (currentPage != null) {
        message = currentPage.getMessage();
        errorMessage = currentPage.getErrorMessage();
    }
    int messageType = IMessageProvider.NONE;
    if (message != null && currentPage instanceof IMessageProvider)
        messageType = ((IMessageProvider) currentPage).getMessageType();

    if (errorMessage == null) {
        if (showingError) {
            // we were previously showing an error
            showingError = false;
        }
    } else {
        message = errorMessage;
        messageType = IMessageProvider.ERROR;
        if (!showingError) {
            // we were not previously showing an error
            showingError = true;
        }
    }
    messageArea.updateText(message, messageType);
}

From source file:net.rim.ejde.internal.ui.wizards.imports.ProjectImportSelectionUI.java

License:Open Source License

public void creatContent() {
    // workspace location entry field
    Composite pathComp = new Composite(_parent, SWT.NONE);
    pathComp.setLayout(new GridLayout(3, false));
    pathComp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    if (_allowBrowseJDW) {
        String importLocationLabel = Messages.GenericSelectionPage_WORKSPACE_LABEL;
        Label projectContentsLabel = new Label(pathComp, SWT.NONE);
        projectContentsLabel.setText(importLocationLabel); //$NON-NLS-1$*/
        projectContentsLabel.setLayoutData(new GridData(SWT.BEGINNING));
        // jdw path text
        _importPathField = new Text(pathComp, SWT.BORDER);
        _importPathField.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
        _importPathField.setText(""); //$NON-NLS-1$
        _importPathField.addKeyListener(new KeyAdapter() {
            @Override//from  ww w.java  2s. com
            public void keyPressed(KeyEvent e) {
                if ((e.keyCode == SWT.CR) || (e.keyCode == SWT.KEYPAD_CR)) {
                    _log.debug("\"Entry\" was pressed");
                    String workspaceFileToImport = _importPathField.getText();
                    loadWorkspace(new Path(workspaceFileToImport));
                }
            }
        });
        _importPathField.addFocusListener(new FocusAdapter() {
            @Override
            public void focusLost(FocusEvent e) {
                String workspaceFilePath = _importPathField.getText();
                loadWorkspace(new Path(workspaceFilePath));
            }
        });
        // browse button
        _browseButton = new Button(pathComp, SWT.PUSH);
        GridData data = new GridData(GridData.END);
        data.widthHint = BUTTON_DEFAULT_WIDTH;
        _browseButton.setLayoutData(data);
        _browseButton.setText(Messages.IConstants_BROWSE_BUTTON_TITLE); //$NON-NLS-1$
        _browseButton.addSelectionListener(new SelectionAdapter() {
            public void widgetSelected(SelectionEvent event) {
                FileDialog dialog = new FileDialog(_importPathField.getShell());
                String[] filters = new String[] { "*.jdw" };
                String[] filterNames = new String[] { Messages.BLACKBERRY_WORKSPACE_FILTER_NAME };
                dialog.setFilterExtensions(filters);
                dialog.setFilterNames(filterNames);
                String workspaceFileToImport = dialog.open();
                if (null != workspaceFileToImport) {
                    _importPathField.setText(workspaceFileToImport);
                    loadWorkspace(new Path(workspaceFileToImport));
                }
            }
        });
    }
    Composite comp = new Composite(_parent, SWT.NONE);
    GridLayout gridLayout = new GridLayout(3, false);
    comp.setLayout(gridLayout);
    GridData gd = new GridData(GridData.FILL_BOTH);
    gd.heightHint = 250;
    comp.setLayoutData(gd);
    // projects label
    Label projectsLabel = new Label(comp, SWT.NONE);
    projectsLabel.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, true, false, 3, 1));
    projectsLabel.setText(Messages.GenericSelectionPage_PROJECT_TABLE_TITLE);
    // projects table
    _tableViewer = CheckboxTableViewer.newCheckList(comp,
            SWT.SINGLE | SWT.FULL_SELECTION | SWT.CHECK | SWT.BORDER);
    _tableViewer.setContentProvider(new ArrayContentProvider());
    _tableViewer.setLabelProvider(new ProjectTableLabelProvider());
    _tableViewer.addCheckStateListener(new CheckStateListenerImpl());
    Table table = _tableViewer.getTable();
    table.addKeyListener(new KeyListenerImpl());
    table.setHeaderVisible(true);
    table.setLinesVisible(true);
    table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 2));
    TableColumn projectIconColumn, projectNameColumn;
    projectIconColumn = new TableColumn(table, SWT.NONE);
    projectIconColumn.setText("Project Icon"); //$NON-NLS-1$
    projectIconColumn.setWidth(80);
    projectNameColumn = new TableColumn(table, SWT.NONE);
    projectNameColumn.setText("Project Name"); //$NON-NLS-1$
    projectNameColumn.setWidth(450);
    // select / de-select project buttons
    _selectAllButton = new Button(comp, SWT.PUSH);
    _selectAllButton.setText("Select All"); //$NON-NLS-1$
    GridData gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
    gridData.widthHint = BUTTON_DEFAULT_WIDTH;
    _selectAllButton.setLayoutData(gridData);
    _deselectAllButton = new Button(comp, SWT.PUSH);
    //_deselectAllButton.setText( _resources.getString( "Wizard.GenericSelectionPage.DeselectAll" ) ); //$NON-NLS-1$
    _deselectAllButton.setText("Deselect All"); //$NON-NLS-1$
    GridData gridData2 = new GridData(SWT.FILL, SWT.TOP, false, false);
    gridData2.widthHint = BUTTON_DEFAULT_WIDTH;
    _deselectAllButton.setLayoutData(gridData2);
    _selectAllButton.addSelectionListener(new SelectionAdapter() {
        /*
         * (non-Javadoc)
         *
         * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org .eclipse .swt.events.SelectionEvent)
         */
        @Override
        public void widgetSelected(SelectionEvent e) {
            Table table = _tableViewer.getTable();
            for (TableItem item : table.getItems()) {
                if (!item.getGrayed()) {
                    item.setChecked(true);
                }
            }
            table.redraw();
            _callback.setMessage(IConstants.EMPTY_STRING, IMessageProvider.NONE);
            _callback.setComplete(table.getItems().length > 0); // donot
        }
    });
    _deselectAllButton.addSelectionListener(new SelectionAdapter() {
        /*
         * (non-Javadoc)
         *
         * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org .eclipse .swt.events.SelectionEvent)
         */
        @Override
        public void widgetSelected(SelectionEvent e) {
            Table table = _tableViewer.getTable();
            for (TableItem item : table.getItems()) {
                if (!item.getGrayed()) {
                    item.setChecked(false);
                }
            }
            _callback.setMessage(Messages.GenericSelectionPage_NO_PROJECT_SELECTED_ERROR_MSG,
                    IMessageProvider.ERROR);
            _callback.setComplete(false);
        }
    });
    // the copy project checkbox
    _copyButton = new Button(comp, SWT.CHECK);
    _copyButton.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, true, false, 3, 1));
    _copyButton.setText(Messages.GenericSelectionPage_COPY_MODEL_LABEL);
    // by default we suggest users to use copy model
    _copyButton.setSelection(true);
    // if it is sample import wizard, we only allow copy import
    _copyButton.setEnabled(_allowBrowseJDW);
    _copyButton.addSelectionListener(new SelectionListener() {

        @Override
        public void widgetDefaultSelected(SelectionEvent e) {
            // TODO Auto-generated method stub

        }

        @Override
        public void widgetSelected(SelectionEvent e) {
            fireImportTypeChangeEvent(e);

        }

    });
    // the select dependency project checkbox
    _selectDependencyButton = new Button(comp, SWT.CHECK);
    _selectDependencyButton.setText("Automatically select dependent projects");
    // by default we suggest users to use copy model
    _selectDependencyButton.setSelection(true);
}

From source file:net.sf.eclipsefp.haskell.ui.dialog.Validator.java

License:Open Source License

public void setMessage(final String message) {
    fMessage = message;
    status = IMessageProvider.NONE;
}

From source file:net.sf.eclipsefp.haskell.ui.dialog.Validator.java

License:Open Source License

public void setComplete() {
    setMessage(null);
    setStatus(IMessageProvider.NONE);
    setPageComplete(true);
}

From source file:net.sf.eclipsefp.haskell.ui.dialog.ValidatorManager.java

License:Open Source License

public void updatePage() {
    String message = null;//  w  w w .j  a  va 2s.  co  m
    int status = IMessageProvider.NONE;
    boolean pageComplete = true;
    for (Validator validator : validators) {
        if (message == null && validator.getMessage() != null) {
            message = validator.getMessage();
        }
        if (validator.getStatus() > status) {
            status = validator.getStatus();
            if (validator.getMessage() != null) {
                message = validator.getMessage();
            }
        }

        if (pageComplete && !validator.isPageComplete()) {
            pageComplete = false;
        }
    }
    fWizardPage.setMessage(message, status);
    fWizardPage.setPageComplete(pageComplete);
}

From source file:net.sf.jmoney.oda.ui.wizards.DatasourcePageHelper.java

License:Open Source License

void createCustomControl(Composite parent) {
    Composite content = new Composite(parent, SWT.NULL);
    GridLayout layout = new GridLayout(3, false);
    content.setLayout(layout);//from   w  w w .  ja v  a 2 s  .  c  om

    Label label = new Label(content, SWT.NONE);
    label.setText(Messages.getString("label.noPropertiesMessage")); //$NON-NLS-1$

    setMessage(DEFAULT_MESSAGE, IMessageProvider.NONE); //$NON-NLS-1$
    setPageComplete(true);
}

From source file:net.tourbook.ui.MessageManager.java

License:Open Source License

private void update(final ArrayList mergedList) {
    pruneControlDecorators();/*  w  w  w.ja  v  a 2 s  .  c om*/
    if (scrolledForm.getHead().getBounds().height == 0 || mergedList.isEmpty() || mergedList == null) {
        scrolledForm.setMessage(null, IMessageProvider.NONE);
        return;
    }
    final ArrayList peers = createPeers(mergedList);
    final int maxType = ((IMessage) peers.get(0)).getMessageType();
    String messageText;
    final IMessage[] array = (IMessage[]) peers.toArray(new IMessage[peers.size()]);
    if (peers.size() == 1 && ((Message) peers.get(0)).prefix == null) {
        // a single message
        final IMessage message = (IMessage) peers.get(0);
        messageText = message.getMessage();
        scrolledForm.setMessage(messageText, maxType, array);
    } else {
        // show a summary message for the message
        // and list of errors for the details
        if (peers.size() > 1)
            messageText = Messages.bind(MULTIPLE_MESSAGE_SUMMARY_KEYS[maxType],
                    new String[] { peers.size() + "" }); //$NON-NLS-1$
        else
            messageText = SINGLE_MESSAGE_SUMMARY_KEYS[maxType];
        scrolledForm.setMessage(messageText, maxType, array);
    }
}

From source file:net.tourbook.ui.MessageRegion.java

License:Open Source License

/**
 * Hide the message region and clear out the caches.
 *//*from   w  w w  .  j ava 2s  .  c om*/
private void hideRegion() {
    messageComposite.setVisible(false);
    lastMessageText = null;
    lastMessageType = IMessageProvider.NONE;
}