Search in sources :

Example 6 with TaskManagerImpl

use of com.intellij.tasks.impl.TaskManagerImpl in project intellij-community by JetBrains.

the class TaskConfigurable method apply.

@Override
public void apply() throws ConfigurationException {
    boolean oldUpdateEnabled = getConfig().updateEnabled;
    super.apply();
    TaskManager manager = TaskManager.getManager(myProject);
    if (getConfig().updateEnabled && !oldUpdateEnabled) {
        manager.updateIssues(null);
    }
    TaskSettings.getInstance().ALWAYS_DISPLAY_COMBO = myAlwaysDisplayTaskCombo.isSelected();
    int oldConnectionTimeout = TaskSettings.getInstance().CONNECTION_TIMEOUT;
    Integer connectionTimeout = Integer.valueOf(myConnectionTimeout.getText());
    TaskSettings.getInstance().CONNECTION_TIMEOUT = connectionTimeout;
    if (manager instanceof TaskManagerImpl && connectionTimeout != oldConnectionTimeout) {
        ((TaskManagerImpl) manager).reconfigureRepositoryClients();
    }
}
Also used : TaskManager(com.intellij.tasks.TaskManager) TaskManagerImpl(com.intellij.tasks.impl.TaskManagerImpl)

Example 7 with TaskManagerImpl

use of com.intellij.tasks.impl.TaskManagerImpl in project intellij-community by JetBrains.

the class TaskAutoCompletionListProvider method createInsertHandler.

@Override
protected InsertHandler<LookupElement> createInsertHandler(@NotNull final Task task) {
    return new InsertHandler<LookupElement>() {

        @Override
        public void handleInsert(InsertionContext context, LookupElement item) {
            Document document = context.getEditor().getDocument();
            String s = ((TaskManagerImpl) TaskManager.getManager(context.getProject())).getChangelistName(task);
            s = StringUtil.convertLineSeparators(s);
            document.replaceString(context.getStartOffset(), context.getTailOffset(), s);
            context.getEditor().getCaretModel().moveToOffset(context.getStartOffset() + s.length());
            TaskAutoCompletionListProvider.this.handleInsert(task);
        }
    };
}
Also used : TaskManagerImpl(com.intellij.tasks.impl.TaskManagerImpl) InsertHandler(com.intellij.codeInsight.completion.InsertHandler) InsertionContext(com.intellij.codeInsight.completion.InsertionContext) LookupElement(com.intellij.codeInsight.lookup.LookupElement) Document(com.intellij.openapi.editor.Document)

Example 8 with TaskManagerImpl

use of com.intellij.tasks.impl.TaskManagerImpl in project intellij-community by JetBrains.

the class CreateChangelistAction method actionPerformed.

@Override
public void actionPerformed(AnActionEvent e) {
    TaskManagerImpl manager = (TaskManagerImpl) getTaskManager(e);
    assert manager != null;
    LocalTask activeTask = manager.getActiveTask();
    String name = Messages.showInputDialog(getProject(e), "Changelist name:", "Create Changelist", null, manager.getChangelistName(activeTask), null);
    if (name != null) {
        manager.createChangeList(activeTask, name);
    }
}
Also used : TaskManagerImpl(com.intellij.tasks.impl.TaskManagerImpl) LocalTask(com.intellij.tasks.LocalTask)

Aggregations

TaskManagerImpl (com.intellij.tasks.impl.TaskManagerImpl)8 LocalTask (com.intellij.tasks.LocalTask)2 InsertHandler (com.intellij.codeInsight.completion.InsertHandler)1 InsertionContext (com.intellij.codeInsight.completion.InsertionContext)1 LookupElement (com.intellij.codeInsight.lookup.LookupElement)1 Document (com.intellij.openapi.editor.Document)1 Project (com.intellij.openapi.project.Project)1 CustomTaskState (com.intellij.tasks.CustomTaskState)1 TaskManager (com.intellij.tasks.TaskManager)1 TaskRepository (com.intellij.tasks.TaskRepository)1 TaskDialogPanel (com.intellij.tasks.ui.TaskDialogPanel)1 YouTrackRepository (com.intellij.tasks.youtrack.YouTrackRepository)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 Document (org.jdom.Document)1 Element (org.jdom.Element)1