X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=org.eclipse.linuxtools.tmf.ui%2Fsrc%2Forg%2Feclipse%2Flinuxtools%2Ftmf%2Fui%2Fproject%2Fmodel%2FTmfExperimentFolder.java;h=6498ef257a946556743fa60aab90aae7df0a7706;hb=080600d9018f188e488a634be6e25bf91d3f692b;hp=50caab24dbb3963d3bda1b5c5265657d1b1a3bd0;hpb=be222f56a3ba9b24e29a53c38a6d43db300bf880;p=deliverable%2Ftracecompass.git diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfExperimentFolder.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfExperimentFolder.java index 50caab24db..6498ef257a 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfExperimentFolder.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfExperimentFolder.java @@ -1,11 +1,11 @@ /******************************************************************************* - * Copyright (c) 2010 Ericsson - * + * Copyright (c) 2010, 2013 Ericsson + * * 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 - * + * * Contributors: * Francois Chouinard - Initial API and implementation *******************************************************************************/ @@ -15,22 +15,23 @@ package org.eclipse.linuxtools.tmf.ui.project.model; import java.util.Arrays; import org.eclipse.core.resources.IFolder; +import org.eclipse.linuxtools.tmf.ui.properties.ReadOnlyTextPropertyDescriptor; import org.eclipse.ui.views.properties.IPropertyDescriptor; import org.eclipse.ui.views.properties.IPropertySource2; -import org.eclipse.ui.views.properties.TextPropertyDescriptor; /** * Implementation of the model element for the experiment folder. *

* @version 1.0 * @author Francois Chouinard - * + * */ public class TmfExperimentFolder extends TmfProjectModelElement implements IPropertySource2 { // ------------------------------------------------------------------------ // Constants // ------------------------------------------------------------------------ + /** * The name of the experiment folder. */ @@ -42,9 +43,9 @@ public class TmfExperimentFolder extends TmfProjectModelElement implements IProp private static final String sfPath = "path"; //$NON-NLS-1$ private static final String sfLocation = "location"; //$NON-NLS-1$ - private static final TextPropertyDescriptor sfNameDescriptor = new TextPropertyDescriptor(sfName, sfName); - private static final TextPropertyDescriptor sfPathDescriptor = new TextPropertyDescriptor(sfPath, sfPath); - private static final TextPropertyDescriptor sfLocationDescriptor = new TextPropertyDescriptor(sfLocation, sfLocation); + private static final ReadOnlyTextPropertyDescriptor sfNameDescriptor = new ReadOnlyTextPropertyDescriptor(sfName, sfName); + private static final ReadOnlyTextPropertyDescriptor sfPathDescriptor = new ReadOnlyTextPropertyDescriptor(sfPath, sfPath); + private static final ReadOnlyTextPropertyDescriptor sfLocationDescriptor = new ReadOnlyTextPropertyDescriptor(sfLocation, sfLocation); private static final IPropertyDescriptor[] sfDescriptors = { sfNameDescriptor, sfPathDescriptor, sfLocationDescriptor }; @@ -59,7 +60,7 @@ public class TmfExperimentFolder extends TmfProjectModelElement implements IProp // ------------------------------------------------------------------------ /** - * Constructor. + * Constructor. * Creates a TmfExperimentFolder model element. * @param name The name of the folder * @param folder The folder reference @@ -73,28 +74,17 @@ public class TmfExperimentFolder extends TmfProjectModelElement implements IProp // ------------------------------------------------------------------------ // TmfProjectModelElement // ------------------------------------------------------------------------ - /* - * (non-Javadoc) - * @see org.eclipse.linuxtools.tmf.ui.project.model.TmfProjectModelElement#getResource() - */ + @Override public IFolder getResource() { return (IFolder) fResource; } - - /* - * (non-Javadoc) - * @see org.eclipse.linuxtools.tmf.ui.project.model.ITmfProjectModelElement#getProject() - */ + @Override public TmfProjectElement getProject() { return (TmfProjectElement) getParent(); } - - /* - * (non-Javadoc) - * @see org.eclipse.linuxtools.tmf.ui.project.model.TmfProjectModelElement#refresh() - */ + @Override public void refresh() { TmfProjectElement project = (TmfProjectElement) getParent(); @@ -104,71 +94,51 @@ public class TmfExperimentFolder extends TmfProjectModelElement implements IProp // ------------------------------------------------------------------------ // IPropertySource2 // ------------------------------------------------------------------------ - /* - * (non-Javadoc) - * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue() - */ + @Override public Object getEditableValue() { return null; } - /* - * (non-Javadoc) - * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors() - */ + @Override public IPropertyDescriptor[] getPropertyDescriptors() { - return (sfDescriptors != null) ? Arrays.copyOf(sfDescriptors, sfDescriptors.length) : null; + return Arrays.copyOf(sfDescriptors, sfDescriptors.length); } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object) - */ + @Override public Object getPropertyValue(Object id) { - if (sfName.equals(id)) + if (sfName.equals(id)) { return getName(); + } - if (sfPath.equals(id)) + if (sfPath.equals(id)) { return getPath().toString(); + } - if (sfLocation.equals(id)) + if (sfLocation.equals(id)) { return getLocation().toString(); + } return null; } - /* - * (non-Javadoc) - * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object) - */ + @Override public void resetPropertyValue(Object id) { } - /* - * (non-Javadoc) - * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object) - */ + @Override public void setPropertyValue(Object id, Object value) { } - /* - * (non-Javadoc) - * @see org.eclipse.ui.views.properties.IPropertySource2#isPropertyResettable(java.lang.Object) - */ + @Override public boolean isPropertyResettable(Object id) { return false; } - /* - * (non-Javadoc) - * @see org.eclipse.ui.views.properties.IPropertySource2#isPropertySet(java.lang.Object) - */ + @Override public boolean isPropertySet(Object id) { return false; } } -