Package org.erlide.ui.util

Examples of org.erlide.ui.util.StatusInfo


                    // return result;
                    // }
                    // } catch (CoreException e) {
                    // JavaPlugin.log(e);
                    // }
                    return new StatusInfo();
                }
                return new StatusInfo(IStatus.ERROR, "");
            }
        };
        dialog.setValidator(validator);
        dialog.setMessage(labelText);
        dialog.addFilter(filter);
View Full Code Here


        statusChanged(validateCommaSeparatedCharacters(erlangTriggersText.getText()));
        statusChanged(validateCommaSeparatedCharacters(eDocTriggersText.getText()));
    }

    private IStatus validateCommaSeparatedCharacters(final String text) {
        final StatusInfo status = new StatusInfo();
        status.setOK();
        if (text.length() > 1) {
            final String[] chars = text.split(",");
            for (final String c : chars) {
                if (c.trim().length() != 1) {
                    status.setError("Trigger keys should be a list of comma-separated characters");
                    break;
                }
            }
        }
        return status;
View Full Code Here

        }
        return l;
    }

    public static IStatus validatePositiveNumber(final String number) {
        final StatusInfo status = new StatusInfo();
        if (number.length() == 0) {
            status.setError(ErlEditorMessages.ErlEditorPreferencePage_empty_input);
        } else {
            try {
                final int value = Integer.parseInt(number);
                if (value < 0) {
                    status.setError(MessageFormat.format(
                            ErlEditorMessages.ErlEditorPreferencePage_invalid_input,
                            (Object[]) new String[] { number }));
                }
            } catch (final NumberFormatException e) {
                status.setError(MessageFormat.format(
                        ErlEditorMessages.ErlEditorPreferencePage_invalid_input,
                        (Object[]) new String[] { number }));
            }
        }
        return status;
View Full Code Here

        super(shell);
        setShellStyle(getShellStyle() | SWT.RESIZE);
        fRequestor = requestor;
        fStatuses = new IStatus[5];
        for (int i = 0; i < fStatuses.length; i++) {
            fStatuses[i] = new StatusInfo();
        }
        fEditedRuntime = editedVM;
    }
View Full Code Here

        setLocationStatus(validateLocation());
        updateStatusLine();
    }

    protected IStatus validateName() {
        final StatusInfo status = new StatusInfo();
        final String name = fName.getText();
        if (name == null || name.trim().length() == 0) {
            status.setError("Enter the runtime's name"); //$NON-NLS-1$
        } else {
            if (fRequestor.isDuplicateName(name)
                    && (fEditedRuntime == null || !name.equals(fEditedRuntime.getName()))) {
                status.setError("The name is already used"); //$NON-NLS-1$
            } else {
                final IStatus s = ResourcesPlugin.getWorkspace().validateName(name,
                        IResource.FILE);
                if (!s.isOK()) {
                    status.setError(MessageFormat.format("Name is invalid: %s",
                            (Object[]) new String[] { s.getMessage() }));
                }
            }
        }
        return status;
View Full Code Here

        }
        return status;
    }

    protected IStatus validateLocation() {
        final StatusInfo status = new StatusInfo();
        final String loc = fOtpHome.getText();
        if (loc == null || loc.trim().length() == 0) {
            status.setInfo("Enter the installation's location");
        } else {
            final File f = new File(loc);
            if (!f.exists()) {
                status.setError("Location doesn't exist");
            } else if (!f.isDirectory()) {
                status.setError("Location isn't a directory");
            } else if (!RuntimeInfo.validateLocation(loc)) {
                status.setError("Location is not a valid OTP home");
            }
        }
        return status;
    }
View Full Code Here

        dialogSettings.put(DIALOG_SETTINGS_SHOW_ALL, !selected);
    }

    void doSelectionChanged(final Object[] objects) {
        if (objects.length != 1) {
            updateStatus(new StatusInfo(IStatus.ERROR, "")); //$NON-NLS-1$
            setSelectionResult(null);
        } else {
            updateStatus(new StatusInfo());
            setSelectionResult(objects);
        }
    }
View Full Code Here

TOP

Related Classes of org.erlide.ui.util.StatusInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.