package net.sourceforge.phpdt.sql.actions; import org.eclipse.jface.action.Action; import org.eclipse.jface.action.IAction; import org.eclipse.jface.dialogs.InputDialog; import org.eclipse.jface.viewers.ISelection; import org.eclipse.ui.IViewActionDelegate; import org.eclipse.ui.IViewPart; import net.sourceforge.phpdt.sql.Messages; import net.sourceforge.phpdt.sql.bookmarks.Bookmark; import net.sourceforge.phpdt.sql.view.BookmarkView; public class SetSchemaAction extends Action implements IViewActionDelegate { BookmarkView view; public void init(IViewPart view) { this.view = (BookmarkView) view; } public void run(IAction action) { run(); } public void run() { Bookmark bookmark = view.getCurrentBookmark(); InputDialog dialog = new InputDialog(view.getSite().getShell(), Messages.getString("SetSchemaAction.SetSchema"), Messages.getString("SetSchemaAction.PleaseEnterName"), //$NON-NLS-1$ //$NON-NLS-2$ bookmark.getSchema(), null); dialog.open(); String value = dialog.getValue(); if (value != null) { bookmark.setSchema(value); } } public void selectionChanged(IAction action, ISelection selection) { } }