+ /* TODO */
+ }
+
+ //
+ // INTERFACE MouseListener
+ //
+
+ /**
+ * {@inheritDoc}
+ */
+ public void mouseClicked(MouseEvent mouseEvent) {
+ maybeShowContextMenu(mouseEvent);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void mouseEntered(MouseEvent mouseEvent) {
+ /* ignore. */
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void mouseExited(MouseEvent mouseEvent) {
+ /* ignore. */
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void mousePressed(MouseEvent mouseEvent) {
+ maybeShowContextMenu(mouseEvent);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void mouseReleased(MouseEvent mouseEvent) {
+ maybeShowContextMenu(mouseEvent);
+ }
+
+ /**
+ * 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 {
+
+ /**
+ * Empty constructor.
+ */
+ FileCellRenderer() {
+ /* do nothing. */
+ }
+
+ /**
+ * @see javax.swing.tree.TreeCellRenderer#getTreeCellRendererComponent(javax.swing.JTree,
+ * java.lang.Object, boolean, boolean, boolean, int, boolean)
+ */
+ @SuppressWarnings("synthetic-access")
+ @Override
+ public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) {
+ Component superCellRenderer = super.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus);
+ if (!(superCellRenderer instanceof JLabel)) {
+ logger.log(Level.SEVERE, "superCellRenderer is not a JLabel!");
+ return superCellRenderer;
+ }
+ if (!(value instanceof ProjectFileWrapper)) {
+ logger.log(Level.SEVERE, "value is not a ProjectFileWrapper!");
+ return superCellRenderer;
+ }
+ ProjectFileWrapper projectFileWrapper = (ProjectFileWrapper) value;
+ ProjectFile projectFile = projectFileWrapper.getProjectFile();
+ String completePath = projectFile.getCompletePath();
+ boolean paintBold = false;
+ boolean paintHalfColor = false;
+ if (projectFile.isFile() && projectFile.isHidden()) {
+ /* TODO - check override */
+ paintHalfColor = true;
+ } else if (completePath.equals(project.getDefaultFile())) {
+ paintBold = true;
+ } else if (projectFile.getParents().size() == 1) {
+ paintBold = true;