Add JavaDoc
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/platform/AbstractImageProvider.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/platform/AbstractImageProvider.java
index 0338db1..2463db8 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/platform/AbstractImageProvider.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/platform/AbstractImageProvider.java
@@ -21,6 +21,8 @@
import org.eclipse.graphiti.ui.internal.T;
/**
+ * The Class AbstractImageProvider.
+ *
* Instead of implementing IImageProvider directly the clients should extend
* this AbstractImageProvider. They can simply override the method
* addAvailableImages().
@@ -31,19 +33,16 @@
private Hashtable<String, String> htKeyImage = new Hashtable<String, String>();
+ /**
+ * Creates a new {@link AbstractImageProvider}.
+ */
public AbstractImageProvider() {
super();
addAvailableImages();
}
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.graphiti.ui.internal.platform.IImageProvider#getPluginId()
- */
final public String getPluginId() {
- return pluginId;
+ return this.pluginId;
}
/**
@@ -54,15 +53,8 @@
this.pluginId = pluginId;
}
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.graphiti.internal.platform.IImageProvider#getImageFilePath
- * (java.lang.String)
- */
final public String getImageFilePath(String imageId) {
- Object htObject = htKeyImage.get(imageId);
+ Object htObject = this.htKeyImage.get(imageId);
if (htObject instanceof String) {
return (String) htObject;
}
@@ -70,10 +62,11 @@
}
final protected void addImageFilePath(String imageId, String imageFilePath) {
- if (htKeyImage.get(imageId) != null)
+ if (this.htKeyImage.get(imageId) != null) {
T.racer().error("Image with ID '" + imageId + "' is already registered"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
- htKeyImage.put(imageId, imageFilePath);
+ this.htKeyImage.put(imageId, imageFilePath);
}
/**
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/platform/AbstractPropertySectionFilter.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/platform/AbstractPropertySectionFilter.java
index 9fc44be..849fe19 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/platform/AbstractPropertySectionFilter.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/platform/AbstractPropertySectionFilter.java
@@ -21,6 +21,9 @@
import org.eclipse.graphiti.mm.pictograms.PictogramElement;
import org.eclipse.jface.viewers.IFilter;
+/**
+ * The Class AbstractPropertySectionFilter.
+ */
abstract public class AbstractPropertySectionFilter implements IFilter {
final public boolean select(Object object) {
@@ -49,5 +52,12 @@
return false;
}
+ /**
+ * Check the given pictogram element for acceptance.
+ *
+ * @param pictogramElement
+ * the pictogram element
+ * @return true, if pictogram element is accepted, otherwise false
+ */
abstract protected boolean accept(PictogramElement pictogramElement);
}
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/platform/GFPropertySection.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/platform/GFPropertySection.java
index 068ecdd..10ac0db 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/platform/GFPropertySection.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/platform/GFPropertySection.java
@@ -33,8 +33,14 @@
import org.eclipse.ui.part.IContributedContentsView;
import org.eclipse.ui.views.properties.tabbed.AbstractPropertySection;
+/**
+ * The Class GFPropertySection.
+ */
public abstract class GFPropertySection extends AbstractPropertySection implements PropertyChangeListener {
+ /**
+ * @return the selected pictogram element.
+ */
protected PictogramElement getSelectedPictogramElement() {
if (getSelection() instanceof StructuredSelection) {
StructuredSelection structuredSelection = (StructuredSelection) getSelection();
@@ -59,30 +65,34 @@
}
/**
- * executes the feature and adds it to the command stack
+ * Executes the feature and adds it to the command stack.
*
* @param feature
+ * the feature
+ * @param context
+ * the context
*/
public void execute(IFeature feature, IContext context) {
GenericFeatureCommandWithContext c = new GenericFeatureCommandWithContext(feature, context);
c.execute();
}
- /**
- * @see java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent)
- */
public void propertyChange(PropertyChangeEvent evt) {
refresh();
}
+ /**
+ * @return the {@link IDiagramEditor} diagram editor.
+ */
protected IDiagramEditor getDiagramEditor() {
IWorkbenchPart part = getPart();
if (part instanceof DiagramEditorInternal) {
return (DiagramEditorInternal) part;
}
IContributedContentsView contributedView = (IContributedContentsView) part.getAdapter(IContributedContentsView.class);
- if (contributedView != null)
+ if (contributedView != null) {
part = contributedView.getContributingPart();
+ }
if (part instanceof DiagramEditorInternal) {
return (DiagramEditorInternal) part;
}
@@ -90,6 +100,9 @@
return null;
}
+ /**
+ * @return the diagram.
+ */
protected Diagram getDiagram() {
IDiagramTypeProvider diagramTypeProvider = getDiagramTypeProvider();
if (diagramTypeProvider == null) {
@@ -98,6 +111,9 @@
return diagramTypeProvider.getDiagram();
}
+ /**
+ * @return the diagram type provider.
+ */
protected IDiagramTypeProvider getDiagramTypeProvider() {
IDiagramEditor diagramEditor = getDiagramEditor();
if (diagramEditor == null) {
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/platform/PlatformImageProvider.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/platform/PlatformImageProvider.java
index 772f4f1..7d8c1da 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/platform/PlatformImageProvider.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/platform/PlatformImageProvider.java
@@ -18,6 +18,8 @@
import org.eclipse.graphiti.platform.IPlatformImageConstants;
/**
+ * The Class PlatformImageProvider.
+ *
* @noinstantiate This class is not intended to be instantiated by clients.
* @noextend This class is not intended to be subclassed by clients.
*/
@@ -27,6 +29,9 @@
public final static String ID = "org.eclipse.graphiti.ui.platform.PlatformImageProvider"; //$NON-NLS-1$
+ /**
+ * Creates a new {@link PlatformImageProvider}.
+ */
public PlatformImageProvider() {
super();
}