import com.quantum.actions.ViewTableAction;
import com.quantum.actions.ViewTableDetailsAction;
import com.quantum.model.Bookmark;
+import com.quantum.model.Entity;
import com.quantum.util.versioning.VersioningHelper;
import org.eclipse.jface.action.Action;
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.actions.ActionGroup;
import org.eclipse.ui.actions.ExportResourcesAction;
+import org.eclipse.ui.actions.ImportResourcesAction;
import org.eclipse.ui.actions.SelectionListenerAction;
import org.eclipse.ui.actions.SelectionProviderAction;
import org.eclipse.ui.dialogs.PropertyDialogAction;
private SelectionListenerAction renameAction;
private ExportResourcesAction exportAction;
+ private ImportResourcesAction importAction;
private SelectionProviderAction propertiesAction;
this.exportAction = VersioningHelper.createExportResourcesAction(
this.viewPart.getViewSite().getWorkbenchWindow());
this.exportAction.setImageDescriptor(ImageStore.getImageDescriptor(ImageStore.EXPORT));
+ this.importAction = VersioningHelper.createImportResourcesAction(
+ this.viewPart.getViewSite().getWorkbenchWindow());
+ this.importAction.setImageDescriptor(ImageStore.getImageDescriptor(ImageStore.IMPORT));
this.dropAction = new DropEntityAction(this.viewPart);
this.exportAction.selectionChanged(getStructuredSelection());
menu.add(this.exportAction);
}
-
- if (getStructuredSelection().size() == 1 &&
- isEverySelectionInstanceof(BookmarkNode.class)) {
+ if (this.importAction != null) {
+ this.importAction.selectionChanged(getStructuredSelection());
+ menu.add(this.importAction);
}
+
if (isEverySelectionInstanceof(QueryNode.class)) {
if (getStructuredSelection().size() == 1) {
addToMenu(menu, this.openQueryAction);
return result;
}
+ private boolean isEverySelectedGroupOfType(String type) {
+ boolean result = true;
+ IStructuredSelection selection = getStructuredSelection();
+ for (Iterator i = selection.iterator(); result && i.hasNext(); ) {
+ Object object = i.next();
+ result &= (( object instanceof GroupNode ) &&
+ ((GroupNode)object).getType().equals(type));
+ }
+
+ return result;
+ }
+ private boolean isEverySelectedEntityTable() {
+ boolean result = true;
+ IStructuredSelection selection = getStructuredSelection();
+ for (Iterator i = selection.iterator(); result && i.hasNext(); ) {
+ Object object = i.next();
+ result &= (( object instanceof EntityNode ) &&
+ ((EntityNode)object).isTable());
+ }
+
+ return result;
+ }
+ private boolean isEverySelectedEntityView() {
+ boolean result = true;
+ IStructuredSelection selection = getStructuredSelection();
+ for (Iterator i = selection.iterator(); result && i.hasNext(); ) {
+ Object object = i.next();
+ result &= (( object instanceof EntityNode ) &&
+ ((EntityNode)object).isView());
+ }
+ return result;
+ }
public IAction getOpenAction() {
if (isEverySelectionInstanceof(BookmarkNode.class)) {