Skip to Content.
Sympa Menu

perfsonar-dev - perfsonar: r4324 - in branches/perfsonarui/src/org/perfsonar/perfsonarui: ma ma/ui/panels playground ui/panels

Subject: perfsonar development work

List archive

perfsonar: r4324 - in branches/perfsonarui/src/org/perfsonar/perfsonarui: ma ma/ui/panels playground ui/panels


Chronological Thread 
  • From:
  • To:
  • Subject: perfsonar: r4324 - in branches/perfsonarui/src/org/perfsonar/perfsonarui: ma ma/ui/panels playground ui/panels
  • Date: Fri, 1 Aug 2008 10:53:36 -0400

Author: nina
Date: 2008-08-01 10:53:36 -0400 (Fri, 01 Aug 2008)
New Revision: 4324

Modified:

branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ResourceBundle.properties

branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/panels/SearchPanel.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/playground/PlaygroundPanel.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/playground/ResourceBundle.properties
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/panels/TextPanel.java
Log:
Fix for bug 535 https://bugzilla.perfsonar.net/show_bug.cgi?id=535
"interface tab", "file" button: added more explanation that there have to
be IP addresses in the file.
The tooltip is retrieved from ResourceBundle.properties. The File popup help
menu items in playground are also updated.


Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ResourceBundle.properties
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ResourceBundle.properties
2008-08-01 14:15:20 UTC (rev 4323)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ResourceBundle.properties
2008-08-01 14:53:36 UTC (rev 4324)
@@ -6,3 +6,4 @@
msg_output_drops =Output drops
msg_select_interface=Select interface
action_trace=Traceroute & search
+action_file_help=A file with a list of IP addresses is expected. Reads the
file content and inserts it into the search panel at the left.

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/panels/SearchPanel.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/panels/SearchPanel.java
2008-08-01 14:15:20 UTC (rev 4323)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/panels/SearchPanel.java
2008-08-01 14:53:36 UTC (rev 4324)
@@ -50,7 +50,7 @@
* @author Nina Jeliazkova

* <b>Modified</b> 2005-12-10
*/
-public class SearchPanel extends TextPanel implements DocumentListener,
PropertyChangeListener{
+public class SearchPanel extends TextPanel<MAPerfsonarModel> implements
DocumentListener, PropertyChangeListener{
protected MAPerfsonarModel model;
//protected JTextArea textArea ;
//protected PasteAction pasteAction;
@@ -64,7 +64,7 @@
*
*/
public SearchPanel(MAPerfsonarModel psModel) {
- super("Search by interface IP");
+ super(psModel,"Search by interface IP");
this.model = psModel;
add(createMenuPanel(model),BorderLayout.EAST);
createPopupmenu(model);
@@ -73,32 +73,8 @@


@Override
- public void addWidgets(String title) {
- /*
- //MAPerfsonarModel psModel = (MAPerfsonarModel) pm;
- setMinimumSize(minDimension);
- //this.model = (MAPerfsonarModel)pm;
- setLayout(new BorderLayout());
- setBorder(BorderFactory.createTitledBorder(title));
- textArea = new JTextArea();
- textArea.setLineWrap(false);
- textArea.getDocument().addDocumentListener(this);
- textArea.setToolTipText("Enter one IP address per row or paste a
traceroute output");
-
- pasteAction = new PasteAction(textArea);
- loadFromFileAction = new LoadFromFileAction(textArea);
-
- //textArea.setBorder(BorderFactory.createLineBorder(Color.blue));
- JScrollPane sp = new JScrollPane(textArea);
- add(sp,BorderLayout.CENTER);
-
- add(createMenuPanel(model),BorderLayout.EAST);
- createPopupmenu(model);
-
- setPreferredSize(new Dimension(300,100));
- setMinimumSize(new Dimension(100,100));
- */
- super.addWidgets(title);
+ public void addWidgets(MAPerfsonarModel psModel,String title) {
+ super.addWidgets(psModel,title);
textArea.setToolTipText("Enter one IP address per row or paste a
traceroute output");
}
protected JComponent createMenuPanel(final MAPerfsonarModel psModel) {

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/playground/PlaygroundPanel.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/playground/PlaygroundPanel.java
2008-08-01 14:15:20 UTC (rev 4323)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/playground/PlaygroundPanel.java
2008-08-01 14:53:36 UTC (rev 4324)
@@ -69,7 +69,7 @@
@Override
public void addWidgets() {
setLayout(new BorderLayout());
- query = new TextPanel("Query");
+ query = new TextPanel(getModel(),"Query");

query.getTextArea().getDocument().addDocumentListener(this);
query.getTextArea().setToolTipText("XML message to be sent as
a query");
@@ -77,7 +77,7 @@
query.setMinimumSize(new Dimension(200,200));
query.getTextArea().setEditable(true);

- response = new TextPanel("Response");
+ response = new
TextPanel(getModel(),"Response","action_filesave_help");
response.getTextArea().setEditable(false);


response.setBorder(BorderFactory.createTitledBorder("Response"));

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/playground/ResourceBundle.properties
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/playground/ResourceBundle.properties
2008-08-01 14:15:20 UTC (rev 4323)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/playground/ResourceBundle.properties
2008-08-01 14:53:36 UTC (rev 4324)
@@ -0,0 +1,2 @@
+action_file_help=Reads an user selected file and inserts it into the query
panel.
+action_filesave_help=Saves the response panel content into an user selected
file.
\ No newline at end of file

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/panels/TextPanel.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/panels/TextPanel.java
2008-08-01 14:15:20 UTC (rev 4323)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/panels/TextPanel.java
2008-08-01 14:53:36 UTC (rev 4324)
@@ -43,24 +43,34 @@
import javax.swing.JScrollPane;
import javax.swing.JTextArea;

+import org.perfsonar.perfsonarui.plugins.IPerfsonarTab;
+
/**
* Text area with popup menu.
* @author Nina Jeliazkova
*
*/
-public class TextPanel extends JPanel {
+public class TextPanel<T extends IPerfsonarTab> extends JPanel {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 7001993940368232188L;
protected Dimension minDimension = new Dimension(100,100);
protected Dimension prefDimension = new Dimension(300,100);
protected JTextArea textArea ;
protected PasteAction pasteAction;
protected LoadFromFileAction loadFromFileAction;
- public TextPanel(String title) {
+ public TextPanel(T tab,String title) {
+ this(tab,title,"action_file_help");
+ }
+ public TextPanel(T tab,String title, String file_hint) {
super();
- addWidgets(title);
-
+ addWidgets(tab,title,file_hint);
}
-
- public void addWidgets(String title) {
+ public void addWidgets(T tab,String title) {
+ addWidgets(tab, title,"action_file_help");
+ }
+ public void addWidgets(T tab,String title,String file_hint) {
//MAPerfsonarModel psModel = (MAPerfsonarModel) pm;
setLayout(new BorderLayout());
setBorder(BorderFactory.createTitledBorder(title));
@@ -69,8 +79,15 @@
textArea.setToolTipText("");

pasteAction = new PasteAction(textArea);
- loadFromFileAction = new LoadFromFileAction(textArea);
+
+ try {
+ loadFromFileAction = new LoadFromFileAction(textArea,
+ tab.getResourceBundle().getString(file_hint));
+ } catch (Exception x) {
+ loadFromFileAction = new LoadFromFileAction(textArea);
+ }

+
//textArea.setBorder(BorderFactory.createLineBorder(Color.blue));
JScrollPane sp = new JScrollPane(textArea);
add(sp,BorderLayout.CENTER);
@@ -159,9 +176,13 @@
*/
private static final long serialVersionUID = -7045037760778336024L;
protected JTextArea textArea;
+
public LoadFromFileAction(JTextArea textArea) {
+ this(textArea,"Loads from file");
+ }
+ public LoadFromFileAction(JTextArea textArea, String hint) {
super("File");
- putValue(Action.SHORT_DESCRIPTION, "Load from file");
+ putValue(Action.SHORT_DESCRIPTION, hint);
this.textArea = textArea;
}
public void actionPerformed(ActionEvent arg0) {



  • perfsonar: r4324 - in branches/perfsonarui/src/org/perfsonar/perfsonarui: ma ma/ui/panels playground ui/panels, svnlog, 08/01/2008

Archive powered by MHonArc 2.6.16.

Top of Page