From 2b05e30398f959456851609581670464b1de40ff Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Sat, 18 Oct 2014 07:10:43 +0100 Subject: [PATCH] Remove ref to protocol/experiment in right-hand panel. --- .../agents/dataBrowser/view/DataBrowser.java | 10 -- .../view/DataBrowserComponent.java | 10 -- .../agents/events/editor/CopyEvent.java | 68 --------- .../agents/events/editor/EditFileEvent.java | 111 --------------- .../agents/events/editor/ShowEditorEvent.java | 131 ------------------ .../metadata/editor/AnnotationDataUI.java | 6 - .../agents/metadata/editor/DocComponent.java | 38 +---- .../agents/metadata/editor/EditorControl.java | 27 ---- .../agents/metadata/editor/EditorUI.java | 29 ---- .../agents/metadata/editor/PropertiesUI.java | 12 -- .../treeviewer/browser/BrowserModel.java | 14 -- .../agents/treeviewer/browser/BrowserUI.java | 2 - .../agents/treeviewer/view/TreeViewer.java | 18 --- .../treeviewer/view/TreeViewerComponent.java | 75 ---------- .../treeviewer/view/TreeViewerControl.java | 2 - .../util/ui/omeeditpane/OMEWikiComponent.java | 9 +- .../util/ui/omeeditpane/WikiDataObject.java | 4 - 17 files changed, 6 insertions(+), 560 deletions(-) delete mode 100644 components/insight/SRC/org/openmicroscopy/shoola/agents/events/editor/CopyEvent.java delete mode 100644 components/insight/SRC/org/openmicroscopy/shoola/agents/events/editor/EditFileEvent.java delete mode 100644 components/insight/SRC/org/openmicroscopy/shoola/agents/events/editor/ShowEditorEvent.java diff --git a/components/insight/SRC/org/openmicroscopy/shoola/agents/dataBrowser/view/DataBrowser.java b/components/insight/SRC/org/openmicroscopy/shoola/agents/dataBrowser/view/DataBrowser.java index e92d52a5881..ab10e3a037b 100644 --- a/components/insight/SRC/org/openmicroscopy/shoola/agents/dataBrowser/view/DataBrowser.java +++ b/components/insight/SRC/org/openmicroscopy/shoola/agents/dataBrowser/view/DataBrowser.java @@ -136,13 +136,6 @@ public interface DataBrowser /** Bound property indicating to reset the password of the selected user.*/ public static final String RESET_PASSWORD_PROPERTY = "resetUserPassword"; - - /** - * Bound property indicating to launch the editor to create a new - * experiment. - */ - public static final String CREATE_NEW_EXPERIMENT_PROPERTY = - "createNewExperiment"; /** Bound property indicating to tag selected objects. */ public static final String TAG_WIZARD_PROPERTY = "tagWizard"; @@ -699,9 +692,6 @@ public void setReportData(Map data, */ public void showTagWizard(); - /** Posts an event to launch the editor to create a new experiment. */ - public void createNewExperiment(); - /** * Sets the selected cell. This method can only be invoked if * the model is WellsModel. diff --git a/components/insight/SRC/org/openmicroscopy/shoola/agents/dataBrowser/view/DataBrowserComponent.java b/components/insight/SRC/org/openmicroscopy/shoola/agents/dataBrowser/view/DataBrowserComponent.java index fb88e615a2f..e79dd676663 100644 --- a/components/insight/SRC/org/openmicroscopy/shoola/agents/dataBrowser/view/DataBrowserComponent.java +++ b/components/insight/SRC/org/openmicroscopy/shoola/agents/dataBrowser/view/DataBrowserComponent.java @@ -1500,16 +1500,6 @@ public void showTagWizard() firePropertyChange(TAG_WIZARD_PROPERTY, Boolean.FALSE, Boolean.TRUE); } - /** - * Implemented as specified by the {@link DataBrowser} interface. - * @see DataBrowser#createNewExperiment() - */ - public void createNewExperiment() - { - firePropertyChange(CREATE_NEW_EXPERIMENT_PROPERTY, Boolean.FALSE, - Boolean.TRUE); - } - /** * Implemented as specified by the {@link DataBrowser} interface. * @see DataBrowser#loadExistingDatasets() diff --git a/components/insight/SRC/org/openmicroscopy/shoola/agents/events/editor/CopyEvent.java b/components/insight/SRC/org/openmicroscopy/shoola/agents/events/editor/CopyEvent.java deleted file mode 100644 index 9aa25a3d467..00000000000 --- a/components/insight/SRC/org/openmicroscopy/shoola/agents/events/editor/CopyEvent.java +++ /dev/null @@ -1,68 +0,0 @@ - /* - * org.openmicroscopy.shoola.agents.events.editor.CopyEvent - * - *------------------------------------------------------------------------------ - * Copyright (C) 2006-2008 University of Dundee. All rights reserved. - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - *------------------------------------------------------------------------------ - */ -package org.openmicroscopy.shoola.agents.events.editor; - -//Java imports - -//Third-party libraries - -//Application-internal dependencies - -import org.openmicroscopy.shoola.env.event.RequestEvent; - -/** - * Event to copy parts of an Editor file/protocol. Eg A list of fields/steps - * or a portion of a field (text + parameters) etc. - * - * @author William Moore      - * will@lifesci.dundee.ac.uk - * @version 3.0 - * - * (Internal version: $Revision: $Date: $) - * - * @since OME3.0 - */ -public class CopyEvent - extends RequestEvent -{ - - /** This could be text with parameters, a list of fields etc. */ - private Object copiedData; - - /** - * Creates an instance, saving the passed object. - * - * @param copiedObject The object that was copied. - */ - public CopyEvent(Object copiedObject) - { - copiedData = copiedObject; - } - - /** - * Returns the object that was copied to this event. - * - * @return see above - */ - public Object getCopiedData() { return copiedData; } -} diff --git a/components/insight/SRC/org/openmicroscopy/shoola/agents/events/editor/EditFileEvent.java b/components/insight/SRC/org/openmicroscopy/shoola/agents/events/editor/EditFileEvent.java deleted file mode 100644 index ac67a86d14d..00000000000 --- a/components/insight/SRC/org/openmicroscopy/shoola/agents/events/editor/EditFileEvent.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * org.openmicroscopy.shoola.agents.events.editor.EditFileEvent - * - *------------------------------------------------------------------------------ - * Copyright (C) 2006-2008 University of Dundee. All rights reserved. - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - *------------------------------------------------------------------------------ - */ -package org.openmicroscopy.shoola.agents.events.editor; - - -//Java imports - -//Third-party libraries - -//Application-internal dependencies -import org.openmicroscopy.shoola.env.data.util.SecurityContext; -import org.openmicroscopy.shoola.env.event.RequestEvent; -import pojos.FileAnnotationData; - -/** - * Request to edit the specified file. - * - * @author Jean-Marie Burel      - * j.burel@dundee.ac.uk - * @author Donald MacDonald      - * donald@lifesci.dundee.ac.uk - * @version 3.0 - * - * (Internal version: $Revision: $Date: $) - * - * @since 3.0-Beta3 - */ -public class EditFileEvent - extends RequestEvent -{ - - - /** The annotation to edit. */ - private FileAnnotationData fileAnnotation; - - /** The id of the annotation to edit. */ - private long fileAnnotationID; - - /** The security context.*/ - private SecurityContext ctx; - - /** - * Creates a new instance. - * - * @param ctx The security context. - * @param fileAnnotation The annotation hosting the information about - * the file to edit. - */ - public EditFileEvent(SecurityContext ctx, - FileAnnotationData fileAnnotation) - { - if (fileAnnotation == null) - throw new IllegalArgumentException("No file annotation."); - this.ctx = ctx; - this.fileAnnotation = fileAnnotation; - } - - /** - * Creates a new instance. - * - * @param ctx The security context. - * @param fileAnnotationID The id of the annotation to edit. - */ - public EditFileEvent(SecurityContext ctx, long fileAnnotationID) - { - this.fileAnnotationID = fileAnnotationID; - this.ctx = ctx; - } - - /** - * Returns the annotation hosting the information about the file to edit. - * - * @return See above. - */ - public FileAnnotationData getFileAnnotation() { return fileAnnotation; } - - /** - * Returns the id of the file annotation to edit. - * - * @return See above. - */ - public long getFileAnnotationID() { return fileAnnotationID; } - - /** - * Returns the security context. - * - * @return See above. - */ - public SecurityContext getSecurityContext() { return ctx; } - -} diff --git a/components/insight/SRC/org/openmicroscopy/shoola/agents/events/editor/ShowEditorEvent.java b/components/insight/SRC/org/openmicroscopy/shoola/agents/events/editor/ShowEditorEvent.java deleted file mode 100644 index f9b5d77c978..00000000000 --- a/components/insight/SRC/org/openmicroscopy/shoola/agents/events/editor/ShowEditorEvent.java +++ /dev/null @@ -1,131 +0,0 @@ - /* - * org.openmicroscopy.shoola.agents.events.editor.ShowEditorEvent - * - *------------------------------------------------------------------------------ - * Copyright (C) 2006-2008 University of Dundee. All rights reserved. - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - *------------------------------------------------------------------------------ - */ -package org.openmicroscopy.shoola.agents.events.editor; - - -//Java imports - -//Third-party libraries - -//Application-internal dependencies -import org.openmicroscopy.shoola.env.data.util.SecurityContext; -import org.openmicroscopy.shoola.env.event.RequestEvent; -import pojos.DataObject; - -/** - * Requests that OMERO.editor agent becomes active. - * If any instances of it are already open, they will become activated, - * otherwise, a blank editor window will open. - * - * @author William Moore      - * will@lifesci.dundee.ac.uk - * @version 3.0 - * - * (Internal version: $Revision: $Date: $) - * - * @since OME3.0 - */ -public class ShowEditorEvent - extends RequestEvent -{ - - /** Possible extension of the experiment. */ - public static final String EXPERIMENT_EXTENSION = "_exp"; - - /** Indicates to open an experiment file. */ - public static final int EXPERIMENT = 0; - - /** Indicates to open a protocol file. */ - public static final int PROTOCOL = 1; - - /** The data object the new file has to be linked to. */ - private DataObject parent; - - /** The name of the file. */ - private String name; - - /** The type of editor file to create. */ - private int type; - - /** The security context.*/ - private SecurityContext ctx; - - /** - * Creates a new instance. - * - * @param ctx The security context. - */ - public ShowEditorEvent(SecurityContext ctx) - { - type = PROTOCOL; - parent = null; - this.ctx = ctx; - } - - /** - * Creates a new instance. - * - * @param ctx The security context. - * @param parent The data object the new experiment should be linked to. - * @param name The name to give to the experiment. - * @param type One of the constants defined by this class. - */ - public ShowEditorEvent(SecurityContext ctx, DataObject parent, String name, - int type) - { - this.parent = parent; - this.name = name; - if (type == PROTOCOL || type == EXPERIMENT) this.type = type; - else this.type = PROTOCOL; - this.ctx = ctx; - } - - /** - * Returns the data object the new experiment should be linked to. - * - * @return See above. - */ - public DataObject getParent() { return parent; } - - /** - * Returns the name to give to the experiment. - * - * @return See above. - */ - public String getName() { return name; } - - /** - * Returns the type. - * - * @return See above. - */ - public int getType() { return type; } - - /** - * Returns the security context. - * - * @return See above. - */ - public SecurityContext getSecurityContext() { return ctx; } -} - diff --git a/components/insight/SRC/org/openmicroscopy/shoola/agents/metadata/editor/AnnotationDataUI.java b/components/insight/SRC/org/openmicroscopy/shoola/agents/metadata/editor/AnnotationDataUI.java index 66e744abe01..7b2abce7b44 100644 --- a/components/insight/SRC/org/openmicroscopy/shoola/agents/metadata/editor/AnnotationDataUI.java +++ b/components/insight/SRC/org/openmicroscopy/shoola/agents/metadata/editor/AnnotationDataUI.java @@ -316,12 +316,6 @@ private JPopupMenu createDocSelectionMenu() item.addActionListener(controller); item.setActionCommand(""+EditorControl.ADD_UPLOADED_DOCS); docSelectionMenu.add(item); - item = new JMenuItem("New Experiment..."); - item.setEnabled(controller.isSingleMode()); - item.setToolTipText("Create a new experiment."); - item.addActionListener(controller); - item.setActionCommand(""+EditorControl.CREATE_NEW_EXPERIMENT); - docSelectionMenu.add(item); return docSelectionMenu; } diff --git a/components/insight/SRC/org/openmicroscopy/shoola/agents/metadata/editor/DocComponent.java b/components/insight/SRC/org/openmicroscopy/shoola/agents/metadata/editor/DocComponent.java index 732f582496e..43e8bcc3748 100644 --- a/components/insight/SRC/org/openmicroscopy/shoola/agents/metadata/editor/DocComponent.java +++ b/components/insight/SRC/org/openmicroscopy/shoola/agents/metadata/editor/DocComponent.java @@ -57,7 +57,6 @@ //Application-internal dependencies import omero.model.OriginalFile; -import org.openmicroscopy.shoola.agents.events.editor.EditFileEvent; import org.openmicroscopy.shoola.agents.metadata.IconManager; import org.openmicroscopy.shoola.agents.metadata.MetadataViewerAgent; import org.openmicroscopy.shoola.agents.util.DataObjectListCellRenderer; @@ -266,16 +265,7 @@ private boolean setControlsEnabled(boolean enabled) } return count > 0; } - - /** Opens the file. */ - private void openFile() - { - if (!(data instanceof FileAnnotationData)) return; - EventBus bus = MetadataViewerAgent.getRegistry().getEventBus(); - bus.post(new EditFileEvent(model.getSecurityContext(), - (FileAnnotationData) data)); - } - + /** * Brings up the menu. * @@ -515,21 +505,7 @@ private String formatToolTip(AnnotationData annotation, String name) buf.append(""); return buf.toString(); } - - /** - * Posts an event on the eventBus, with the attachment file's ID, name etc. - */ - private void postFileClicked() - { - if (data == null) return; - if (data instanceof FileAnnotationData) { - FileAnnotationData f = (FileAnnotationData) data; - Registry reg = MetadataViewerAgent.getRegistry(); - reg.getEventBus().post(new EditFileEvent(model.getSecurityContext(), - f)); - } - } - + /** Initializes the various buttons. */ private void initButtons() { @@ -714,9 +690,9 @@ private void initComponents() */ public void mouseReleased(MouseEvent e) { - if (e.getClickCount() == 1) { - if (e.isPopupTrigger()) showMenu(label, e.getPoint()); - } else if (e.getClickCount() == 2) postFileClicked(); + if (e.getClickCount() == 1 && e.isPopupTrigger()) { + showMenu(label, e.getPoint()); + } } /** @@ -925,10 +901,6 @@ public void actionPerformed(ActionEvent e) break; case DOWNLOAD: download(); - break; - case OPEN: - openFile(); - break; } } diff --git a/components/insight/SRC/org/openmicroscopy/shoola/agents/metadata/editor/EditorControl.java b/components/insight/SRC/org/openmicroscopy/shoola/agents/metadata/editor/EditorControl.java index 1a15dd17171..d910e320f43 100644 --- a/components/insight/SRC/org/openmicroscopy/shoola/agents/metadata/editor/EditorControl.java +++ b/components/insight/SRC/org/openmicroscopy/shoola/agents/metadata/editor/EditorControl.java @@ -45,10 +45,8 @@ import java.util.Map.Entry; import javax.swing.JButton; -import javax.swing.JComponent; import javax.swing.JFrame; import javax.swing.JTabbedPane; -import javax.swing.SwingUtilities; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import javax.swing.filechooser.FileFilter; @@ -59,7 +57,6 @@ import org.apache.commons.lang.StringUtils; //Application-internal dependencies -import org.openmicroscopy.shoola.agents.events.editor.EditFileEvent; import org.openmicroscopy.shoola.agents.events.iviewer.ViewImage; import org.openmicroscopy.shoola.agents.events.iviewer.ViewImageObject; import org.openmicroscopy.shoola.agents.imviewer.view.ImViewer; @@ -158,9 +155,6 @@ class EditorControl /** Action ID to display the acquisition metadata. */ static final int ACQUISITION_METADATA = 5; - /** Action ID indicating to create a new experiment. */ - static final int CREATE_NEW_EXPERIMENT = 6; - /** Action ID to create a movie. */ static final int CREATE_MOVIE = 7; @@ -360,17 +354,6 @@ private void viewImage(String imageName) //bus.post(new ViewImage(imageID, null)); } - /** - * Posts an event to view the protocol. - * - * @param protocolID The id of the protocol to view. - */ - private void viewProtocol(long protocolID) - { - EventBus bus = MetadataViewerAgent.getRegistry().getEventBus(); - bus.post(new EditFileEvent(model.getSecurityContext(), protocolID)); - } - /** Brings up the folder chooser. */ private void download() { @@ -718,10 +701,6 @@ else if (object instanceof TextualAnnotationComponent) { id = object.getId(); if (id < 0) viewImage(object.getName()); else viewImage(id); - break; - case WikiDataObject.PROTOCOL: - viewProtocol(object.getId()); - break; } } else if (SelectionWizard.SELECTED_ITEMS_PROPERTY.equals(name)) { Map m = (Map) evt.getNewValue(); @@ -736,9 +715,6 @@ else if (object instanceof TextualAnnotationComponent) { view.handleObjectsSelection(type, (Collection) entry.getValue()); } - } else if (PreviewPanel.OPEN_FILE_PROPERTY.equals(name)) { - Long id = (Long) evt.getNewValue(); - if (id != null) viewProtocol(id.longValue()); } else if (MetadataViewer.SETTINGS_APPLIED_PROPERTY.equals(name)) { model.loadRenderingControl(RenderingControlLoader.RELOAD); view.onSettingsApplied(true); @@ -856,9 +832,6 @@ public void actionPerformed(ActionEvent e) case ADD_TAGS: loadExistingTags(); break; - case CREATE_NEW_EXPERIMENT: - view.createNewExperiment(); - break; case CREATE_MOVIE: view.makeMovie(-1, null); break; diff --git a/components/insight/SRC/org/openmicroscopy/shoola/agents/metadata/editor/EditorUI.java b/components/insight/SRC/org/openmicroscopy/shoola/agents/metadata/editor/EditorUI.java index 5bc2136f2d4..375ba28c8de 100644 --- a/components/insight/SRC/org/openmicroscopy/shoola/agents/metadata/editor/EditorUI.java +++ b/components/insight/SRC/org/openmicroscopy/shoola/agents/metadata/editor/EditorUI.java @@ -51,8 +51,6 @@ import org.jdesktop.swingx.JXTaskPane; //Application-internal dependencies -import org.openmicroscopy.shoola.agents.events.editor.ShowEditorEvent; -import org.openmicroscopy.shoola.agents.metadata.MetadataViewerAgent; import org.openmicroscopy.shoola.agents.metadata.util.AnalysisResultsItem; import org.openmicroscopy.shoola.agents.metadata.util.DataToSave; import org.openmicroscopy.shoola.agents.metadata.view.MetadataViewer; @@ -60,13 +58,11 @@ import org.openmicroscopy.shoola.env.data.model.AdminObject; import org.openmicroscopy.shoola.env.data.model.DiskQuota; import org.openmicroscopy.shoola.env.data.model.ScriptObject; -import org.openmicroscopy.shoola.env.event.EventBus; import org.openmicroscopy.shoola.util.ui.MessageBox; import org.openmicroscopy.shoola.util.ui.UIUtilities; import pojos.AnnotationData; import pojos.BooleanAnnotationData; import pojos.DataObject; -import pojos.DatasetData; import pojos.DoubleAnnotationData; import pojos.ExperimenterData; import pojos.FileAnnotationData; @@ -74,9 +70,6 @@ import pojos.GroupData; import pojos.ImageData; import pojos.LongAnnotationData; -import pojos.PlateData; -import pojos.ProjectData; -import pojos.ScreenData; import pojos.TagAnnotationData; import pojos.TermAnnotationData; import pojos.TextualAnnotationData; @@ -814,28 +807,6 @@ void setPlaneInfo(int index) * @return See above. */ boolean isSingleMode() { return model.isSingleMode(); } - - /** Posts an event to create a new experiment. */ - void createNewExperiment() - { - EventBus bus = MetadataViewerAgent.getRegistry().getEventBus(); - String name = model.getObjectPath(); - Object object = model.getRefObject(); - if ((object instanceof ProjectData) || - (object instanceof DatasetData) || - (object instanceof ImageData) || - (object instanceof ScreenData) || - (object instanceof PlateData)) { - if (name != null && name.trim().length() > 0) { - name += ShowEditorEvent.EXPERIMENT_EXTENSION; - ShowEditorEvent event = new ShowEditorEvent( - model.getSecurityContext(), - (DataObject) object, name, - ShowEditorEvent.EXPERIMENT); - bus.post(event); - } - } - } /** * Brings up the dialog to create a movie. diff --git a/components/insight/SRC/org/openmicroscopy/shoola/agents/metadata/editor/PropertiesUI.java b/components/insight/SRC/org/openmicroscopy/shoola/agents/metadata/editor/PropertiesUI.java index a613ee384e7..5815594c2e9 100644 --- a/components/insight/SRC/org/openmicroscopy/shoola/agents/metadata/editor/PropertiesUI.java +++ b/components/insight/SRC/org/openmicroscopy/shoola/agents/metadata/editor/PropertiesUI.java @@ -72,7 +72,6 @@ import org.apache.commons.lang.StringUtils; import org.jdesktop.swingx.JXTaskPane; -import org.openmicroscopy.shoola.agents.events.editor.EditFileEvent; import org.openmicroscopy.shoola.agents.events.iviewer.ViewImage; import org.openmicroscopy.shoola.agents.events.iviewer.ViewImageObject; import org.openmicroscopy.shoola.agents.events.treeviewer.DataObjectSelectionEvent; @@ -82,8 +81,6 @@ import org.openmicroscopy.shoola.agents.metadata.actions.ViewAction; import org.openmicroscopy.shoola.agents.metadata.util.FilesetInfoDialog; import org.openmicroscopy.shoola.agents.util.EditorUtil; -import org.openmicroscopy.shoola.agents.util.editorpreview.PreviewPanel; -import org.openmicroscopy.shoola.env.config.IconFactory; import org.openmicroscopy.shoola.env.data.util.SecurityContext; import org.openmicroscopy.shoola.env.event.EventBus; import org.openmicroscopy.shoola.util.file.modulo.ModuloInfo; @@ -97,7 +94,6 @@ import pojos.ChannelData; import pojos.DatasetData; import pojos.ExperimenterData; -import pojos.FileAnnotationData; import pojos.FileData; import pojos.ImageData; import pojos.MultiImageData; @@ -1595,10 +1591,6 @@ public void propertyChange(PropertyChangeEvent evt) event.setPlugin(MetadataViewerAgent.runAsPlugin()); bus.post(event); } - break; - case WikiDataObject.PROTOCOL: - bus.post(new EditFileEvent(model.getSecurityContext(), id)); - break; } } else if (OMEWikiComponent.WIKI_DATA_OBJECT_ONE_CLICK_PROPERTY.equals( name)) { @@ -1616,10 +1608,6 @@ public void propertyChange(PropertyChangeEvent evt) case WikiDataObject.PROJECT: bus.post(new DataObjectSelectionEvent( ProjectData.class, id)); - break; - case WikiDataObject.PROTOCOL: - bus.post(new DataObjectSelectionEvent( - FileData.class, id)); } } else if (ChannelEditUI.CANCEL_PROPERTY.equals(name)) { cancelChannelsEdit(); diff --git a/components/insight/SRC/org/openmicroscopy/shoola/agents/treeviewer/browser/BrowserModel.java b/components/insight/SRC/org/openmicroscopy/shoola/agents/treeviewer/browser/BrowserModel.java index 0e39496fae0..2d6e68cf9c4 100644 --- a/components/insight/SRC/org/openmicroscopy/shoola/agents/treeviewer/browser/BrowserModel.java +++ b/components/insight/SRC/org/openmicroscopy/shoola/agents/treeviewer/browser/BrowserModel.java @@ -39,7 +39,6 @@ //Third-party libraries //Application-internal dependencies -import org.openmicroscopy.shoola.agents.events.editor.EditFileEvent; import org.openmicroscopy.shoola.agents.treeviewer.AdminLoader; import org.openmicroscopy.shoola.agents.treeviewer.ContainerCounterLoader; import org.openmicroscopy.shoola.agents.treeviewer.DataBrowserLoader; @@ -713,19 +712,6 @@ else if (object instanceof PlateData) { } else if (object instanceof PlateAcquisitionData) parent.browse(node, null, true); } - - /** - * Opens the file hosted by the passed node. - * - * @param node The node to handle. - */ - void openFile(TreeImageDisplay node) - { - if (node == null) return; - FileAnnotationData data = (FileAnnotationData) node.getUserObject(); - EditFileEvent evt = new EditFileEvent(getSecurityContext(node), data); - TreeViewerAgent.getRegistry().getEventBus().post(evt); - } /** * Sets the collection of images already imported. diff --git a/components/insight/SRC/org/openmicroscopy/shoola/agents/treeviewer/browser/BrowserUI.java b/components/insight/SRC/org/openmicroscopy/shoola/agents/treeviewer/browser/BrowserUI.java index eaf44beae84..1a4f280c6cc 100644 --- a/components/insight/SRC/org/openmicroscopy/shoola/agents/treeviewer/browser/BrowserUI.java +++ b/components/insight/SRC/org/openmicroscopy/shoola/agents/treeviewer/browser/BrowserUI.java @@ -406,8 +406,6 @@ private void onClick(MouseEvent me, boolean released) Object o = d.getUserObject(); if (o instanceof ImageData) { model.browse(d); - } else if (o instanceof FileAnnotationData) { - model.openFile(d); } else if (o instanceof PlateData) { if (!d.hasChildrenDisplay() || d.getChildrenDisplay().size() == 1) diff --git a/components/insight/SRC/org/openmicroscopy/shoola/agents/treeviewer/view/TreeViewer.java b/components/insight/SRC/org/openmicroscopy/shoola/agents/treeviewer/view/TreeViewer.java index fbaebbeb5cc..6fb081070bb 100644 --- a/components/insight/SRC/org/openmicroscopy/shoola/agents/treeviewer/view/TreeViewer.java +++ b/components/insight/SRC/org/openmicroscopy/shoola/agents/treeviewer/view/TreeViewer.java @@ -47,7 +47,6 @@ import org.openmicroscopy.shoola.env.data.model.AdminObject; import org.openmicroscopy.shoola.env.data.model.ApplicationData; import org.openmicroscopy.shoola.env.data.model.ImageCheckerResult; -import org.openmicroscopy.shoola.env.data.model.MIFResultObject; import org.openmicroscopy.shoola.env.data.model.ScriptObject; import org.openmicroscopy.shoola.env.data.model.TimeRefObject; import org.openmicroscopy.shoola.env.data.util.SecurityContext; @@ -112,15 +111,6 @@ public interface TreeViewer /** Indicates to run the application as an Knime plugin.*/ public static final int KNIME = LookupNames.KNIME; - /** Indicates to open the editor without selection. */ - public static final int NO_SELECTION = 0; - - /** Indicates to open the editor with a selected file. */ - public static final int WITH_SELECTION = 1; - - /** Indicates to launch a new editor with a data object to link to. */ - public static final int NEW_WITH_SELECTION = 2; - /** * Indicates that the {@link TreeViewer} displayed the various explorers. */ @@ -871,14 +861,6 @@ public void browse(TreeImageDisplay node, DataObject data, */ public void onNodesMoved(); - /** - * Opens the editor without file if no file selected. - * or opens the currently selected file. - * - * @param index One of the constants for the editor. - */ - public void openEditorFile(int index); - /** Displays the tag wizard. */ public void showTagWizard(); diff --git a/components/insight/SRC/org/openmicroscopy/shoola/agents/treeviewer/view/TreeViewerComponent.java b/components/insight/SRC/org/openmicroscopy/shoola/agents/treeviewer/view/TreeViewerComponent.java index e8386e0a051..48b2c927007 100644 --- a/components/insight/SRC/org/openmicroscopy/shoola/agents/treeviewer/view/TreeViewerComponent.java +++ b/components/insight/SRC/org/openmicroscopy/shoola/agents/treeviewer/view/TreeViewerComponent.java @@ -52,8 +52,6 @@ import org.openmicroscopy.shoola.agents.dataBrowser.view.DataBrowser; import org.openmicroscopy.shoola.agents.dataBrowser.view.DataBrowserFactory; import org.openmicroscopy.shoola.agents.events.SaveData; -import org.openmicroscopy.shoola.agents.events.editor.EditFileEvent; -import org.openmicroscopy.shoola.agents.events.editor.ShowEditorEvent; import org.openmicroscopy.shoola.agents.events.iviewer.CopyRndSettings; import org.openmicroscopy.shoola.agents.events.iviewer.RndSettingsCopied; import org.openmicroscopy.shoola.agents.events.treeviewer.ActivitiesEvent; @@ -3584,79 +3582,6 @@ public void onNodesDeleted(Collection deleted) onNodesMoved(); } - /** - * Implemented as specified by the {@link TreeViewer} interface. - * @see TreeViewer#openEditorFile(int) - */ - public void openEditorFile(int index) - { - EventBus bus = TreeViewerAgent.getRegistry().getEventBus(); - Browser browser = model.getSelectedBrowser(); - TreeImageDisplay d; - Object object; - switch (index) { - case WITH_SELECTION: - if (browser == null) return; - d = browser.getLastSelectedDisplay(); - if (d == null) return; - object = d.getUserObject(); - if (object == null) return; - if (object instanceof FileAnnotationData) { - FileAnnotationData fa = - (FileAnnotationData) d.getUserObject(); - bus.post( new EditFileEvent( - browser.getSecurityContext(d), fa)); - } - break; - case NO_SELECTION: - ExperimenterData exp = model.getUserDetails(); - bus.post(new ShowEditorEvent( - new SecurityContext(exp.getDefaultGroup().getId()))); - break; - case NEW_WITH_SELECTION: - if (browser == null) return; - d = browser.getLastSelectedDisplay(); - if (d == null) return; - object = d.getUserObject(); - TreeImageDisplay parent = d.getParentDisplay(); - Object po = null; - if (parent != null) po = parent.getUserObject(); - if (object == null) return; - String name = null; - if (object instanceof ProjectData) - name = ((ProjectData) object).getName(); - else if (object instanceof DatasetData) { - if (po != null && po instanceof ProjectData) { - name = ((ProjectData) po).getName(); - name += "_"; - name += ((DatasetData) object).getName(); - } else { - name = ((DatasetData) object).getName(); - } - } else if (object instanceof ImageData) - name = ((ImageData) object).getName(); - else if (object instanceof ScreenData) - name = ((ScreenData) object).getName(); - else if (object instanceof PlateData) { - if (po != null && po instanceof ScreenData) { - name = ((ScreenData) po).getName(); - name += "_"; - name += ((PlateData) object).getName(); - } else { - name = ((PlateData) object).getName(); - } - } - if (name != null) { - name += ShowEditorEvent.EXPERIMENT_EXTENSION; - ShowEditorEvent event = new ShowEditorEvent( - browser.getSecurityContext(d), - (DataObject) object, name, - ShowEditorEvent.EXPERIMENT); - bus.post(event); - } - } - } - /** * Implemented as specified by the {@link TreeViewer} interface. * @see TreeViewer#showTagWizard() diff --git a/components/insight/SRC/org/openmicroscopy/shoola/agents/treeviewer/view/TreeViewerControl.java b/components/insight/SRC/org/openmicroscopy/shoola/agents/treeviewer/view/TreeViewerControl.java index 1df260a2aa3..bcee269f442 100644 --- a/components/insight/SRC/org/openmicroscopy/shoola/agents/treeviewer/view/TreeViewerControl.java +++ b/components/insight/SRC/org/openmicroscopy/shoola/agents/treeviewer/view/TreeViewerControl.java @@ -1291,8 +1291,6 @@ public void propertyChange(PropertyChangeEvent pce) view.createTitle(); } else if (DataBrowser.TAG_WIZARD_PROPERTY.equals(name)) { model.showTagWizard(); - } else if (DataBrowser.CREATE_NEW_EXPERIMENT_PROPERTY.equals(name)) { - model.openEditorFile(TreeViewer.NEW_WITH_SELECTION); } else if (DataBrowser.FIELD_SELECTED_PROPERTY.equals(name)) { model.setSelectedField(pce.getNewValue()); } else if (MetadataViewer.RENDER_THUMBNAIL_PROPERTY.equals(name)) { diff --git a/components/insight/SRC/org/openmicroscopy/shoola/util/ui/omeeditpane/OMEWikiComponent.java b/components/insight/SRC/org/openmicroscopy/shoola/util/ui/omeeditpane/OMEWikiComponent.java index aa8e9bdf4fa..6720c08c453 100644 --- a/components/insight/SRC/org/openmicroscopy/shoola/util/ui/omeeditpane/OMEWikiComponent.java +++ b/components/insight/SRC/org/openmicroscopy/shoola/util/ui/omeeditpane/OMEWikiComponent.java @@ -95,10 +95,7 @@ public class OMEWikiComponent /** Regular expression defining Project. */ public static final String PROJECTREGEX = OMEWikiConstants.PROJECTREGEX; - - /** Regular expression defining Protocol. */ - public static final String PROTOCOLREGEX = OMEWikiConstants.PROTOCOLREGEX; - + /** Regular expression defining Image. */ public static final String IMAGEREGEX = OMEWikiConstants.IMAGEREGEX; @@ -396,10 +393,6 @@ public void installObjectFormatters() new FormatSelectionAction( new ColourFormatter(Formatter.DEFAULT_LINK, false), new ElementSelectionAction(WikiDataObject.IMAGE))); - pane.addFormatter(PROTOCOLREGEX, - new FormatSelectionAction( - new ColourFormatter(Formatter.DEFAULT_LINK, false), - new ElementSelectionAction(WikiDataObject.PROTOCOL))); pane.addFormatter(DATASETREGEX, new FormatSelectionAction( new ColourFormatter(Formatter.DEFAULT_LINK, false), diff --git a/components/insight/SRC/org/openmicroscopy/shoola/util/ui/omeeditpane/WikiDataObject.java b/components/insight/SRC/org/openmicroscopy/shoola/util/ui/omeeditpane/WikiDataObject.java index f4b40d1f879..0b531721c54 100644 --- a/components/insight/SRC/org/openmicroscopy/shoola/util/ui/omeeditpane/WikiDataObject.java +++ b/components/insight/SRC/org/openmicroscopy/shoola/util/ui/omeeditpane/WikiDataObject.java @@ -56,9 +56,6 @@ public class WikiDataObject /** Identifies a Thumbnail. */ public static final int THUMBNAIL = 3; - /** Identifies a Protocol. */ - public static final int PROTOCOL = 4; - /** Identifies a URL. */ public static final int URL = 5; @@ -95,7 +92,6 @@ private void checkIndex(int value) case DATASET: case IMAGE: case THUMBNAIL: - case PROTOCOL: break; default: throw new IllegalArgumentException("Index not supported.");