KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > update > internal > ui > AddBookmarksAction


1 /*******************************************************************************
2  * Copyright (c) 2000, 2004 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Common Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/cpl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.update.internal.ui;
12
13 import org.eclipse.jface.action.*;
14 import org.eclipse.update.internal.ui.wizards.*;
15 import org.eclipse.update.internal.ui.UpdateUI;
16
17 /**
18  * Adds bookmarks to update sites
19  */

20 public class AddBookmarksAction extends Action {
21
22     public AddBookmarksAction() {
23         setText(UpdateUI.getString("AddBookmarksAction.add")); //$NON-NLS-1$
24
}
25
26     public void run() {
27         NewWebSiteDialog dialog = new NewWebSiteDialog(UpdateUI.getActiveWorkbenchShell());
28         dialog.create();
29         dialog.getShell().setText(UpdateUI.getString("AddBookmarksAction.new")); //$NON-NLS-1$
30
if (dialog.open() == NewWebSiteDialog.OK) {
31             UpdateUI.getDefault().getUpdateModel().saveBookmarks();
32         }
33     }
34 }
35
Popular Tags