import jalview.jbgui.*;
/**
- * Cut'n'paste files into the desktop
- * See JAL-1105
+ * Cut'n'paste files into the desktop See JAL-1105
*
* @author $author$
* @version $Revision$
displaySource.setSelected(false);
textarea.addKeyListener(new KeyListener()
{
-
+
@Override
public void keyTyped(KeyEvent arg0)
{
- //if (arg0.isControlDown() && arg0.getKeyCode()==KeyEvent.VK_C)
- //{
- // copyItem_actionPerformed(null);
- //}
+ // if (arg0.isControlDown() && arg0.getKeyCode()==KeyEvent.VK_C)
+ // {
+ // copyItem_actionPerformed(null);
+ // }
arg0.consume();
}
-
+
@Override
public void keyReleased(KeyEvent arg0)
{
// TODO Auto-generated method stub
-
+
}
-
+
@Override
public void keyPressed(KeyEvent arg0)
{
// TODO Auto-generated method stub
-
+
}
});
textarea.setEditable(false);
textarea.addHyperlinkListener(new HyperlinkListener()
{
-
+
@Override
public void hyperlinkUpdate(HyperlinkEvent e)
{
{
return textarea.getText();
}
+
/**
* Set contents of HTML Display pane
*
- * @param text HTML text
+ * @param text
+ * HTML text
*/
public void setText(String text)
{
public void toggleHtml_actionPerformed(ActionEvent e)
{
- String txt=textarea.getText();
- textarea.setContentType(displaySource.isSelected() ? "text/text" : "text/html");
+ String txt = textarea.getText();
+ textarea.setContentType(displaySource.isSelected() ? "text/text"
+ : "text/html");
textarea.setText(txt);
}
+
/**
* DOCUMENT ME!
*
{
Clipboard c = Toolkit.getDefaultToolkit().getSystemClipboard();
StringWriter sw = new StringWriter();
- try {
- textarea.getEditorKit().write(sw, textarea.getDocument(), textarea.getSelectionStart(), textarea.getSelectionEnd()-textarea.getSelectionStart());
- } catch (Exception x){};
- StringSelection ssel=new StringSelection(sw.getBuffer().toString());
- c.setContents(ssel,ssel);
+ try
+ {
+ textarea.getEditorKit().write(sw, textarea.getDocument(),
+ textarea.getSelectionStart(),
+ textarea.getSelectionEnd() - textarea.getSelectionStart());
+ } catch (Exception x)
+ {
+ }
+ ;
+ StringSelection ssel = new StringSelection(sw.getBuffer().toString());
+ c.setContents(ssel, ssel);
}
-
/**
* DOCUMENT ME!
*