2 * Copyright 2000-2007 JetBrains s.r.o.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package com
.intellij
.openapi
.vcs
;
18 import com
.intellij
.openapi
.project
.Project
;
19 import com
.intellij
.openapi
.vcs
.changes
.Change
;
20 import com
.intellij
.openapi
.vcs
.ui
.Refreshable
;
21 import com
.intellij
.openapi
.vfs
.VirtualFile
;
25 import java
.util
.Collection
;
26 import java
.util
.List
;
29 * Interface for working with the checkin dialog user interface (retrieving the files
30 * included in the checkin operation, getting/setting the commit message and so on).
31 * The active check-in dialog can be retrieved from the
32 * {@link com.intellij.openapi.actionSystem.DataContext} using the {@link Refreshable#PANEL} data ID.
34 * @see com.intellij.openapi.vcs.checkin.CheckinHandlerFactory#createHandler(CheckinProjectPanel)
36 public interface CheckinProjectPanel
extends Refreshable
{
37 JComponent
getComponent();
39 JComponent
getPreferredFocusedComponent();
42 * Checks if the checkin operation has anything to check in.
44 * @return true if any files need to be updated, added or deleted; false otherwise.
49 * Adds a listener which is notified when the selection in the check-in panel is moved.
50 * To obtain selected object/objects use the data context
51 * passed to {@link SelectionChangeListener#selectionChanged(com.intellij.openapi.actionSystem.DataContext)}
52 * with {@link com.intellij.openapi.actionSystem.DataConstants#VIRTUAL_FILE} or
53 * {@link com.intellij.openapi.actionSystem.DataConstants#VIRTUAL_FILE_ARRAY} constants.
55 * @param listener the listener to add.
57 void addSelectionChangeListener(SelectionChangeListener listener
);
60 * Removes a listener which is notified when the selection in the check-in panel is moved.
62 * @param listener the listener to remove.
64 void removeSelectionChangeListener(SelectionChangeListener listener
);
67 * Returns the list of files selected for checkin, as {@link VirtualFile} objects. The returned list
68 * does not include files which will be deleted from the VCS during the check-in operation.
70 * @return the files selected for checkin.
72 Collection
<VirtualFile
> getVirtualFiles();
74 Collection
<Change
> getSelectedChanges();
77 * Returns the list of files selected for checkin, as {@link java.io.File} objects. The returned list
78 * includes files which will be deleted from the VCS during the check-in operation.
80 * @return the files selected for checkin.
83 Collection
<File
> getFiles();
86 * Returns the project in which the checkin is performed.
88 * @return the project instance.
93 * Returns the list of version control systems files from which are included in the
96 * @return the list of affected VCSes.
99 List
<AbstractVcs
> getAffectedVcses();
102 * Returns the list of roots for the check-in (roots of all modules under version control
103 * in a "checkin project" operation, the files/directories selected for check-in in a
104 * "checkin directory" or "checkin file" operation).
106 * @return the list of roots for check-in.
108 Collection
<VirtualFile
> getRoots();
111 * Sets the description for the check-in.
113 * @param currentDescription the description text.
115 void setCommitMessage(final String currentDescription
);
117 void setWarning(final String s
);
120 * Gets the description for the check-in.
122 * @return the description text.
125 String
getCommitMessage();
127 String
getCommitActionName();