projects
/
jSite2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use a JSplitPane to divide the two panels of the file manager.
[jSite2.git]
/
src
/
net
/
pterodactylus
/
jsite
/
gui
/
FileManager.java
diff --git
a/src/net/pterodactylus/jsite/gui/FileManager.java
b/src/net/pterodactylus/jsite/gui/FileManager.java
index
766677f
..
98e9d80
100644
(file)
--- a/
src/net/pterodactylus/jsite/gui/FileManager.java
+++ b/
src/net/pterodactylus/jsite/gui/FileManager.java
@@
-59,9
+59,11
@@
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.JScrollPane;
import javax.swing.JSeparator;
import javax.swing.JPopupMenu;
import javax.swing.JScrollPane;
import javax.swing.JSeparator;
+import javax.swing.JSplitPane;
import javax.swing.JTextField;
import javax.swing.JTree;
import javax.swing.SwingConstants;
import javax.swing.JTextField;
import javax.swing.JTree;
import javax.swing.SwingConstants;
+import javax.swing.border.EmptyBorder;
import javax.swing.event.TreeModelEvent;
import javax.swing.event.TreeModelListener;
import javax.swing.event.TreeSelectionEvent;
import javax.swing.event.TreeModelEvent;
import javax.swing.event.TreeModelListener;
import javax.swing.event.TreeSelectionEvent;
@@
-84,7
+86,7
@@
import net.pterodactylus.util.swing.SwingUtils;
/**
* Manages physical and virtual files in a project.
/**
* Manages physical and virtual files in a project.
- *
+ *
* @author David ‘Bombe’ Roden <bombe@freenetproject.org>
*/
public class FileManager extends JDialog implements I18nable, TreeSelectionListener, MouseListener {
* @author David ‘Bombe’ Roden <bombe@freenetproject.org>
*/
public class FileManager extends JDialog implements I18nable, TreeSelectionListener, MouseListener {
@@
-202,7
+204,7
@@
public class FileManager extends JDialog implements I18nable, TreeSelectionListe
/**
* Creates a new file manager.
/**
* Creates a new file manager.
- *
+ *
* @param swingInterface
* The Swing interface
* @param project
* @param swingInterface
* The Swing interface
* @param project
@@
-469,15
+471,17
@@
public class FileManager extends JDialog implements I18nable, TreeSelectionListe
/**
* Creates the main panel with the file tree and the file properties.
/**
* Creates the main panel with the file tree and the file properties.
- *
+ *
* @return The mail panel
*/
private Component createFileManagerPanel() {
* @return The mail panel
*/
private Component createFileManagerPanel() {
- JPanel fileManagerPanel = new JPanel(new BorderLayout(12, 12));
+ JSplitPane fileManagerPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true);
+ fileManagerPanel.setBorder(null);
/* file tree panel */
JPanel fileTreePanel = new JPanel(new BorderLayout(12, 12));
/* file tree panel */
JPanel fileTreePanel = new JPanel(new BorderLayout(12, 12));
- fileManagerPanel.add(fileTreePanel, BorderLayout.LINE_START);
+ fileTreePanel.setBorder(new EmptyBorder(0, 0, 0, 12));
+ fileManagerPanel.setLeftComponent(fileTreePanel);
fileTree = new JTree(fileTreeModel);
fileTree.setShowsRootHandles(false);
fileTree = new JTree(fileTreeModel);
fileTree.setShowsRootHandles(false);
@@
-494,7
+498,8
@@
public class FileManager extends JDialog implements I18nable, TreeSelectionListe
/* the right panel */
JPanel rightPanel = new JPanel(new BorderLayout(12, 12));
/* the right panel */
JPanel rightPanel = new JPanel(new BorderLayout(12, 12));
- fileManagerPanel.add(rightPanel, BorderLayout.CENTER);
+ rightPanel.setBorder(new EmptyBorder(0, 12, 0, 0));
+ fileManagerPanel.setRightComponent(rightPanel);
/* properties panel */
JPanel propertiesPanel = new JPanel(new GridBagLayout());
/* properties panel */
JPanel propertiesPanel = new JPanel(new GridBagLayout());
@@
-573,7
+578,7
@@
public class FileManager extends JDialog implements I18nable, TreeSelectionListe
/**
* Creates the button panel.
/**
* Creates the button panel.
- *
+ *
* @return The button panel
*/
private Component createButtonPanel() {
* @return The button panel
*/
private Component createButtonPanel() {
@@
-615,7
+620,7
@@
public class FileManager extends JDialog implements I18nable, TreeSelectionListe
/**
* Checks whether the given mouse event is a popup trigger and occured over
* a file. If so, the context menu is shown.
/**
* Checks whether the given mouse event is a popup trigger and occured over
* a file. If so, the context menu is shown.
- *
+ *
* @param mouseEvent
* The mouse event to check
*/
* @param mouseEvent
* The mouse event to check
*/
@@
-645,7
+650,7
@@
public class FileManager extends JDialog implements I18nable, TreeSelectionListe
/**
* Finds whether the {@link ProjectFile} given by
* <code>projectFileWrapper</code> is hidden.
/**
* Finds whether the {@link ProjectFile} given by
* <code>projectFileWrapper</code> is hidden.
- *
+ *
* @param projectFileWrapper
* The wrapped project file
* @return <code>true</code> if the file is hidden and should not be
* @param projectFileWrapper
* The wrapped project file
* @return <code>true</code> if the file is hidden and should not be
@@
-731,7
+736,7
@@
public class FileManager extends JDialog implements I18nable, TreeSelectionListe
/**
* Returns all currently selected {@link ProjectFileWrapper}s.
/**
* Returns all currently selected {@link ProjectFileWrapper}s.
- *
+ *
* @param filesOnly
* <code>true</code> to return only selected files,
* <code>false</code> to include directories
* @param filesOnly
* <code>true</code> to return only selected files,
* <code>false</code> to include directories
@@
-755,7
+760,7
@@
public class FileManager extends JDialog implements I18nable, TreeSelectionListe
/**
* Sets the given action’s enabled state to the given enabled state if the
* action’s current enabled state is not the given enabled state.
/**
* Sets the given action’s enabled state to the given enabled state if the
* action’s current enabled state is not the given enabled state.
- *
+ *
* @param action
* The action to set the enabled state on
* @param enabled
* @param action
* The action to set the enabled state on
* @param enabled
@@
-770,7
+775,7
@@
public class FileManager extends JDialog implements I18nable, TreeSelectionListe
/**
* Sets the given button’s selected state to the given selected state if the
* button’s current selected state is not the given selected state.
/**
* Sets the given button’s selected state to the given selected state if the
* button’s current selected state is not the given selected state.
- *
+ *
* @param button
* The button to set the selected state on
* @param selected
* @param button
* The button to set the selected state on
* @param selected
@@
-786,7
+791,7
@@
public class FileManager extends JDialog implements I18nable, TreeSelectionListe
* Returns the extension of the given filename. If the file name does not
* have an extension, the name of the file (without any path components) is
* returned.
* Returns the extension of the given filename. If the file name does not
* have an extension, the name of the file (without any path components) is
* returned.
- *
+ *
* @param fileName
* The name of the file
* @return The extension of the file
* @param fileName
* The name of the file
* @return The extension of the file
@@
-799,7
+804,7
@@
public class FileManager extends JDialog implements I18nable, TreeSelectionListe
/**
* Repopulates the content type combo box with all content types, putting
* the most probably ones to the front of the list.
/**
* Repopulates the content type combo box with all content types, putting
* the most probably ones to the front of the list.
- *
+ *
* @param fileName
* The name of the file
*/
* @param fileName
* The name of the file
*/
@@
-945,7
+950,7
@@
public class FileManager extends JDialog implements I18nable, TreeSelectionListe
/**
* Tree cell renderer that takes care of certain display properties for
* project-specific stuff.
/**
* Tree cell renderer that takes care of certain display properties for
* project-specific stuff.
- *
+ *
* @author David ‘Bombe’ Roden <bombe@freenetproject.org>
*/
private class FileCellRenderer extends DefaultTreeCellRenderer {
* @author David ‘Bombe’ Roden <bombe@freenetproject.org>
*/
private class FileCellRenderer extends DefaultTreeCellRenderer {
@@
-1014,7
+1019,7
@@
public class FileManager extends JDialog implements I18nable, TreeSelectionListe
/**
* TreeModel that is based on {@link Project#getBaseFile()}.
/**
* TreeModel that is based on {@link Project#getBaseFile()}.
- *
+ *
* @author David ‘Bombe’ Roden <bombe@freenetproject.org>
*/
private class ProjectFileTreeModel implements TreeModel, PropertyChangeListener {
* @author David ‘Bombe’ Roden <bombe@freenetproject.org>
*/
private class ProjectFileTreeModel implements TreeModel, PropertyChangeListener {
@@
-1058,7
+1063,7
@@
public class FileManager extends JDialog implements I18nable, TreeSelectionListe
/**
* Notifies all listeners that a node has changed.
/**
* Notifies all listeners that a node has changed.
- *
+ *
* @param changedProjectFileWrapper
* The wrapper around the changed project file
*/
* @param changedProjectFileWrapper
* The wrapper around the changed project file
*/
@@
-1080,7
+1085,7
@@
public class FileManager extends JDialog implements I18nable, TreeSelectionListe
/**
* Notifies all listeners that the tree structure has changed
* significantly.
/**
* Notifies all listeners that the tree structure has changed
* significantly.
- *
+ *
* @see TreeModelListener#treeStructureChanged(TreeModelEvent)
* @param newRootNode
*/
* @see TreeModelListener#treeStructureChanged(TreeModelEvent)
* @param newRootNode
*/
@@
-1096,7
+1101,7
@@
public class FileManager extends JDialog implements I18nable, TreeSelectionListe
/**
* Sets the new base project file. This causes the model to reload.
/**
* Sets the new base project file. This causes the model to reload.
- *
+ *
* @param baseProjectFile
* The new base project file
*/
* @param baseProjectFile
* The new base project file
*/
@@
-1117,7
+1122,7
@@
public class FileManager extends JDialog implements I18nable, TreeSelectionListe
/**
* Creates {@link ProjectFileWrapper}s for all files below the given
* project file.
/**
* Creates {@link ProjectFileWrapper}s for all files below the given
* project file.
- *
+ *
* @param projectFile
* The base project file for all project files to create
* wrappers for
* @param projectFile
* The base project file for all project files to create
* wrappers for
@@
-1245,7
+1250,7
@@
public class FileManager extends JDialog implements I18nable, TreeSelectionListe
/**
* Wrapper around a {@link ProjectFile} that overwrites
* {@link Object#toString()} to return the project file’s name.
/**
* Wrapper around a {@link ProjectFile} that overwrites
* {@link Object#toString()} to return the project file’s name.
- *
+ *
* @author David ‘Bombe’ Roden <bombe@freenetproject.org>
*/
private static class ProjectFileWrapper {
* @author David ‘Bombe’ Roden <bombe@freenetproject.org>
*/
private static class ProjectFileWrapper {
@@
-1258,7
+1263,7
@@
public class FileManager extends JDialog implements I18nable, TreeSelectionListe
/**
* Creates a new wrapper around a project file.
/**
* Creates a new wrapper around a project file.
- *
+ *
* @param projectFile
* The project file to wrap
*/
* @param projectFile
* The project file to wrap
*/
@@
-1268,7
+1273,7
@@
public class FileManager extends JDialog implements I18nable, TreeSelectionListe
/**
* Returns the wrapped project file.
/**
* Returns the wrapped project file.
- *
+ *
* @return The wrapped project file
*/
public ProjectFile getProjectFile() {
* @return The wrapped project file
*/
public ProjectFile getProjectFile() {
@@
-1278,7
+1283,7
@@
public class FileManager extends JDialog implements I18nable, TreeSelectionListe
/**
* Sets the name override. If the name override is not <code>null</code>
* it will be shown insted of the project file’s name.
/**
* Sets the name override. If the name override is not <code>null</code>
* it will be shown insted of the project file’s name.
- *
+ *
* @param nameOverride
* The name override
*/
* @param nameOverride
* The name override
*/
@@
-1299,7
+1304,7
@@
public class FileManager extends JDialog implements I18nable, TreeSelectionListe
/**
* A cell renderer for combo boxes that converts the string “--” to a
* separator.
/**
* A cell renderer for combo boxes that converts the string “--” to a
* separator.
- *
+ *
* @author David ‘Bombe’ Roden <bombe@freenetproject.org>
*/
private class MimeTypeComboBoxRenderer extends DefaultListCellRenderer {
* @author David ‘Bombe’ Roden <bombe@freenetproject.org>
*/
private class MimeTypeComboBoxRenderer extends DefaultListCellRenderer {