git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'develop' into bug/JAL-4059_update_swingJS_for_JalviewJS_2_11_2_and_2_11_3
[jalview.git]
/
src
/
jalview
/
gui
/
CutAndPasteHtmlTransfer.java
diff --git
a/src/jalview/gui/CutAndPasteHtmlTransfer.java
b/src/jalview/gui/CutAndPasteHtmlTransfer.java
index
9c06f95
..
4469ceb
100644
(file)
--- a/
src/jalview/gui/CutAndPasteHtmlTransfer.java
+++ b/
src/jalview/gui/CutAndPasteHtmlTransfer.java
@@
-20,12
+20,6
@@
*/
package jalview.gui;
*/
package jalview.gui;
-import jalview.io.JalviewFileChooser;
-import jalview.io.JalviewFileView;
-import jalview.jbgui.GCutAndPasteHtmlTransfer;
-import jalview.util.MessageManager;
-import jalview.viewmodel.AlignmentViewport;
-
import java.awt.Toolkit;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.StringSelection;
import java.awt.Toolkit;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.StringSelection;
@@
-43,6
+37,13
@@
import javax.swing.event.HyperlinkEvent;
import javax.swing.event.HyperlinkEvent.EventType;
import javax.swing.event.HyperlinkListener;
import javax.swing.event.HyperlinkEvent.EventType;
import javax.swing.event.HyperlinkListener;
+import jalview.bin.Cache;
+import jalview.io.JalviewFileChooser;
+import jalview.io.JalviewFileView;
+import jalview.jbgui.GCutAndPasteHtmlTransfer;
+import jalview.util.MessageManager;
+import jalview.viewmodel.AlignmentViewport;
+
/**
* Cut'n'paste files into the desktop See JAL-1105
*
/**
* Cut'n'paste files into the desktop See JAL-1105
*
@@
-57,6
+58,7
@@
public class CutAndPasteHtmlTransfer extends GCutAndPasteHtmlTransfer
public CutAndPasteHtmlTransfer()
{
super();
public CutAndPasteHtmlTransfer()
{
super();
+ this.setFrameIcon(null);
displaySource.setSelected(false);
textarea.addKeyListener(new KeyListener()
{
displaySource.setSelected(false);
textarea.addKeyListener(new KeyListener()
{
@@
-100,6
+102,7
@@
public class CutAndPasteHtmlTransfer extends GCutAndPasteHtmlTransfer
});
SwingUtilities.invokeLater(new Runnable()
{
});
SwingUtilities.invokeLater(new Runnable()
{
+ @Override
public void run()
{
textarea.requestFocus();
public void run()
{
textarea.requestFocus();
@@
-140,18
+143,23
@@
public class CutAndPasteHtmlTransfer extends GCutAndPasteHtmlTransfer
*/
public void setText(String text)
{
*/
public void setText(String text)
{
+ textarea.setDocument(textarea.getEditorKit().createDefaultDocument());
textarea.setText(text);
textarea.setText(text);
+ textarea.setCaretPosition(0);
}
}
+ @Override
public void save_actionPerformed(ActionEvent e)
{
public void save_actionPerformed(ActionEvent e)
{
+ // TODO: JAL-3048 JalviewFileChooser - Save option
+
JalviewFileChooser chooser = new JalviewFileChooser(
JalviewFileChooser chooser = new JalviewFileChooser(
- jalview.bin.Cache.getProperty("LAST_DIRECTORY"));
+ Cache.getProperty("LAST_DIRECTORY"));
chooser.setAcceptAllFileFilterUsed(false);
chooser.setFileView(new JalviewFileView());
chooser.setAcceptAllFileFilterUsed(false);
chooser.setFileView(new JalviewFileView());
- chooser.setDialogTitle(MessageManager
- .getString("label.save_text_to_file"));
+ chooser.setDialogTitle(
+ MessageManager.getString("label.save_text_to_file"));
chooser.setToolTipText(MessageManager.getString("action.save"));
int value = chooser.showSaveDialog(this);
chooser.setToolTipText(MessageManager.getString("action.save"));
int value = chooser.showSaveDialog(this);
@@
-173,11
+181,12
@@
public class CutAndPasteHtmlTransfer extends GCutAndPasteHtmlTransfer
}
}
}
}
+ @Override
public void toggleHtml_actionPerformed(ActionEvent e)
{
String txt = textarea.getText();
public void toggleHtml_actionPerformed(ActionEvent e)
{
String txt = textarea.getText();
- textarea.setContentType(displaySource.isSelected() ? "text/text"
- : "text/html");
+ textarea.setContentType(
+ displaySource.isSelected() ? "text/text" : "text/html");
textarea.setText(txt);
}
textarea.setText(txt);
}
@@
-187,6
+196,7
@@
public class CutAndPasteHtmlTransfer extends GCutAndPasteHtmlTransfer
* @param e
* DOCUMENT ME!
*/
* @param e
* DOCUMENT ME!
*/
+ @Override
public void copyItem_actionPerformed(ActionEvent e)
{
Clipboard c = Toolkit.getDefaultToolkit().getSystemClipboard();
public void copyItem_actionPerformed(ActionEvent e)
{
Clipboard c = Toolkit.getDefaultToolkit().getSystemClipboard();
@@
-210,6
+220,7
@@
public class CutAndPasteHtmlTransfer extends GCutAndPasteHtmlTransfer
* @param e
* DOCUMENT ME!
*/
* @param e
* DOCUMENT ME!
*/
+ @Override
public void cancel_actionPerformed(ActionEvent e)
{
try
public void cancel_actionPerformed(ActionEvent e)
{
try
@@
-220,8
+231,10
@@
public class CutAndPasteHtmlTransfer extends GCutAndPasteHtmlTransfer
}
}
}
}
+ @Override
public void textarea_mousePressed(MouseEvent e)
{
public void textarea_mousePressed(MouseEvent e)
{
+ // isPopupTrigger is on mousePressed (Mac) or mouseReleased (Windows)
if (e.isPopupTrigger())
{
JPopupMenu popup = new JPopupMenu(
if (e.isPopupTrigger())
{
JPopupMenu popup = new JPopupMenu(
@@
-230,6
+243,7
@@
public class CutAndPasteHtmlTransfer extends GCutAndPasteHtmlTransfer
MessageManager.getString("action.copy"));
item.addActionListener(new ActionListener()
{
MessageManager.getString("action.copy"));
item.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
copyItem_actionPerformed(e);
public void actionPerformed(ActionEvent e)
{
copyItem_actionPerformed(e);