Update of /cvsroot/jxtaim/jxtaim/src/vsis/im/view
In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv21822/src/vsis/im/view
Modified Files:
ChatGui.java
Log Message:
implement hyperlink listener for chat view and editor. For now use BrowserController to process/open URLs.
Index: ChatGui.java
===================================================================
RCS file: /cvsroot/jxtaim/jxtaim/src/vsis/im/view/ChatGui.java,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** ChatGui.java 23 Jul 2006 17:10:22 -0000 1.20
--- ChatGui.java 24 Jul 2006 11:55:13 -0000 1.21
***************
*** 56,59 ****
--- 56,61 ----
import javax.swing.JToolBar;
import javax.swing.border.LineBorder;
+ import javax.swing.event.HyperlinkEvent;
+ import javax.swing.event.HyperlinkListener;
import javax.swing.text.BadLocationException;
import javax.swing.text.SimpleAttributeSet;
***************
*** 67,70 ****
--- 69,73 ----
import vsis.im.storage.ModelPersistenceController;
import vsis.im.view.util.BBStyledEditorKit;
+ import vsis.im.view.util.BrowserController;
***************
*** 219,222 ****
--- 222,234 ----
chatpane.setBorder(new LineBorder(Color.DARK_GRAY,1));
chatpane.setBackground(Color.WHITE);
+ chatpane.addHyperlinkListener(new HyperlinkListener()
+ {
+ public void hyperlinkUpdate(HyperlinkEvent e) {
+ if(e.getEventType() == HyperlinkEvent.EventType.ACTIVATED)
+ {
+ new BrowserController().openBrowser(e.getURL().toString());
+ }
+ }
+ });
chatscroller = new JScrollPane(chatpane,JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
***************
*** 264,267 ****
--- 276,280 ----
});
+
inputtoolbar.add(new BBStyledEditorKit.BBUnderlineAction() {
@Override
***************
*** 286,289 ****
--- 299,312 ----
inputarea.setBackground(Color.WHITE);
+ inputarea.addHyperlinkListener(new HyperlinkListener()
+ {
+ public void hyperlinkUpdate(HyperlinkEvent e) {
+ if(e.getEventType() == HyperlinkEvent.EventType.ACTIVATED)
+ {
+ new BrowserController().openBrowser(e.getURL().toString());
+ }
+ }
+ });
+
// XXX: (keyPressed) this has to be replaced with an external binding
// configuration of keys with masks: a generic method here; explicit
|