* @since 2.0*/
public static String TmfViewsElement_Name;
+ /** Name of the element "On-demand Analyses"
+ * @since 2.0*/
+ public static String TmfOnDemandAnalysesElement_Name;
+
+ /** Name of the element "Reports"
+ * @since 2.0*/
+ public static String TmfReportsElement_Name;
+
/**
* The title for the select trace type dialog */
public static String TmfTraceType_SelectTraceType;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
private static final String BOOKMARKS_HIDDEN_FILE = ".bookmarks"; //$NON-NLS-1$
+ /* Direct child elements */
private TmfViewsElement fViewsElement = null;
+ private TmfOnDemandAnalysesElement fOnDemandAnalysesElement = null;
+ private TmfReportsElement fReportsElement = null;
/** This trace type ID as defined in plugin.xml */
private String fTraceTypeId = null;
protected void refreshChildren() {
/* Get the base path to put the resource to */
IPath tracePath = getResource().getFullPath();
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
if (fViewsElement == null) {
/* Add the "Views" node */
- IFolder viewsNodeRes = ResourcesPlugin.getWorkspace().getRoot().getFolder(tracePath.append(TmfViewsElement.PATH_ELEMENT));
+ IFolder viewsNodeRes = root.getFolder(tracePath.append(TmfViewsElement.PATH_ELEMENT));
fViewsElement = new TmfViewsElement(viewsNodeRes, this);
addChild(fViewsElement);
}
fViewsElement.refreshChildren();
+
+ if (fOnDemandAnalysesElement == null) {
+ /* Add the "On-demand Analyses" node */
+ IFolder analysesNodeRes = root.getFolder(tracePath.append(TmfOnDemandAnalysesElement.PATH_ELEMENT));
+ fOnDemandAnalysesElement = new TmfOnDemandAnalysesElement(analysesNodeRes, this);
+ addChild(fOnDemandAnalysesElement);
+ }
+ fOnDemandAnalysesElement.refreshChildren();
+
+ if (fReportsElement == null) {
+ /* Add the "Reports" node */
+ IFolder reportsNodeRes = root.getFolder(tracePath.append(TmfReportsElement.PATH_ELEMENT));
+ fReportsElement = new TmfReportsElement(reportsNodeRes, this);
+ addChild(fReportsElement);
+ }
+ fReportsElement.refreshChildren();
}
/**
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2016 EfficiOS Inc., Alexandre Montplaisir
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.tmf.ui.project.model;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * Project model element for the "On-Demand Analyses" element, which goes under
+ * individual trace and experiment elements.
+ *
+ * It will list the available implementations of IOnDemandAnalysis that can be
+ * executed on this particular trace.
+ *
+ * @author Alexandre Montplaisir
+ * @since 2.0
+ */
+public class TmfOnDemandAnalysesElement extends TmfProjectModelElement {
+
+ /**
+ * Element of the resource path
+ */
+ public static final String PATH_ELEMENT = ".ondemand-analyses"; //$NON-NLS-1$
+
+ private static final String ELEMENT_NAME = Messages.TmfOnDemandAnalysesElement_Name;
+
+ /**
+ * Constructor
+ *
+ * @param resource
+ * The resource to be associated with this element
+ * @param parent
+ * The parent element
+ */
+ protected TmfOnDemandAnalysesElement(IResource resource, TmfCommonProjectElement parent) {
+ super(ELEMENT_NAME, resource, parent);
+ }
+
+ @Override
+ public TmfCommonProjectElement getParent() {
+ /* Type enforced at constructor */
+ return (TmfCommonProjectElement) super.getParent();
+ }
+
+ @Override
+ public Image getIcon() {
+ return TmfProjectModelIcons.ONDEMAND_ANALYSES_ICON;
+ }
+
+ @Override
+ protected void refreshChildren() {
+ /* No children at the moment */
+ }
+
+}
public static final @NonNull Image FOLDER_ICON;
public static final @NonNull Image VIEWS_ICON;
+ public static final @NonNull Image ONDEMAND_ANALYSES_ICON;
+ public static final @NonNull Image REPORTS_ICON;
public static final WorkbenchLabelProvider WORKSPACE_LABEL_PROVIDER = new WorkbenchLabelProvider();
private static final String EXPERIMENT_ICON_FILE = "icons/elcl16/experiment.gif"; //$NON-NLS-1$
private static final String ANALYSIS_ICON_FILE = "icons/ovr16/experiment_folder_ovr.png"; //$NON-NLS-1$
private static final String VIEW_ICON_FILE = "icons/obj16/node_obj.gif"; //$NON-NLS-1$
+ private static final String ONDEMAND_ANALYSES_ICON_FILE = "icons/obj16/debugt_obj.gif"; //$NON-NLS-1$
+ private static final String REPORTS_ICON_FILE = "icons/obj16/arraypartition_obj.gif"; //$NON-NLS-1$
// ------------------------------------------------------------------------
// Initialization
static {
ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages();
+ Bundle bundle = Activator.getDefault().getBundle();
+
FOLDER_ICON = checkNotNull(sharedImages.getImage(ISharedImages.IMG_OBJ_FOLDER));
VIEWS_ICON = checkNotNull(sharedImages.getImage(ISharedImages.IMG_OBJ_ELEMENT));
+ ONDEMAND_ANALYSES_ICON = checkNotNull(loadIcon(bundle, ONDEMAND_ANALYSES_ICON_FILE));
+ REPORTS_ICON = checkNotNull(loadIcon(bundle, REPORTS_ICON_FILE));
- Bundle bundle = Activator.getDefault().getBundle();
DEFAULT_TRACE_ICON = checkNotNull(loadIcon(bundle, TRACE_ICON_FILE));
DEFAULT_EXPERIMENT_ICON = checkNotNull(loadIcon(bundle, EXPERIMENT_ICON_FILE));
DEFAULT_ANALYSIS_ICON = checkNotNull(loadIcon(bundle, ANALYSIS_ICON_FILE));
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2016 EfficiOS Inc., Alexandre Montplaisir
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.tmf.ui.project.model;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * Project model element for the "Reports" element, which lists the analysis
+ * reports that were generated for this trace.
+ *
+ * It acts like a directory for the reports, where each one can be opened or
+ * deleted.
+ *
+ * @author Alexandre Montplaisir
+ * @since 2.0
+ */
+public class TmfReportsElement extends TmfProjectModelElement {
+
+ /**
+ * Element of the resource path
+ */
+ public static final String PATH_ELEMENT = ".reports"; //$NON-NLS-1$
+
+ private static final String ELEMENT_NAME = Messages.TmfReportsElement_Name;
+
+ /**
+ * Constructor
+ *
+ * @param resource
+ * The resource to be associated with this element
+ * @param parent
+ * The parent element
+ */
+ protected TmfReportsElement(IResource resource, TmfCommonProjectElement parent) {
+ super(ELEMENT_NAME, resource, parent);
+ }
+
+ @Override
+ public TmfCommonProjectElement getParent() {
+ /* Type enforced at constructor */
+ return (TmfCommonProjectElement) super.getParent();
+ }
+
+ @Override
+ public Image getIcon() {
+ return TmfProjectModelIcons.REPORTS_ICON;
+ }
+
+ @Override
+ protected void refreshChildren() {
+ /* No children at the moment */
+ }
+
+}
TmfTraceElement_TypeName=Trace
TmfTraceType_SelectTraceType=Select Trace Type
TmfViewsElement_Name=Views
+TmfOnDemandAnalysesElement_Name=External Analyses
+TmfReportsElement_Name=Reports
# Open trace error messages
TmfOpenTraceHelper_ErrorOpeningElement=Error opening {0}