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.andmore.android.wizards.installapp.DeployWizardPage.java

License:Apache License

/**
 * Load the initial values to be filled in the wizard
 *//*from w  w  w. ja  va2 s. c  o  m*/
private void loadInitialValues() {
    if ((initialPackagePath != null) && (initialPackagePath.length() != 0)) {
        fileChooser.setText(initialPackagePath);
        validateSelection();
    } else {
        setMessage(packageSelectionMessage, IMessageProvider.NONE);
    }
}

From source file:org.eclipse.andmore.android.wizards.installapp.DeployWizardPage.java

License:Apache License

/**
 * Verify if a package is valid MPKG//w w  w  .  j  a  v  a  2  s. c om
 * 
 * @param packagePath
 * @return TRUE if the package is valid or FALSE otherwise
 */
private boolean isValidPackage(String packagePath) {
    boolean result = false;
    Path path = new Path(packagePath);
    String extension = path.getFileExtension();

    // testing if the entered path is a folder
    result = path.toFile().isFile();
    if (!result) {
        setErrorMessage(AndroidNLS.UI_DeployWizardPage_PackageIsAFolder);
    } else {
        result = ((extension != null) && extension.equals(packageExtension)
                && path.isValidPath(path.toString()));

        if (!result) {
            setErrorMessage(AndroidNLS.UI_DeployWizardPage_InvalidPath);
        } else {
            // Test if file exists
            result = path.toFile().exists();
            if (!result) {
                setErrorMessage(AndroidNLS.UI_DeployWizardPage_FileDoesNotExist);
            }
        }
    }

    if (result) {
        setMessage("", IMessageProvider.NONE);

        // Test if the package is valid
        result = isPackageSigned(packagePath);
        if (!result) {
            setErrorMessage(AndroidNLS.UI_DeployWizardPage_NotSignedMessage);
        }
    }

    return result;
}

From source file:org.eclipse.andmore.android.wizards.project.SamplesSelectionAdapter.java

License:Apache License

/**
 * Default constructor//from  ww w.j  ava  2  s  .c o m
 * 
 * @param sampleSelectionPage
 *            The sample selection page
 * @param treeViewer
 *            The tree viewer of the selection adapter
 * @param project
 *            The project
 */
public SamplesSelectionAdapter(SampleSelectionPage sampleSelectionPage, AndroidProject project) {
    this.sampleSelectionPage = sampleSelectionPage;
    this.project = project;

    sampleSelectionPage.setMessage(AndroidNLS.UI_SampleSelectionPage_WizardDescription, IMessageProvider.NONE);
}

From source file:org.eclipse.babel.editor.wizards.internal.ResourceBundleNewWizardPage.java

License:Open Source License

/**
 * Ensures that both text fields and the Locale field are set.
 *//*  w w  w. java  2 s .  c  om*/
protected void dialogChanged() {
    String container = getContainerName();
    String fileName = getFileName();

    if (container.length() == 0) {
        updateStatus(Messages.editor_wiz_error_container, IMessageProvider.ERROR);
        return;
    }
    if (fileName.length() == 0) {
        updateStatus(Messages.editor_wiz_error_bundleName, IMessageProvider.ERROR);
        return;
    }
    int dotLoc = fileName.lastIndexOf('.');
    if (dotLoc != -1) {
        updateStatus(Messages.editor_wiz_error_extension, IMessageProvider.ERROR);
        return;
    }
    // check if at least one Locale has been added to th list
    if (bundleLocalesList.getItemCount() <= 0) {
        updateStatus(Messages.editor_wiz_error_noLocale, IMessageProvider.ERROR);
        return;
    }
    // check if the container field contains a valid path
    // meaning: Project exists, at least one segment, valid path
    Path pathContainer = new Path(container);
    if (!pathContainer.isValidPath(container)) {
        updateStatus(Messages.editor_wiz_error_invalidpath, IMessageProvider.ERROR);
        return;
    }

    if (pathContainer.segmentCount() < 1) {
        updateStatus(Messages.editor_wiz_error_invalidpath, IMessageProvider.ERROR);
        return;
    }

    if (!projectExists(pathContainer.segment(0))) {
        String errormessage = Messages.editor_wiz_error_projectnotexist;
        errormessage = String.format(errormessage, pathContainer.segment(0));
        updateStatus(errormessage, IMessageProvider.ERROR);
        return;
    }

    updateStatus(null, IMessageProvider.NONE);
}

From source file:org.eclipse.birt.report.data.oda.excel.ui.wizards.ExcelDataSourcePageHelper.java

License:Open Source License

/**
 * //  w  w w  . j  a  v  a 2s  .  c o  m
 * @return
 */
private int verifyFileLocation() {
    int result = CORRECT_FOLDER;
    String folderLocationValue = getFolderLocationString().trim();
    if (folderLocationValue.length() > 0) {
        URI uri = null;
        try {
            uri = ResourceLocatorUtil.resolvePath(ri, folderLocationValue);
        } catch (OdaException e) {
            setMessage(e.getMessage(), IMessageProvider.ERROR);
            setPageComplete(false);
            return ERROR_FOLDER;
        }
        if (uri == null) {
            setMessage(Messages.getString("ui.ExcelFileNotFound"), IMessageProvider.ERROR); //$NON-NLS-1$
            setPageComplete(false);
            return ERROR_FOLDER;
        }
        try {
            ResourceLocatorUtil.validateFileURI(uri);
            setMessage(DEFAULT_MESSAGE, IMessageProvider.NONE);
            setPageComplete(true);
        } catch (Exception e) {
            setMessage(Messages.getString("ui.ExcelFileNotFound"), IMessageProvider.ERROR); //$NON-NLS-1$
            setPageComplete(false);
            return ERROR_FOLDER;
        }
    } else {
        setMessage(Messages.getString("error.emptyPath"), IMessageProvider.ERROR); //$NON-NLS-1$
        setPageComplete(false);
        result = ERROR_EMPTY_PATH;
    }
    if (result == CORRECT_FOLDER)
        return result;

    if (wizardPage == null) {
        // error message is already set above when result is set to an error
        // state
        setPageComplete(true);
    }
    return result;
}

From source file:org.eclipse.birt.report.data.oda.jdbc.dbprofile.ui.internal.sqb.SQBDataSetWizardPage.java

License:Open Source License

public SQBDataSetWizardPage(String pageName) {
    super(pageName);
    setMessage(DEFAULT_MESSAGE, IMessageProvider.NONE);
}

From source file:org.eclipse.birt.report.data.oda.jdbc.ui.editors.SQLDataSetEditorPage.java

License:Open Source License

/**
 * initial dataset control/*from   w w w  .  j a  v  a  2  s  . c  o m*/
 * 
 */
private void initializeControl() {
    if (this.dataSetDesign.getOdaExtensionDataSourceId() != null
            && this.dataSetDesign.getOdaExtensionDataSourceId().contains("hive")) {
        DEFAULT_MESSAGE = JdbcPlugin.getResourceString("dataset.new.query.hive");
    } else {
        DEFAULT_MESSAGE = JdbcPlugin.getResourceString("dataset.new.query");
    }
    setMessage(DEFAULT_MESSAGE, IMessageProvider.NONE);
    viewer.getTextWidget().setFocus();
}

From source file:org.eclipse.birt.report.data.oda.jdbc_resultset.ui.editors.SQLDataSetEditorPage.java

License:Open Source License

/**
 * initial dataset control/*  www .  jav a  2 s .co m*/
 * 
 */
private void initializeControl() {
    DEFAULT_MESSAGE = JdbcPlugin.getResourceString("dataset.new.query");
    setMessage(DEFAULT_MESSAGE, IMessageProvider.NONE);
    viewer.getTextWidget().setFocus();
}

From source file:org.eclipse.birt.report.data.oda.sampledb.ui.profile.SampleDbSelectionPageHelper.java

License:Open Source License

void createCustomControl(Composite parent) {
    // create the composite to hold the widgets
    Composite content = new Composite(parent, SWT.NONE);

    GridLayout layout = new GridLayout();
    layout.numColumns = 2;//from  w  ww  . j av a2  s  .c om
    content.setLayout(layout);

    new Label(content, SWT.LEFT).setText(Messages.getMessage("datasource.page.driver.class")); //$NON-NLS-1$
    m_driverClass = new Label(content, SWT.LEFT);
    m_driverClass.setText(SampleDBConstants.DRIVER_CLASS); //$NON-NLS-1$
    new Label(content, SWT.LEFT).setText(Messages.getMessage("datasource.page.url")); //$NON-NLS-1$
    m_driverURL = new Label(content, SWT.LEFT);
    m_driverURL.setText(SampleDBConstants.DRIVER_URL);//$NON-NLS-1$
    new Label(content, SWT.LEFT).setText(Messages.getMessage("datasource.page.user")); //$NON-NLS-1$
    m_sampleUser = new Label(content, SWT.LEFT);
    m_sampleUser.setText(SampleDBJDBCConnectionFactory.getDbUser());//$NON-NLS-1$

    setMessage(DEFAULT_MESSAGE, IMessageProvider.NONE);
    if (this.m_wizardPage != null) {
        if (this.m_wizardPage.getPreviousPage().getClass().toString().contains("DataSourceSelectionPage")) {
            setMessage(DEFAULT_MESSAGE, IMessageProvider.NONE);
        } else {
            setMessage(Messages.getMessage("datasource.page.warning"), IMessageProvider.WARNING);
        }
    }

    PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), CONEXT_ID_DATASOURCE_SAMPLEDB);
}

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

License:Open Source License

public void pageActivated() {
    try {//from  w ww  . ja  v a  2s  .c  om
        refreshColumnNames();
        getContainer().setMessage(Messages.getString("dataset.editor.computedColumns"), //$NON-NLS-1$
                IMessageProvider.NONE); // $-NON-NLS-1
        // //$NON-NLS-1$
        setPageProperties();

        computedColumns = ((DataSetHandle) getContainer().getModel())
                .getPropertyHandle(DataSetHandle.COMPUTED_COLUMNS_PROP);
        ;
        viewer.getViewer().setInput(computedColumns);
        viewer.getViewer().getTable().select(0);
    } catch (BirtException e) {
        DataSetExceptionHandler.handle(e);
    }

}