Skip to content

Commit

Permalink
EXM-46209: code review -> group code differently
Browse files Browse the repository at this point in the history
  • Loading branch information
sorincarbunaru committed Oct 2, 2024
1 parent 0c43911 commit f34cf94
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 29 deletions.
33 changes: 16 additions & 17 deletions src/main/java/com/oxygenxml/git/view/dialog/AdvancedPullDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,20 @@ public AdvancedPullDialog(final GitController gitCtrl) {
true);

this.gitCtrl = gitCtrl;
currentBranch = gitCtrl.getGitAccess().getBranchInfo().getBranchName();
this.currentBranch = gitCtrl.getGitAccess().getBranchInfo().getBranchName();

setOkButtonText(TRANSLATOR.getTranslation(Tags.PULL_CHANGES));
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
setResizable(false);

JFrame parentFrame = PluginWorkspaceProvider.getPluginWorkspace() != null ?
(JFrame) PluginWorkspaceProvider.getPluginWorkspace().getParentFrame() : null;
if (parentFrame != null) {
setIconImage(parentFrame.getIconImage());
setLocationRelativeTo(parentFrame);
}

RemotesViewUtil.installRemoteBranchesRenderer(remoteBranchItems);
}


Expand All @@ -109,27 +122,13 @@ public AdvancedPullDialog(final GitController gitCtrl) {
* @throws URISyntaxException When a URI syntax exception appear.
*/
public void showDialog() throws RemoteNotFoundException, NoRepositorySelected, URISyntaxException {

setOkButtonText(TRANSLATOR.getTranslation(Tags.PULL_CHANGES));

RemotesViewUtil.installRemoteBranchesRenderer(remoteBranchItems);
loadRemotesRepositories();

getContentPane().add(createGUIPanel());

pack();
repaint();

JFrame parentFrame = PluginWorkspaceProvider.getPluginWorkspace() != null ?
(JFrame) PluginWorkspaceProvider.getPluginWorkspace().getParentFrame() : null;
if (parentFrame != null) {
setIconImage(parentFrame.getIconImage());
setLocationRelativeTo(parentFrame);
}

setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);

this.setResizable(false);

setVisible(true);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,19 @@ public CurrentBranchRemotesDialog() throws RemoteNotFoundException {
);

setOkButtonText(TRANSLATOR.getTranslation(Tags.TRACK_BRANCH));
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
setResizable(false);

JFrame parentFrame = PluginWorkspaceProvider.getPluginWorkspace() != null ?
(JFrame) PluginWorkspaceProvider.getPluginWorkspace().getParentFrame() : null;
if (parentFrame != null) {
setIconImage(parentFrame.getIconImage());
setLocationRelativeTo(parentFrame);
}

currentBranch = GitAccess.getInstance().getBranchInfo().getBranchName();

RemotesViewUtil.installRemoteBranchesRenderer(remoteBranchItems);
}


Expand All @@ -83,7 +95,6 @@ public CurrentBranchRemotesDialog() throws RemoteNotFoundException {
*/
public void showDialog() throws RemoteNotFoundException {
try {
RemotesViewUtil.installRemoteBranchesRenderer(remoteBranchItems);
RemotesViewUtil.addRemoteBranches(remoteBranchItems, currentBranch);
} catch (NoRepositorySelected | URISyntaxException e) {
LOGGER.error(e.getMessage(), e);
Expand All @@ -94,17 +105,7 @@ public void showDialog() throws RemoteNotFoundException {
pack();
repaint();

JFrame parentFrame = PluginWorkspaceProvider.getPluginWorkspace() != null ?
(JFrame) PluginWorkspaceProvider.getPluginWorkspace().getParentFrame() : null;
if (parentFrame != null) {
setIconImage(parentFrame.getIconImage());
setLocationRelativeTo(parentFrame);
}

setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);

this.setResizable(false);
this.setVisible(true);
setVisible(true);
}


Expand Down

0 comments on commit f34cf94

Please sign in to comment.