Author: jflesch
Date: 2007-04-18 18:52:38 +0000 (Wed, 18 Apr 2007)
New Revision: 12784
Added:
trunk/apps/Thaw/images/min-newComment.png
trunk/apps/Thaw/images/min-readComments.png
trunk/apps/Thaw/images/newComment.png
trunk/apps/Thaw/images/readComments.png
Modified:
trunk/apps/Thaw/src/thaw/core/ConfigWindow.java
trunk/apps/Thaw/src/thaw/plugins/index/DetailPanel.java
trunk/apps/Thaw/src/thaw/plugins/index/IndexBrowserPanel.java
trunk/apps/Thaw/src/thaw/plugins/index/IndexManagementHelper.java
Log:
Make the config window resizeable
Added: trunk/apps/Thaw/images/min-newComment.png
===================================================================
(Binary files differ)
Property changes on: trunk/apps/Thaw/images/min-newComment.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/apps/Thaw/images/min-readComments.png
===================================================================
(Binary files differ)
Property changes on: trunk/apps/Thaw/images/min-readComments.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/apps/Thaw/images/newComment.png
===================================================================
(Binary files differ)
Property changes on: trunk/apps/Thaw/images/newComment.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/apps/Thaw/images/readComments.png
===================================================================
(Binary files differ)
Property changes on: trunk/apps/Thaw/images/readComments.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/apps/Thaw/src/thaw/core/ConfigWindow.java
===================================================================
--- trunk/apps/Thaw/src/thaw/core/ConfigWindow.java 2007-04-18 18:47:40 UTC
(rev 12783)
+++ trunk/apps/Thaw/src/thaw/core/ConfigWindow.java 2007-04-18 18:52:38 UTC
(rev 12784)
@@ -80,7 +80,7 @@
okButton.setSize(100, 40);
configWin.setSize(600, 450);
- configWin.setResizable(false);
+ //configWin.setResizable(false);
okButton.addActionListener(this);
cancelButton.addActionListener(this);
Modified: trunk/apps/Thaw/src/thaw/plugins/index/DetailPanel.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/index/DetailPanel.java 2007-04-18
18:47:40 UTC (rev 12783)
+++ trunk/apps/Thaw/src/thaw/plugins/index/DetailPanel.java 2007-04-18
18:52:38 UTC (rev 12784)
@@ -11,8 +11,11 @@
import java.util.Iterator;
import thaw.core.I18n;
+import thaw.core.Logger;
+import thaw.fcp.FCPQueueManager;
+
/**
* Initially, I wanted to use it to show details about the
* currently-viewed index, but in the end it will mostly
@@ -24,7 +27,7 @@
private Vector buttonActions;
- public DetailPanel() {
+ public DetailPanel(FCPQueueManager queueManager, IndexBrowserPanel
indexBrowser) {
panel = new JPanel(new BorderLayout());
panel.add(new JLabel(""), BorderLayout.CENTER); /* because we
need something */
@@ -38,7 +41,7 @@
buttonPanel.add(button);
button = new
JButton(I18n.getMessage("thaw.plugin.index.comment.add"));
- buttonActions.add(new
IndexManagementHelper.IndexCommentAdder(button));
+ buttonActions.add(new
IndexManagementHelper.IndexCommentAdder(queueManager, indexBrowser, button));
buttonPanel.add(button);
@@ -51,15 +54,12 @@
}
- public void setList(final FileAndLinkList l) {
- if (l instanceof Index) {
- for (Iterator it = buttonActions.iterator();
- it.hasNext();) {
- IndexManagementHelper.IndexAction action =
(IndexManagementHelper.IndexAction)it.next();
- action.setTarget((Index)l);
- }
-
+ public void setIndexTarget(Index l) {
+ for (Iterator it = buttonActions.iterator();
+ it.hasNext();) {
+ IndexManagementHelper.IndexAction action =
(IndexManagementHelper.IndexAction)it.next();
+ action.setTarget((Index)l);
}
}
Modified: trunk/apps/Thaw/src/thaw/plugins/index/IndexBrowserPanel.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/index/IndexBrowserPanel.java
2007-04-18 18:47:40 UTC (rev 12783)
+++ trunk/apps/Thaw/src/thaw/plugins/index/IndexBrowserPanel.java
2007-04-18 18:52:38 UTC (rev 12784)
@@ -58,7 +58,7 @@
listAndDetails.setLayout(new BorderLayout(10, 10));
tables = new Tables(false, queueManager, this, config);
- detailPanel = new DetailPanel();
+ detailPanel = new DetailPanel(queueManager, this);
listAndDetails.add(tables.getPanel(), BorderLayout.CENTER);
listAndDetails.add(detailPanel.getPanel(), BorderLayout.SOUTH);
@@ -155,7 +155,11 @@
protected void setList(final FileAndLinkList l) {
tables.setList(l);
- detailPanel.setList(l);
+
+ if (l instanceof Index)
+ detailPanel.setIndexTarget((Index)l);
+ else
+ detailPanel.setIndexTarget(null);
}
protected void setFileList(final FileList l) {
@@ -183,14 +187,19 @@
return;
}
- if (node instanceof FileList) {
- Logger.debug(this, "FileList !");
- setFileList((FileList)node);
- }
+ if (node instanceof FileAndLinkList) {
+ Logger.debug(this, "FileAndLinkList !");
+ setList((FileAndLinkList)node);
+ } else {
+ if (node instanceof FileList) {
+ Logger.debug(this, "FileList !");
+ setFileList((FileList)node);
+ }
- if (node instanceof LinkList) {
- Logger.debug(this, "LinkList !");
- setLinkList((LinkList)node);
+ if (node instanceof LinkList) {
+ Logger.debug(this, "LinkList !");
+ setLinkList((LinkList)node);
+ }
}
}
Modified: trunk/apps/Thaw/src/thaw/plugins/index/IndexManagementHelper.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/index/IndexManagementHelper.java
2007-04-18 18:47:40 UTC (rev 12783)
+++ trunk/apps/Thaw/src/thaw/plugins/index/IndexManagementHelper.java
2007-04-18 18:52:38 UTC (rev 12784)
@@ -1512,10 +1512,14 @@
- public static class IndexCommentAdder extends BasicIndexAction
implements Runnable {
- public IndexCommentAdder(final AbstractButton actionSource) {
- super(null, null, actionSource);
+ public static class IndexCommentAdder extends BasicIndexAction
implements Runnable, ActionListener {
+ public IndexCommentAdder(FCPQueueManager queueManager,
+ IndexBrowserPanel indexBrowser,
+ final AbstractButton actionSource) {
+
+ super(queueManager, indexBrowser, actionSource);
+
if (actionSource != null)
actionSource.setEnabled(false);
}
@@ -1523,12 +1527,27 @@
public void setTarget(final IndexTreeNode node) {
super.setTarget(node);
- getActionSource().setEnabled(node instanceof Index
- &&
((Index)node).canHaveComments());
+
+ if (getActionSource() != null)
+ getActionSource().setEnabled(node instanceof
Index
+ &&
((Index)node).canHaveComments());
}
+
+ private void showDialog() {
+
+ }
+
+
+ public void actionPerformed(ActionEvent e) {
+ if (e.getSource() == getActionSource())
+ super.actionPerformed(e);
+
+ }
+
+
public void apply() {
- /* TODO */
+ showDialog();
}
}
@@ -1544,8 +1563,10 @@
public void setTarget(final IndexTreeNode node) {
super.setTarget(node);
- getActionSource().setEnabled(node instanceof Index
- &&
((Index)node).canHaveComments());
+
+ if (getActionSource() != null)
+ getActionSource().setEnabled(node instanceof
Index
+ &&
((Index)node).canHaveComments());
}
public void apply() {