Java Code Examples for org.eclipse.xtext.tasks.TaskTag#getPriority()

The following examples show how to use org.eclipse.xtext.tasks.TaskTag#getPriority() . 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: TaskTagConfigurationBlock.java    From xtext-eclipse with Eclipse Public License 2.0 6 votes vote down vote up
@Override
public String getColumnText(Object element, int columnIndex) {
	TaskTag task = (TaskTag) element;
	if (columnIndex == 0) {
		return task.getName();
	} else {
		if (Priority.HIGH == task.getPriority()) {
			return PreferencesMessages.TaskTagConfigurationBlock_markers_tasks_high_priority;
		} else if (Priority.NORMAL == task.getPriority()) {
			return PreferencesMessages.TaskTagConfigurationBlock_markers_tasks_normal_priority;
		} else if (Priority.LOW == task.getPriority()) {
			return PreferencesMessages.TaskTagConfigurationBlock_markers_tasks_low_priority;
		}
		return "";
	}
}
 
Example 2
Source File: TaskTagInputDialog.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public TaskTagInputDialog(Shell parent, TaskTag task, List<TaskTag> existingEntries,
		String languageName) {
	super(parent);
	this.languageName = languageName;

	existingNames = new ArrayList<String>(existingEntries.size());
	for (int i = 0; i < existingEntries.size(); i++) {
		TaskTag curr = existingEntries.get(i);
		if (!curr.equals(task)) {
			existingNames.add(curr.getName());
		}
	}

	if (task == null) {
		setTitle(PreferencesMessages.TaskTagInputDialog_new_title);
	} else {
		setTitle(PreferencesMessages.TaskTagInputDialog_edit_title);
	}

	TaskTagInputAdapter adapter = new TaskTagInputAdapter();

	nameField = new StringDialogField();
	nameField.setLabelText(PreferencesMessages.TaskTagInputDialog_name_label);
	nameField.setDialogFieldListener(adapter);

	nameField.setText((task != null) ? task.getName() : ""); //$NON-NLS-1$

	String[] items = new String[] { PreferencesMessages.TaskTagInputDialog_priority_high,
			PreferencesMessages.TaskTagInputDialog_priority_normal,
			PreferencesMessages.TaskTagInputDialog_priority_low };

	priorityField = new ComboDialogField(SWT.READ_ONLY);
	priorityField.setLabelText(PreferencesMessages.TaskTagInputDialog_priority_label);
	priorityField.setItems(items);
	if (task != null) {
		if (Priority.HIGH == task.getPriority()) {
			priorityField.selectItem(0);
		} else if (Priority.NORMAL == task.getPriority()) {
			priorityField.selectItem(1);
		} else {
			priorityField.selectItem(2);
		}
	} else {
		priorityField.selectItem(1);
	}
}