diff --git a/plugins/tasks/tasks-core/src/com/intellij/tasks/actions/EditTaskDialog.form b/plugins/tasks/tasks-core/src/com/intellij/tasks/actions/EditTaskDialog.form new file mode 100644 index 000000000000..aa4527c401e5 --- /dev/null +++ b/plugins/tasks/tasks-core/src/com/intellij/tasks/actions/EditTaskDialog.form @@ -0,0 +1,63 @@ + +
diff --git a/plugins/tasks/tasks-core/src/com/intellij/tasks/actions/EditTaskDialog.java b/plugins/tasks/tasks-core/src/com/intellij/tasks/actions/EditTaskDialog.java new file mode 100644 index 000000000000..79362bdec5be --- /dev/null +++ b/plugins/tasks/tasks-core/src/com/intellij/tasks/actions/EditTaskDialog.java @@ -0,0 +1,132 @@ +/* + * Copyright 2000-2015 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.intellij.tasks.actions; + +import com.intellij.openapi.project.Project; +import com.intellij.openapi.ui.ComboBox; +import com.intellij.openapi.ui.DialogWrapper; +import com.intellij.openapi.util.Condition; +import com.intellij.openapi.vcs.AbstractVcs; +import com.intellij.openapi.vcs.VcsTaskHandler; +import com.intellij.openapi.vcs.changes.ChangeListManager; +import com.intellij.openapi.vcs.changes.LocalChangeList; +import com.intellij.tasks.BranchInfo; +import com.intellij.tasks.ChangeListInfo; +import com.intellij.tasks.TaskManager; +import com.intellij.tasks.impl.LocalTaskImpl; +import com.intellij.ui.CollectionComboBoxModel; +import com.intellij.ui.components.JBLabel; +import com.intellij.util.containers.ContainerUtil; +import org.jetbrains.annotations.Nullable; + +import javax.swing.*; +import java.util.List; + +/** + * @author Dmitry Avdeev + */ +public class EditTaskDialog extends DialogWrapper { + + private final LocalTaskImpl myTask; + + private JPanel myPanel; + private JTextField mySummary; + private JBLabel myBranchLabel; + private ComboBox myBranch; + private JBLabel myChangelistLabel; + private ComboBox myChangelist; + + public static void editTask(LocalTaskImpl task, Project project) { + new EditTaskDialog(project, task).show(); + } + + protected EditTaskDialog(Project project, LocalTaskImpl task) { + super(project); + myTask = task; + setTitle("Edit Task " + task.getId()); + +// mySummary.putClientProperty(DialogWrapperPeer.HAVE_INITIAL_SELECTION, ""); + mySummary.setText(task.getSummary()); + + AbstractVcs vcs = TaskManager.getManager(project).getActiveVcs(); + if (vcs == null) { + myBranchLabel.setVisible(false); + myBranch.setVisible(false); + myChangelistLabel.setVisible(false); + myChangelist.setVisible(false); + } + else { + ChangeListManager changeListManager = ChangeListManager.getInstance(project); + List