Java Code Examples for org.eclipse.xtext.validation.SeverityConverter#SEVERITY_ERROR

The following examples show how to use org.eclipse.xtext.validation.SeverityConverter#SEVERITY_ERROR . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: XbaseValidationConfigurationBlock.java    From xtext-eclipse with Eclipse Public License 2.0 6 votes vote down vote up
protected Combo addJavaDelegatingComboBox(String prefKey, String label, Composite parent, int indent) {
	PreferenceKey preferenceKey = issueCodeProvider.getConfigurableIssueCodes().get(prefKey);
	if (preferenceKey == null) {
		throw new IllegalArgumentException(prefKey
				+ " not registered in the corresponding ConfigurableIssueCodesProvider");
	}
	String javaIssueCode = preferenceKey.getDefaultValue();
	if (!javaIssueCode.startsWith(JavaCore.PLUGIN_ID)) {
		throw new IllegalArgumentException(prefKey + Messages.XbaseValidationConfigurationBlock_not_java_message);
	}
	String[] values = new String[] { SeverityConverter.SEVERITY_ERROR, SeverityConverter.SEVERITY_WARNING,
			SeverityConverter.SEVERITY_INFO, SeverityConverter.SEVERITY_IGNORE, javaIssueCode };
	String javaValue = javaValue(javaIssueCode);
	String[] valueLabels = new String[] { org.eclipse.xtext.ui.validation.Messages.ValidationConfigurationBlock_error,
			org.eclipse.xtext.ui.validation.Messages.ValidationConfigurationBlock_warning, org.eclipse.xtext.ui.validation.Messages.ValidationConfigurationBlock_info,
			org.eclipse.xtext.ui.validation.Messages.ValidationConfigurationBlock_ignore,
			NLS.bind(Messages.XbaseValidationConfigurationBlock_java_label, javaValue) };
	Combo comboBox = addComboBox(parent, label, prefKey, indent, values, valueLabels);
	return comboBox;
}
 
Example 2
Source File: ConfigurableIssueSeveritiesProvider.java    From sarl with Apache License 2.0 6 votes vote down vote up
@Override
public String getPreference(PreferenceKey key) {
	if (key != null) {
		final Severity severity = this.overridingSeverities.get(key.getId());
		if (severity != null) {
			switch (severity) {
			case ERROR:
				return SeverityConverter.SEVERITY_ERROR;
			case IGNORE:
				return SeverityConverter.SEVERITY_IGNORE;
			case INFO:
				return SeverityConverter.SEVERITY_INFO;
			case WARNING:
				return SeverityConverter.SEVERITY_WARNING;
			default:
			}
		}
	}
	return this.original.getPreference(key);
}
 
Example 3
Source File: XtextValidatorConfigurationBlock.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
protected Combo addComboBox(String prefKey, String label, Composite parent, int indent) {
	String[] values = new String[] { SeverityConverter.SEVERITY_ERROR, SeverityConverter.SEVERITY_WARNING,
			SeverityConverter.SEVERITY_INFO, SeverityConverter.SEVERITY_IGNORE };
	String[] valueLabels = new String[] { Messages.XtextValidatorConfigurationBlock_8, Messages.XtextValidatorConfigurationBlock_9,
			Messages.XtextValidatorConfigurationBlock_16, Messages.XtextValidatorConfigurationBlock_10 };
	Combo comboBox = addComboBox(parent, label, prefKey, indent, values, valueLabels);
	return comboBox;
}
 
Example 4
Source File: AbstractValidatorConfigurationBlock.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * @since 2.15
 */
protected Combo addComboBox(String prefKey, String label, Composite parent, int indent) {
	String[] values = new String[] { SeverityConverter.SEVERITY_ERROR, SeverityConverter.SEVERITY_WARNING,
			SeverityConverter.SEVERITY_INFO, SeverityConverter.SEVERITY_IGNORE };
	String[] valueLabels = new String[] { Messages.ValidationConfigurationBlock_error,
			Messages.ValidationConfigurationBlock_warning, Messages.ValidationConfigurationBlock_info, Messages.ValidationConfigurationBlock_ignore };
	Combo comboBox = addComboBox(parent, label, prefKey, indent, values, valueLabels);
	return comboBox;
}
 
Example 5
Source File: XtendValidatorConfigurationBlock.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
@Override
protected void addAdditionalComponentsToSettingsPage(Composite settingsPage, int nColumns, int defaultIndent) {
	super.addAdditionalComponentsToSettingsPage(settingsPage, nColumns, defaultIndent);
	createHorizontalLine(settingsPage, nColumns);
	String[] values = new String[] { SeverityConverter.SEVERITY_ERROR, SeverityConverter.SEVERITY_WARNING,
			SeverityConverter.SEVERITY_IGNORE };
	String[] valueLabels = new String[] { "Errors only", "All", "None" };
	Composite composite = new Composite(settingsPage, SWT.NONE);
	GridLayout layout = new GridLayout(nColumns, false);
	layout.marginHeight = 0;
	composite.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, nColumns, 1));
	composite.setLayout(layout);
	addComboBox(composite, "Display Java Problems in Xtend", IssueCodes.COPY_JAVA_PROBLEMS, defaultIndent, values,
			valueLabels);
}
 
Example 6
Source File: HelloWorldValidatorConfigurationBlock.java    From dsl-devkit with Eclipse Public License 1.0 5 votes vote down vote up
protected Combo addComboBox(String prefKey, String label, Composite parent, int indent) {
	String[] values = new String[] { SeverityConverter.SEVERITY_ERROR, SeverityConverter.SEVERITY_WARNING,
			SeverityConverter.SEVERITY_INFO, SeverityConverter.SEVERITY_IGNORE };
	String[] valueLabels = new String[] { "Error", "Warning", "Info", "Ignore" };
	Combo comboBox = addComboBox(parent, label, prefKey, indent, values, valueLabels);
	return comboBox;
}
 
Example 7
Source File: XtendConfigurableIssueCodes.java    From xtext-xtend with Eclipse Public License 2.0 4 votes vote down vote up
@Override
protected String getUnqualifiedSuperCallSeverity() {
	return SeverityConverter.SEVERITY_ERROR;
}
 
Example 8
Source File: XtendConfigurableIssueCodes.java    From xtext-xtend with Eclipse Public License 2.0 4 votes vote down vote up
@Override
protected String getAbstractMethodInvocationSeverity() {
	return SeverityConverter.SEVERITY_ERROR;
}