/*******************************************************************************
- * 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
*******************************************************************************/
package org.eclipse.linuxtools.tmf.ui.project.model;
+import java.util.Arrays;
+
import org.eclipse.core.resources.IFolder;
import org.eclipse.ui.views.properties.IPropertyDescriptor;
import org.eclipse.ui.views.properties.IPropertySource2;
import org.eclipse.ui.views.properties.TextPropertyDescriptor;
/**
- * <b><u>TmfExperimentFolder</u></b>
+ * Implementation of the model element for the experiment folder.
* <p>
+ * @version 1.0
+ * @author Francois Chouinard
+ *
*/
public class TmfExperimentFolder extends TmfProjectModelElement implements IPropertySource2 {
// ------------------------------------------------------------------------
// Constants
// ------------------------------------------------------------------------
-
+ /**
+ * The name of the experiment folder.
+ */
public static final String EXPER_FOLDER_NAME = "Experiments"; //$NON-NLS-1$
// Property View stuff
// Constructors
// ------------------------------------------------------------------------
+ /**
+ * Constructor.
+ * Creates a TmfExperimentFolder model element.
+ * @param name The name of the folder
+ * @param folder The folder reference
+ * @param parent The parent (project element)
+ */
public TmfExperimentFolder(String name, IFolder folder, TmfProjectElement parent) {
super(name, folder, parent);
parent.addChild(this);
// ------------------------------------------------------------------------
// 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();
project.refresh();
}
- // ------------------------------------------------------------------------}
- // IPropertySource2\r // ------------------------------------------------------------------------\r\r @Override\r public Object getEditableValue() {\r return null;\r }\r\r @Override\r public IPropertyDescriptor[] getPropertyDescriptors() {\r return sfDescriptors;\r }\r\r @Override\r public Object getPropertyValue(Object id) {\r\r if (sfName.equals(id))\r return getName();\r\r if (sfPath.equals(id))\r return getPath().toString();\r\r if (sfLocation.equals(id))\r return getLocation().toString();\r\r return null;\r }\r\r @Override\r public void resetPropertyValue(Object id) {\r }\r\r @Override\r public void setPropertyValue(Object id, Object value) {\r }\r\r @Override\r public boolean isPropertyResettable(Object id) {\r return false;\r }\r\r @Override\r public boolean isPropertySet(Object id) {\r return false;\r }
+ // ------------------------------------------------------------------------
+ // 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 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)) {
+ return getName();
+ }
+
+ if (sfPath.equals(id)) {
+ return getPath().toString();
+ }
+
+ 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;
+ }
+
+}
-}\r\r
\ No newline at end of file