home *** CD-ROM | disk | FTP | other *** search
- import java.awt.Window;
- import mug.app.Command;
- import mug.ui.Callback;
- import mug.ui.QuestionDialog;
-
- public class BookmarkCommand extends Command implements Callback {
- private MainShell _app;
- private String _link;
-
- public BookmarkCommand(MainShell var1, String var2) {
- this._app = var1;
- this._link = var2;
- }
-
- public void execute() {
- if (this._link != null) {
- if (!this._link.endsWith(".gif") && !this._link.endsWith(".jpg") && !this._link.endsWith(".jpeg") && !this._link.endsWith(".GIF") && !this._link.endsWith(".JPG") && !this._link.endsWith(".JPEG")) {
- this._app.setLink(this._link);
- ((Command)this).executeNext();
- } else {
- String var1 = "The bookmark you selected\n \n" + this._link + "\n \nis probably an image.";
- String[] var2 = new String[]{"Load as Image", "Use as Link", "Cancel"};
- QuestionDialog var3 = new QuestionDialog(this._app, "Image _link", false, var1, var2, this);
- ((Window)var3).show();
- }
- }
- }
-
- public void execute(Object var1, Object var2) {
- if (((String)var2).equals("Load as Image")) {
- (new LoadImageURLCommand(this._app)).execute(this, this._link);
- ((Command)this).executeNext();
- } else {
- if (((String)var2).equals("Use as Link")) {
- this._app.setLink(this._link);
- ((Command)this).executeNext();
- }
-
- }
- }
- }
-