Author: mjakl
Date: Sat Aug 15 10:18:18 2009
New Revision: 804449
URL: http://svn.apache.org/viewvc?rev=804449&view=rev
Log:
Added a refresh button to reload all nodes (sync with server).
Added:
mina/sandbox/vysper/trunk/demo/pubsub/client/src/main/java/org/apache/vysper/demo/pubsub/client/PubsubRefreshButtonListener.java
Modified:
mina/sandbox/vysper/trunk/demo/pubsub/client/src/main/java/org/apache/vysper/demo/pubsub/client/PubsubClientGUI.java
Modified:
mina/sandbox/vysper/trunk/demo/pubsub/client/src/main/java/org/apache/vysper/demo/pubsub/client/PubsubClientGUI.java
URL:
http://svn.apache.org/viewvc/mina/sandbox/vysper/trunk/demo/pubsub/client/src/main/java/org/apache/vysper/demo/pubsub/client/PubsubClientGUI.java?rev=804449&r1=804448&r2=804449&view=diff
==============================================================================
---
mina/sandbox/vysper/trunk/demo/pubsub/client/src/main/java/org/apache/vysper/demo/pubsub/client/PubsubClientGUI.java
(original)
+++
mina/sandbox/vysper/trunk/demo/pubsub/client/src/main/java/org/apache/vysper/demo/pubsub/client/PubsubClientGUI.java
Sat Aug 15 10:18:18 2009
@@ -77,9 +77,14 @@
delete.addActionListener(new PubsubDeleteButtonListener(frame, pcm));
delete.setEnabled(false);
+ JButton refresh = new JButton("Refresh");
+ refresh.setActionCommand("refresh");
+ refresh.addActionListener(new PubsubRefreshButtonListener(pcm));
+
JPanel buttons = new JPanel();
buttons.add(create);
buttons.add(delete);
+ buttons.add(refresh);
frame.add(panel);
Added:
mina/sandbox/vysper/trunk/demo/pubsub/client/src/main/java/org/apache/vysper/demo/pubsub/client/PubsubRefreshButtonListener.java
URL:
http://svn.apache.org/viewvc/mina/sandbox/vysper/trunk/demo/pubsub/client/src/main/java/org/apache/vysper/demo/pubsub/client/PubsubRefreshButtonListener.java?rev=804449&view=auto
==============================================================================
---
mina/sandbox/vysper/trunk/demo/pubsub/client/src/main/java/org/apache/vysper/demo/pubsub/client/PubsubRefreshButtonListener.java
(added)
+++
mina/sandbox/vysper/trunk/demo/pubsub/client/src/main/java/org/apache/vysper/demo/pubsub/client/PubsubRefreshButtonListener.java
Sat Aug 15 10:18:18 2009
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.vysper.demo.pubsub.client;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+public class PubsubRefreshButtonListener implements ActionListener {
+
+ private PubsubClientModel parent;
+
+ public PubsubRefreshButtonListener(PubsubClientModel parent) {
+ this.parent = parent;
+ }
+
+ public void actionPerformed(ActionEvent e) {
+ parent.refresh();
+ }
+}