Java 类org.eclipse.xtext.tasks.TaskTag 实例源码

项目:xtext-core    文件:DefaultTaskParser.java   
protected Pattern toPattern(final TaskTags taskTags) {
  Pattern _xblockexpression = null;
  {
    int flags = Pattern.MULTILINE;
    boolean _isCaseSensitive = taskTags.isCaseSensitive();
    boolean _not = (!_isCaseSensitive);
    if (_not) {
      flags = ((flags | Pattern.CASE_INSENSITIVE) | Pattern.UNICODE_CASE);
    }
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("^.*((");
    final Function1<TaskTag, String> _function = (TaskTag it) -> {
      return Pattern.quote(it.getName());
    };
    String _join = IterableExtensions.join(IterableExtensions.<TaskTag, String>map(taskTags, _function), "|");
    _builder.append(_join);
    _builder.append(")(.*)?)$");
    _xblockexpression = Pattern.compile(_builder.toString(), flags);
  }
  return _xblockexpression;
}
项目:xtext-core    文件:PreferenceTaskTagProvider.java   
@Override
public TaskTags getTaskTags(final Resource resource) {
  TaskTags _xblockexpression = null;
  {
    final IPreferenceValues prefs = this.preferenceValuesProvider.getPreferenceValues(resource);
    final String names = prefs.getPreference(PreferenceTaskTagProvider.TAGS_KEY);
    final String priorities = prefs.getPreference(PreferenceTaskTagProvider.PRIORITIES_KEY);
    TaskTags _taskTags = new TaskTags();
    final Procedure1<TaskTags> _function = (TaskTags it) -> {
      it.setCaseSensitive((Boolean.valueOf(prefs.getPreference(PreferenceTaskTagProvider.CASE_SENSITIVE_KEY))).booleanValue());
      List<TaskTag> _taskTags_1 = it.getTaskTags();
      List<TaskTag> _parseTags = PreferenceTaskTagProvider.parseTags(names, priorities);
      Iterables.<TaskTag>addAll(_taskTags_1, _parseTags);
    };
    _xblockexpression = ObjectExtensions.<TaskTags>operator_doubleArrow(_taskTags, _function);
  }
  return _xblockexpression;
}
项目:xtext-core    文件:DefaultTaskParser.java   
@Override
public List<Task> parseTasks(final String source, final TaskTags taskTags) {
  ArrayList<Task> _xblockexpression = null;
  {
    boolean _isEmpty = IterableExtensions.isEmpty(taskTags);
    if (_isEmpty) {
      return Collections.<Task>unmodifiableList(CollectionLiterals.<Task>newArrayList());
    }
    final Function<TaskTag, String> _function = (TaskTag it) -> {
      return it.getName().toLowerCase();
    };
    final ImmutableMap<String, TaskTag> taskTagsByName = Maps.<String, TaskTag>uniqueIndex(taskTags, _function);
    final Matcher matcher = this.toPattern(taskTags).matcher(source);
    final ArrayList<Task> tasks = CollectionLiterals.<Task>newArrayList();
    int prevLine = 1;
    int prevOffset = 0;
    while (matcher.find()) {
      {
        final Task task = new Task();
        task.setTag(taskTagsByName.get(matcher.group(2).toLowerCase()));
        task.setDescription(matcher.group(3));
        task.setOffset(matcher.start(2));
        int _countLineBreaks = Strings.countLineBreaks(source, prevOffset, task.getOffset());
        int _plus = (_countLineBreaks + prevLine);
        task.setLineNumber(_plus);
        prevLine = task.getLineNumber();
        prevOffset = task.getOffset();
        tasks.add(task);
      }
    }
    _xblockexpression = tasks;
  }
  return _xblockexpression;
}
项目:xtext-core    文件:PreferenceTaskTagProvider.java   
public static List<TaskTag> parseTags(final String names, final String priorities) {
  final Splitter splitter = Splitter.on(",").omitEmptyStrings().trimResults();
  final List<String> tags = IterableExtensions.<String>toList(splitter.split(names));
  final List<String> prios = IterableExtensions.<String>toList(splitter.split(priorities));
  final ArrayList<TaskTag> elements = CollectionLiterals.<TaskTag>newArrayList();
  int _size = tags.size();
  ExclusiveRange _doubleDotLessThan = new ExclusiveRange(0, _size, true);
  for (final Integer i : _doubleDotLessThan) {
    TaskTag _taskTag = new TaskTag();
    final Procedure1<TaskTag> _function = (TaskTag it) -> {
      it.setName(tags.get((i).intValue()));
      Priority _xifexpression = null;
      int _size_1 = prios.size();
      boolean _greaterEqualsThan = (_size_1 >= (i).intValue());
      if (_greaterEqualsThan) {
        Priority _xtrycatchfinallyexpression = null;
        try {
          _xtrycatchfinallyexpression = Priority.valueOf(prios.get((i).intValue()));
        } catch (final Throwable _t) {
          if (_t instanceof IllegalArgumentException) {
            _xtrycatchfinallyexpression = Priority.NORMAL;
          } else {
            throw Exceptions.sneakyThrow(_t);
          }
        }
        _xifexpression = _xtrycatchfinallyexpression;
      } else {
        _xifexpression = Priority.NORMAL;
      }
      it.setPriority(_xifexpression);
    };
    TaskTag _doubleArrow = ObjectExtensions.<TaskTag>operator_doubleArrow(_taskTag, _function);
    elements.add(_doubleArrow);
  }
  return elements;
}
项目:xtext-core    文件:Task.java   
@Pure
public TaskTag getTag() {
  return this.tag;
}
项目:xtext-core    文件:Task.java   
public void setTag(final TaskTag tag) {
  this.tag = tag;
}
项目:xtext-core    文件:TaskTags.java   
@Override
public Iterator<TaskTag> iterator() {
  return this.taskTags.iterator();
}
项目:xtext-core    文件:TaskTags.java   
@Pure
public List<TaskTag> getTaskTags() {
  return this.taskTags;
}
项目:xtext-core    文件:PreferenceTaskTagProvider.java   
public static String serializeTags(final List<TaskTag> tags) {
  final Function1<TaskTag, String> _function = (TaskTag it) -> {
    return it.getName();
  };
  return Joiner.on(",").join(ListExtensions.<TaskTag, String>map(tags, _function));
}
项目:xtext-core    文件:PreferenceTaskTagProvider.java   
public static String serializePriorities(final List<TaskTag> tags) {
  final Function1<TaskTag, Priority> _function = (TaskTag it) -> {
    return it.getPriority();
  };
  return Joiner.on(",").join(ListExtensions.<TaskTag, Priority>map(tags, _function));
}
项目:xtext-core    文件:TaskAssert.java   
public static void assertExactMatch(final TaskTag expected, final TaskTag actual) {
  Assert.assertEquals(expected.getName(), actual.getName());
  Assert.assertEquals(expected.getPriority(), actual.getPriority());
}
项目:statecharts    文件:SCTTask.java   
public TaskTag getTag() {
    return delgate.getTag();
}
项目:statecharts    文件:SCTTask.java   
public void setTag(TaskTag tag) {
    delgate.setTag(tag);
}