Merge branch 'feature/Enhanced_details_view' into develop

This commit is contained in:
Marcin Michałek committed 2015-06-17 19:20:32 +02:00
commit cc9dafc57f
4 files changed
+128 -41

No files matched your search

@@ -1,32 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.svn.utils.mirror.gui.main.MainWindow">
<grid id="27dc6" binding="rootPanel" layout-manager="FormLayout">
<rowspec value="center:max(d;4px):noGrow"/>
<rowspec value="top:4dlu:noGrow"/>
<rowspec value="center:max(d;4px):noGrow"/>
<rowspec value="top:4dlu:noGrow"/>
<rowspec value="center:max(d;4px):noGrow"/>
<rowspec value="top:4dlu:noGrow"/>
<rowspec value="center:max(d;4px):noGrow"/>
<rowspec value="top:4dlu:noGrow"/>
<rowspec value="center:max(d;4px):noGrow"/>
<rowspec value="top:4dlu:noGrow"/>
<rowspec value="center:d:grow"/>
<rowspec value="top:4dlu:noGrow"/>
<rowspec value="center:d:grow"/>
<colspec value="fill:363px:grow"/>
<colspec value="left:4dlu:noGrow"/>
<colspec value="fill:d:noGrow"/>
<grid id="27dc6" binding="rootPanel" layout-manager="GridLayoutManager" row-count="9" column-count="4" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="20" y="20" width="500" height="435"/>
<xy x="20" y="20" width="754" height="443"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<scrollpane id="b8f99">
<constraints>
<grid row="10" column="0" row-span="1" col-span="1" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
<forms defaultalign-horz="false" defaultalign-vert="false"/>
<grid row="4" column="0" row-span="2" col-span="1" vsize-policy="7" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
<preferred-size width="255" height="23"/>
</grid>
</constraints>
<properties/>
<border type="none"/>
@@ -42,8 +28,7 @@
<grid id="c9d20" binding="rootServerLoginPanel" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="15" left="15" bottom="15" right="15"/>
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
<forms/>
<grid row="1" column="0" row-span="1" col-span="3" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none" title="Login Data"/>
@@ -72,8 +57,7 @@
</grid>
<scrollpane id="19c4a">
<constraints>
<grid row="12" column="0" row-span="1" col-span="1" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
<forms defaultalign-horz="false" defaultalign-vert="false"/>
<grid row="6" column="0" row-span="3" col-span="3" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
@@ -86,20 +70,10 @@
</component>
</children>
</scrollpane>
<grid id="7dd0b" binding="synchronizationStatusPanel" layout-manager="CardLayout" hgap="0" vgap="0">
<constraints>
<grid row="2" column="2" row-span="3" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
<forms top="5" left="5" bottom="5" right="5" defaultalign-vert="false"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
<grid id="2412b" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="15" left="15" bottom="15" right="15"/>
<constraints>
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
<forms/>
<grid row="2" column="0" row-span="1" col-span="3" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none" title="Repository paths"/>
@@ -128,8 +102,7 @@
</grid>
<component id="ada03" class="javax.swing.JButton" binding="mirrorButton">
<constraints>
<grid row="6" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="1" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
<forms top="0" left="15" bottom="0" right="15"/>
<grid row="3" column="0" row-span="1" col-span="3" vsize-policy="0" hsize-policy="1" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Mirror"/>
@@ -138,8 +111,7 @@
<grid id="6a575" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="5" left="15" bottom="5" right="15"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
<forms/>
<grid row="0" column="0" row-span="1" col-span="3" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none" title="Repository type"/>
@@ -154,13 +126,58 @@
</grid>
<component id="2d020" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<forms/>
<grid row="0" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false">
<preferred-size width="101" height="16"/>
</grid>
</constraints>
<properties>
<text value="Synchronization:"/>
</properties>
</component>
<scrollpane id="61c1a">
<constraints>
<grid row="4" column="1" row-span="2" col-span="2" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false">
<preferred-size width="222" height="144"/>
</grid>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="4738" class="javax.swing.JList" binding="revisionsList">
<constraints/>
<properties>
<model>
<item value="commit 1"/>
<item value="commit 2"/>
<item value="commit 1"/>
<item value="commit 2"/>
<item value="commit 1"/>
<item value="commit 2"/>
<item value="commit 1"/>
<item value="commit 2"/>
<item value="commit 1"/>
<item value="commit 2"/>
<item value="commit 1"/>
<item value="commit 2"/>
<item value="commit 1"/>
<item value="commit 2"/>
<item value="commit 1"/>
<item value="commit 2"/>
</model>
</properties>
</component>
</children>
</scrollpane>
<grid id="7dd0b" binding="synchronizationStatusPanel" layout-manager="CardLayout" hgap="0" vgap="0">
<constraints>
<grid row="0" column="3" row-span="2" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
<preferred-size width="101" height="0"/>
</grid>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
</form>
@@ -7,16 +7,21 @@ import com.svn.utils.mirror.gui.enums.RepositoryType;
import com.svn.utils.mirror.gui.enums.SynchronizationStatus;
import com.svn.utils.mirror.gui.logger.StatusLogger;
import com.svn.utils.mirror.gui.model.RepositoryModel;
import com.svn.utils.mirror.gui.model.Revision;
import com.svn.utils.mirror.gui.model.RevisionModel;
import com.svn.utils.mirror.gui.view.SynchronizationStatusComponent;
import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.SVNURL;
import javax.swing.*;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.List;
/**
* SvnMirror
@@ -34,6 +39,7 @@ public class MainWindow extends JFrame implements CreateRepoInt {
private JPanel rootServerLoginPanel;
private JEditorPane detailsPane;
private JPanel synchronizationStatusPanel;
private JList revisionsList;
private StatusLogger statusLogger;
private RepoAction repoAction;
private SynchronizationStatusComponent synchronizationStatusComponent;
@@ -57,14 +63,25 @@ public class MainWindow extends JFrame implements CreateRepoInt {
setVisible(true);
initSynchronizationStatusComponent();
initRemoteOrLocalComboBox();
//@todo temp
setRevisionList(new RevisionModel().getRevisions());
}
private void initRemoteOrLocalComboBox() {
DefaultComboBoxModel<RepositoryModel> repositoryTypeComboBoxModel = new DefaultComboBoxModel<RepositoryModel>();
repositoryTypeComboBoxModel.addElement(new RepositoryModel(RepositoryType.REMOTE));
repositoryTypeComboBoxModel.addElement(new RepositoryModel(RepositoryType.LOCAL));
repositoryTypeComboBox.setModel(repositoryTypeComboBoxModel);
}
private void setRevisionList(List<Revision> revisionList) {
DefaultListModel<Revision> revisionDefaultListModel = new DefaultListModel<>();
for (Revision revision : revisionList) {
revisionDefaultListModel.addElement(revision);
}
revisionsList.setModel(revisionDefaultListModel);
}
private void initSynchronizationStatusComponent() {
@@ -105,6 +122,15 @@ public class MainWindow extends JFrame implements CreateRepoInt {
}
}
});
revisionsList.addListSelectionListener(new ListSelectionListener() {
@Override
public void valueChanged(ListSelectionEvent e) {
if (!e.getValueIsAdjusting()) {
detailsPane.setText(revisionsList.getSelectedValue().toString());
}
}
});
}
@Override
@@ -0,0 +1,18 @@
package com.svn.utils.mirror.gui.model;
/**
* SvnMirror
* Created by Marcin on 2015-06-17.
*/
public class Revision {
private String name;
public Revision(String name) {
this.name = name;
}
@Override
public String toString() {
return name;
}
}
@@ -0,0 +1,26 @@
package com.svn.utils.mirror.gui.model;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* SvnMirror
* Created by Marcin on 2015-06-17.
*/
public class RevisionModel {
private List<Revision> revisions;
public RevisionModel() {
Revision r1 = new Revision("Commit " + new Date().getTime());
Revision r2 = new Revision("Commit " + new Date().toString());
revisions = new ArrayList<>();
revisions.add(r1);
revisions.add(r2);
}
public List<Revision> getRevisions() {
return revisions;
}
}