public class VcsPushDialog extends DialogWrapper implements VcsPushUi, DataProvider
DialogWrapper.CancelAction, DialogWrapper.DialogStyle, DialogWrapper.DialogWrapperAction, DialogWrapper.DialogWrapperExitAction, DialogWrapper.DoNotAskOption, DialogWrapper.IdeModalityType, DialogWrapper.OkAction
Modifier and Type | Field and Description |
---|---|
protected PushController |
myController |
protected Project |
myProject |
CANCEL_EXIT_CODE, CLOSE_EXIT_CODE, DEFAULT_ACTION, DIALOG_CONTENT_PANEL_PROPERTY, ERROR_FOREGROUND_COLOR, FOCUSED_ACTION, IS_VISUAL_PADDING_COMPENSATED_ON_COMPONENT_LEVEL_KEY, myCancelAction, myCheckBoxDoNotShowDialog, myDisposable, myHelpAction, myOKAction, myPerformAction, myPreferredFocusedComponent, NEXT_USER_EXIT_CODE, OK_EXIT_CODE
VCS_PUSH_DIALOG
Constructor and Description |
---|
VcsPushDialog(Project project,
java.util.Collection<? extends Repository> allRepos,
java.util.List<? extends Repository> selectedRepositories,
Repository currentRepo,
PushSource pushSource) |
VcsPushDialog(Project project,
java.util.List<? extends Repository> selectedRepositories,
Repository currentRepo) |
Modifier and Type | Method and Description |
---|---|
boolean |
canPush()
Checks if push is available right now for selected repositories and their targets.
|
protected javax.swing.Action [] |
createActions()
Creates actions for dialog.
|
protected javax.swing.JComponent |
createCenterPanel()
Factory method.
|
protected javax.swing.border.Border |
createContentPaneBorder()
Creates border for dialog's content pane.
|
protected javax.swing.JPanel |
createOptionsPanel() |
protected javax.swing.JPanel |
createSouthAdditionalPanel()
Additional panel in the lower left part of dialog to the left from additional buttons
|
protected javax.swing.JComponent |
createSouthPanel()
Creates panel located at the south of the content pane.
|
protected void |
doOKAction()
This method is invoked by default implementation of "OK" action.
|
protected ValidationInfo |
doValidate()
Validates user input and returns
null if everything is fine
or validation description with component where problem has been found. |
void |
enableOkActions(boolean value) |
void |
executeAfterRunningPrePushHandlers(Task.Backgroundable activity)
Runs
pre-push handlers under a modal progress,
if they succeed, schedules the given background task, and closes the push dialog. |
VcsPushOptionValue |
getAdditionalOptionValue(PushSupport support)
Returns special push options, usually selected by user at the bottom of the push dialog.
|
java.lang.Object |
getData(java.lang.String dataId)
Returns the object corresponding to the specified data identifier.
|
protected java.lang.String |
getDimensionServiceKey()
Returns key for persisting dialog dimensions.
|
protected java.lang.String |
getHelpId()
Returns the help identifier, or
null if no help is available. |
protected javax.swing.Action |
getOKAction() |
javax.swing.JComponent |
getPreferredFocusedComponent() |
java.util.Map<PushSupport<Repository,PushSource,PushTarget>,java.util.Collection<PushInfo>> |
getSelectedPushSpecs()
Returns push specifications (what is being pushed, where from and where to) collected from the push dialog,
grouped per PushSupports, which means in fact per-VCS.
|
protected boolean |
postponeValidation()
Allows to postpone first start of validation
|
void |
push(boolean forcePush)
Runs
pre-push handlers under a modal progress,
and after that starts push in a background task. |
PrePushHandler.Result |
runPrePushHandlersInModalTask() |
void |
updateOkActions() |
addKeyListener, addMouseListener, addMouseListener, canRecordDialogId, centerRelativeToParent, cleanupRootPane, cleanupWindowListeners, clickDefaultButton, close, close, createButtonsPanel, createCancelAction, createContentPane, createDefaultActions, createDefaultBorder, createDoNotAskCheckbox, createHelpButton, createJButtonForAction, createJButtonForAction, createLeftSideActions, createNorthPanel, createPeer, createPeer, createPeer, createPeer, createPeer, createPeer, createRootLayout, createTitlePane, dispose, disposeIfNeeded, doCancelAction, doCancelAction, doHelpAction, doValidateAll, extractMnemonic, findInstance, findInstanceFromFocus, getButton, getCancelAction, getContentPane, getContentPanel, getDimensionKey, getDisposable, getDoNotShowMessage, getErrorTextAlignment, getExitCode, getHelpAction, getHorizontalStretch, getInitialLocation, getLocation, getOwner, getPeer, getPreferredSize, getRootPane, getSize, getStyle, getTitle, getTypeAheadTimeoutMs, getValidationThreadToUse, getVerticalStretch, getWindow, hasErrors, init, initValidation, isAutoAdjustable, isCenterStrictedToPreferredSize, isDisposed, isModal, isModalProgress, isMoveHelpButtonLeft, isNorthStrictedToPreferredSize, isOK, isOKActionEnabled, isProgressDialog, isResizable, isShowing, isSouthStrictedToPreferredSize, isToDispatchTypeAhead, isTypeAheadEnabled, isVisible, layoutButtonsPanel, pack, processDoNotAskOnOk, repaint, setAutoAdjustable, setButtonsAlignment, setButtonsMargin, setCancelButtonIcon, setCancelButtonText, setCrossClosesWindow, setDoNotAskOption, setErrorInfoAll, setErrorText, setErrorText, setHelpTooltip, setHorizontalStretch, setInitialLocationCallback, setLocation, setLocation, setModal, setOKActionEnabled, setOKButtonIcon, setOKButtonMnemonic, setOKButtonText, setOKButtonTooltip, setResizable, setSize, setTitle, setUndecorated, setValidationDelay, setVerticalStretch, shouldAddErrorNearButtons, shouldCloseOnCross, show, showAndGet, showAndGetOk, startTrackingValidation, toBack, toBeShown, toFront, unregisterKeyboardActions, updateErrorInfo, validate
protected final Project myProject
protected final PushController myController
public VcsPushDialog(Project project, java.util.List<? extends Repository> selectedRepositories, Repository currentRepo)
public VcsPushDialog(Project project, java.util.Collection<? extends Repository> allRepos, java.util.List<? extends Repository> selectedRepositories, Repository currentRepo, PushSource pushSource)
protected javax.swing.border.Border createContentPaneBorder()
DialogWrapper
(8,12,8,12)
insets. Subclasses can
return null
for no border.createContentPaneBorder
in class DialogWrapper
protected javax.swing.JPanel createSouthAdditionalPanel()
DialogWrapper
createSouthAdditionalPanel
in class DialogWrapper
protected javax.swing.JComponent createSouthPanel()
DialogWrapper
createActions()
and createJButtonForAction(Action)
methods to construct the panel.createSouthPanel
in class DialogWrapper
protected javax.swing.JComponent createCenterPanel()
DialogWrapper
null
value. In this case there will be no options panel.createCenterPanel
in class DialogWrapper
protected javax.swing.JPanel createOptionsPanel()
protected java.lang.String getDimensionServiceKey()
DialogWrapper
null
(no persisting).getDimensionServiceKey
in class DialogWrapper
protected ValidationInfo doValidate()
DialogWrapper
null
if everything is fine
or validation description with component where problem has been found.doValidate
in class DialogWrapper
null
if everything is OK or validation descriptorprotected boolean postponeValidation()
DialogWrapper
postponeValidation
in class DialogWrapper
false
if start validation in init()
methodprotected void doOKAction()
DialogWrapper
OK_EXIT_CODE
. This is convenient place to override functionality of "OK" action.
Note that the method does nothing if "OK" action isn't enabled.doOKAction
in class DialogWrapper
protected javax.swing.Action [] createActions()
DialogWrapper
DialogWrapper.getHelpId()
returns non-null value.
Each action is represented by JButton
created by DialogWrapper.createJButtonForAction(Action)
.
These buttons are then placed into south panel
of dialog.createActions
in class DialogWrapper
DialogWrapper.createSouthPanel()
,
DialogWrapper.createJButtonForAction(javax.swing.Action)
public boolean canPush()
VcsPushUi
public java.util.Map<PushSupport<Repository,PushSource,PushTarget>,java.util.Collection<PushInfo>> getSelectedPushSpecs()
VcsPushUi
getSelectedPushSpecs
in interface VcsPushUi
public javax.swing.JComponent getPreferredFocusedComponent()
getPreferredFocusedComponent
in class DialogWrapper
protected javax.swing.Action getOKAction()
getOKAction
in class DialogWrapper
doOKAction()
method.DialogWrapper.doOKAction()
protected java.lang.String getHelpId()
DialogWrapper
null
if no help is available.getHelpId
in class DialogWrapper
public void push(boolean forcePush)
VcsPushUi
pre-push handlers
under a modal progress,
and after that starts push in a background task.public void executeAfterRunningPrePushHandlers(Task.Backgroundable activity)
VcsPushUi
pre-push handlers
under a modal progress,
if they succeed, schedules the given background task, and closes the push dialog.executeAfterRunningPrePushHandlers
in interface VcsPushUi
public PrePushHandler.Result runPrePushHandlersInModalTask()
public void updateOkActions()
public void enableOkActions(boolean value)
public VcsPushOptionValue getAdditionalOptionValue(PushSupport support)
VcsPushUi
getAdditionalOptionValue
in interface VcsPushUi
public java.lang.Object getData(java.lang.String dataId)
DataProvider
PlatformDataKeys
class.getData
in interface DataProvider
dataId
- the data identifier for which the value is requested.