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:org.eclipse.birt.report.designer.data.ui.dataset.DataSetComputedColumnsPage.java

License:Open Source License

protected void updateComputedColumn(Object structureOrHandle) {
    if (structureOrHandle instanceof ComputedColumn) {
        try {/*w  w w  .  j ava2s .c o  m*/
            computedColumns.addItem((ComputedColumn) structureOrHandle);
            viewer.getViewer().refresh();
        } catch (SemanticException e) {
            ExceptionHandler.handle(e);
        }
    } else {
        viewer.getViewer().update(structureOrHandle, null);
    }

    if (validateAllComputedColumns())
        getContainer().setMessage(Messages.getString("dataset.editor.computedColumns"), //$NON-NLS-1$
                IMessageProvider.NONE);

}

From source file:org.eclipse.birt.report.designer.data.ui.dataset.DataSetDataSourceSelectionPage.java

License:Open Source License

public void pageActivated() {
    getContainer().setMessage(Messages.getString("dataset.editor.dataSource"), IMessageProvider.NONE); //$NON-NLS-1$
    lastSelectedDataSourceIndex = combo.getSelectionIndex();
}

From source file:org.eclipse.birt.report.designer.data.ui.dataset.DataSetFiltersPage.java

License:Open Source License

public void pageActivated() {
    getContainer().setMessage(Messages.getString("dataset.editor.filters"), IMessageProvider.NONE); //$NON-NLS-1$
    initializeFilters();//from   www .j a va2 s  .  c  o m
    initColumnNames();
    // The proeprties of the various controls on the page
    // will be set depending on the filters
    setPageProperties();

    viewer.getViewer().setInput(filters);
    viewer.getViewer().getTable().select(0);
}

From source file:org.eclipse.birt.report.designer.data.ui.dataset.DataSetParametersPage.java

License:Open Source License

protected void refreshMessage() {
    getContainer().setMessage(DEFAULT_MESSAGE, IMessageProvider.NONE);
    if (!doSaveEmptyParameter(parameters)) {
        getContainer()/*from w  ww .  j av  a  2s. com*/
                .setMessage(Messages.getFormattedString("dataset.editor.error.noInputParameterDefaultValue", //$NON-NLS-1$
                        new Object[] { this.getNoneValuedParameterName() }), IMessageProvider.ERROR);
    }
}

From source file:org.eclipse.birt.report.designer.data.ui.dataset.DataSetParametersPage.java

License:Open Source License

/**
 * Depending on the value of the parameters the properties of various
 * controls on this page are set/* w  w  w.  j av  a  2 s.  com*/
 */
private void setPageProperties() {
    viewer.updateButtons();

    boolean parametersExist = (parameters != null && parameters.getListValue() != null
            && parameters.getListValue().size() > 0);
    if (!parametersExist)
        getContainer().setMessage(DEFAULT_MESSAGE, IMessageProvider.NONE); //$NON-NLS-1$
}

From source file:org.eclipse.birt.report.designer.data.ui.dataset.DataSetSettingsPage.java

License:Open Source License

/**
 * Add row fetch limit control group./*  ww w .  j  av a2 s .  c  o  m*/
 * 
 * @param composite
 */
private void addDataFetchSettingGroup(Composite composite) {
    GridLayout groupGridLayout = new GridLayout();
    groupGridLayout.numColumns = 5;
    GridData groupGridData = new GridData(GridData.FILL_HORIZONTAL);

    Group dataFetchSettingGroup = new Group(composite, SWT.NONE);
    dataFetchSettingGroup.setLayoutData(groupGridData);
    dataFetchSettingGroup.setLayout(groupGridLayout);
    dataFetchSettingGroup.setText(Messages.getString("dataset.editor.settings.dataFetchSetting")); //$NON-NLS-1$

    fetchAllDataCheckBox = new Button(dataFetchSettingGroup, SWT.CHECK);
    GridData data = new GridData();
    data.horizontalSpan = 5;
    fetchAllDataCheckBox.setLayoutData(data);
    fetchAllDataCheckBox.setText(Messages.getString("dataset.editor.settings.dataFetchSetting.fetchAll")); //$NON-NLS-1$

    final Label dataFetchLabel = new Label(dataFetchSettingGroup, SWT.NONE);
    dataFetchLabel.setText(Messages.getString("SettingsPage.dataFetchSetting.label")); //$NON-NLS-1$

    final Text rowFetchLimitText = new Text(dataFetchSettingGroup, SWT.BORDER);
    GridData gData = new GridData(GridData.FILL_HORIZONTAL);
    rowFetchLimitText.setLayoutData(gData);

    if (getDataSetRowFetchLimit() > 0) {
        fetchAllDataCheckBox.setSelection(false);
        rowFetchLimitText.setEnabled(true);
        dataFetchLabel.setEnabled(true);
        rowFetchLimitText.setText(Integer.toString(getDataSetRowFetchLimit()));
    } else {
        fetchAllDataCheckBox.setSelection(true);
        rowFetchLimitText.setEnabled(false);
        dataFetchLabel.setEnabled(false);
        rowFetchLimitText.setText(""); //$NON-NLS-1$

    }

    fetchAllDataCheckBox.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent e) {

            final boolean isSelection = fetchAllDataCheckBox.getSelection();
            dataFetchLabel.setEnabled(!isSelection);
            rowFetchLimitText.setEnabled(!isSelection);

            if (isSelection) {
                rowFetchLimitText.setText(""); //$NON-NLS-1$
            }

        }
    });

    rowFetchLimitText.addModifyListener(new ModifyListener() {

        public void modifyText(ModifyEvent e) {
            int rowFetchLimit = 0;

            try {

                if (isNumber(rowFetchLimitText.getText())) {
                    String rowLimitText = rowFetchLimitText.getText();
                    if (rowLimitText.trim().length() == 0)
                        rowLimitText = "0"; //$NON-NLS-1$
                    rowFetchLimit = new Double(rowLimitText).intValue();
                    rowFetchLimit = rowFetchLimit < 0 ? 0 : rowFetchLimit;

                    setDataSetRowFetchLimit(rowFetchLimit);

                    getContainer().setMessage(DEFAULT_MESSAGE, IMessageProvider.NONE);
                } else {
                    getContainer().setMessage(
                            Messages.getString("dataset.editor.settings.dataFetchSetting.errorNumberFormat"), //$NON-NLS-1$
                            IMessageProvider.ERROR);
                }

            } catch (SemanticException e1) {
                getContainer().setMessage(
                        Messages.getString("dataset.editor.settings.dataFetchSetting.errorNumberFormat"), //$NON-NLS-1$
                        IMessageProvider.ERROR);
            }

        }

    });

}

From source file:org.eclipse.birt.report.designer.data.ui.dataset.DataSetSettingsPage.java

License:Open Source License

private void addResultSetGroup(Composite composite) {
    GridLayout groupGridLayout = new GridLayout();
    GridData groupGridData = new GridData(GridData.FILL_HORIZONTAL);

    Group resultSetNumberGroup = new Group(composite, SWT.NONE);
    resultSetNumberGroup.setLayoutData(groupGridData);
    resultSetNumberGroup.setLayout(groupGridLayout);
    resultSetNumberGroup/*  ww  w .j a  va2 s.co m*/
            .setText(Messages.getString("dataset.editor.settings.resultsetselection.resultSetSelection")); //$NON-NLS-1$

    selectResultSetCheckBox = new Button(resultSetNumberGroup, SWT.CHECK);
    GridData data = new GridData();
    selectResultSetCheckBox.setLayoutData(data);
    selectResultSetCheckBox
            .setText(Messages.getString("dataset.editor.settings.resultsetselection.enableResultSetSelection")); //$NON-NLS-1$

    Composite selectionComposite = new Composite(resultSetNumberGroup, SWT.NONE);
    GridLayout cmpLayout = new GridLayout();
    cmpLayout.numColumns = 5;
    selectionComposite.setLayout(cmpLayout);
    GridData cmpGridData = new GridData(GridData.FILL_HORIZONTAL);
    selectionComposite.setLayoutData(cmpGridData);

    resultSetName = new Button(selectionComposite, SWT.RADIO);
    data = new GridData();
    data.horizontalSpan = 3;
    resultSetName.setLayoutData(data);
    resultSetName
            .setText(Messages.getString("dataset.editor.settings.resultsetselection.selectResultSetByName")); //$NON-NLS-1$

    final Text nameText = new Text(selectionComposite, SWT.BORDER);
    GridData gData = new GridData(GridData.FILL_HORIZONTAL);
    /*
     * gData.horizontalSpan = 2; gData.widthHint = 100;
     */
    nameText.setLayoutData(gData);

    resultSetNumber = new Button(selectionComposite, SWT.RADIO);
    data = new GridData();
    data.horizontalSpan = 3;
    resultSetNumber.setLayoutData(data);
    resultSetNumber
            .setText(Messages.getString("dataset.editor.settings.resultsetselection.selectResultSetByNumber")); //$NON-NLS-1$

    final Text numberText = new Text(selectionComposite, SWT.BORDER);
    gData = new GridData(GridData.FILL_HORIZONTAL);
    numberText.setLayoutData(gData);

    selectResultSetCheckBox.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent e) {
            final boolean selected = selectResultSetCheckBox.getSelection();
            resultSetName.setEnabled(selected);
            resultSetNumber.setEnabled(selected);

            if (selected) {
                if (resultSetName.getSelection()) {
                    numberText.setEnabled(false);
                    nameText.setEnabled(true);
                } else if (resultSetNumber.getSelection()) {
                    nameText.setEnabled(false);
                    numberText.setEnabled(true);
                } else {
                    nameText.setEnabled(selected);
                    numberText.setEnabled(selected);
                }
            } else {
                nameText.setEnabled(selected);
                numberText.setEnabled(selected);

            }
            changed = true;

        }
    });

    resultSetName.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent e) {
            nameText.setEnabled(true);
            numberText.setEnabled(false);
            changed = true;
        }
    });

    resultSetNumber.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent e) {
            nameText.setEnabled(false);
            numberText.setEnabled(true);
            changed = true;
        }
    });

    nameText.addModifyListener(new ModifyListener() {

        public void modifyText(ModifyEvent e) {
            DataSetSettingsPage.this.nameText = nameText.getText();
            changed = true;
        }

    });

    numberText.addModifyListener(new ModifyListener() {

        public void modifyText(ModifyEvent e) {
            int rsNumber = 0;

            if (isNumber(numberText.getText())) {
                String number = numberText.getText();
                if (number.trim().length() == 0)
                    number = "0"; //$NON-NLS-1$
                DataSetSettingsPage.this.numberText = numberText.getText();
                getContainer().setMessage(DEFAULT_MESSAGE, IMessageProvider.NONE);
                changed = true;
            } else {
                getContainer().setMessage(
                        Messages.getString(
                                "dataset.editor.settings.dataFetchSetting.errorNumberFormatForResultSet"), //$NON-NLS-1$
                        IMessageProvider.ERROR);
            }
        }

    });

    if (((OdaDataSetHandle) ((DataSetEditor) getContainer()).getHandle()).getResultSetName() != null) {
        resultSetName.setSelection(true);
        nameText.setText(((OdaDataSetHandle) ((DataSetEditor) getContainer()).getHandle()).getResultSetName());
        numberText.setEnabled(false);
        selectResultSetCheckBox.setSelection(true);
    } else if (((OdaDataSetHandle) ((DataSetEditor) getContainer()).getHandle())
            .getPropertyHandle(IOdaDataSetModel.RESULT_SET_NUMBER_PROP).isSet()) {
        resultSetNumber.setSelection(true);
        numberText.setText(String.valueOf(
                ((OdaDataSetHandle) ((DataSetEditor) getContainer()).getHandle()).getResultSetNumber()));
        nameText.setEnabled(false);
        selectResultSetCheckBox.setSelection(true);
    } else {
        selectResultSetCheckBox.setSelection(false);
        resultSetName.setSelection(true);
        resultSetName.setEnabled(false);
        resultSetNumber.setEnabled(false);
        nameText.setEnabled(false);
        numberText.setEnabled(false);
    }
}

From source file:org.eclipse.birt.report.designer.data.ui.dataset.DataSetSettingsPage.java

License:Open Source License

public void pageActivated() {
    getContainer().setMessage(DEFAULT_MESSAGE, IMessageProvider.NONE);
}

From source file:org.eclipse.birt.report.designer.data.ui.dataset.JointDataSetPage.java

License:Open Source License

public JointDataSetPage(String pageName) {
    super(pageName);
    setTitle(pageName);//$NON-NLS-1$
    setPageMessage(Messages.getString("JointDataSetPage.page.detail"), IMessageProvider.NONE); //$NON-NLS-1$
}

From source file:org.eclipse.birt.report.designer.data.ui.dataset.JointDataSetPage.java

License:Open Source License

public void selectionChanged(SelectionChangedEvent event) {
    selectionChanged = true;//from   w w  w  .ja v a2 s  .co  m

    if (event.getSource() instanceof ComboViewer) {
        this.setPageMessage(Messages.getString("JointDataSetPage.page.detail"), //$NON-NLS-1$
                IMessageProvider.NONE);
        if (((ComboViewer) event.getSource()).equals(rightDataSetChooser))
            leftSelected = false;
        else
            leftSelected = true;
        if (((IStructuredSelection) event.getSelection()).getFirstElement() instanceof DataSetHandle) {
            DataSetHandle handle = (DataSetHandle) ((IStructuredSelection) event.getSelection())
                    .getFirstElement();
            if (leftSelected) {
                leftDataSetName = handle.getQualifiedName();
                leftHandle = handle;
            } else {
                rightDataSetName = handle.getQualifiedName();
                rightHandle = handle;
            }
            DataSetViewData[] columsItems = null;
            try {
                DataSessionContext context = new DataSessionContext(DataSessionContext.MODE_DIRECT_PRESENTATION,
                        handle.getModuleHandle());
                DataRequestSession session = DataRequestSession.newSession(context);

                columsItems = DataSetProvider.getCurrentInstance().populateAllCachedMetaData(handle, session);
                populateColumns(columsItems);
                session.shutdown();
            } catch (BirtException e) {
                ExceptionHandler.handle(e);
            }
        }
    } else if (event.getSource() instanceof ListViewer) {
        if (((ListViewer) event.getSource()).equals(rightColumnList))
            leftSelected = false;
        else
            leftSelected = true;
        if (((IStructuredSelection) event.getSelection()).getFirstElement() instanceof DataSetViewData) {
            DataSetViewData itemModel = (DataSetViewData) ((IStructuredSelection) event.getSelection())
                    .getFirstElement();
            if (leftSelected)
                leftColumnSelection = itemModel.getName();
            else
                rightColumnSelection = itemModel.getName();
        }
    }
    if (!this.nameEditor.isDisposed())
        setPageComplete(canPageComplete());
}