| 1 |
|
package org.xmlhammer.gui.output.actions; |
| 2 |
|
|
| 3 |
|
import java.net.URI; |
| 4 |
|
|
| 5 |
|
import javax.swing.ImageIcon; |
| 6 |
|
|
| 7 |
|
import org.bounce.RunnableAction; |
| 8 |
|
import org.xmlhammer.gui.util.ExternalApplicationLauncher; |
| 9 |
|
|
| 10 |
|
public class EditURIAction extends RunnableAction { |
| 11 |
|
private static final long serialVersionUID = -6546100768134624390L; |
| 12 |
|
|
| 13 |
0 |
private URI uri = null; |
| 14 |
0 |
private int line = 0; |
| 15 |
0 |
private int column = 0; |
| 16 |
|
|
| 17 |
|
public EditURIAction() { |
| 18 |
0 |
super("Edit Document"); |
| 19 |
|
|
| 20 |
0 |
putValue(SMALL_ICON, new ImageIcon(getClass().getResource("/org/xmlhammer/gui/icons/obj16/write_obj.gif"))); |
| 21 |
0 |
putValue(SHORT_DESCRIPTION, "Edit Document"); |
| 22 |
0 |
} |
| 23 |
|
|
| 24 |
|
public void setLocation(URI uri, int line, int column) { |
| 25 |
0 |
setEnabled(uri != null); |
| 26 |
|
|
| 27 |
0 |
this.uri = uri; |
| 28 |
|
|
| 29 |
0 |
this.line = line; |
| 30 |
0 |
this.column = column; |
| 31 |
0 |
} |
| 32 |
|
|
| 33 |
|
@Override |
| 34 |
|
public void run() { |
| 35 |
0 |
ExternalApplicationLauncher.getInstance().edit(uri, line, column); |
| 36 |
0 |
} |
| 37 |
|
} |