Author: scabanovich
Date: 2007-07-25 03:23:47 -0400 (Wed, 25 Jul 2007)
New Revision: 2644
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/AbstractSeamContentProvider.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/ProjectContentProvider.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/RootContentProvider.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/SeamProjectLabelProvider.java
Log:
EXIN-218 Comments added.
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/AbstractSeamContentProvider.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/AbstractSeamContentProvider.java 2007-07-25
02:15:30 UTC (rev 2643)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/AbstractSeamContentProvider.java 2007-07-25
07:23:47 UTC (rev 2644)
@@ -40,6 +40,17 @@
import org.jboss.tools.seam.core.event.SeamProjectChangeEvent;
/**
+ * Basic type for content providers that add seam components
+ * tree structure to views based on
+ * org.eclipse.ui.navigator.CommonNavigator
+ * Sub-classes need to override methods getChildren(Object)
+ * and getParent(Object) to specify starting points of the
+ * seam components sub-trees.
+ * Content provider for stand-alone view may start from
+ * the workspace root, while content provider contributing
+ * to the standard Project Explorer is better to append
+ * project-specific seam components to that project's node.
+ *
* @author Viacheslav Kabanovich
*/
public abstract class AbstractSeamContentProvider implements ITreeContentProvider,
ISeamProjectChangeListener {
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/ProjectContentProvider.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/ProjectContentProvider.java 2007-07-25
02:15:30 UTC (rev 2643)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/ProjectContentProvider.java 2007-07-25
07:23:47 UTC (rev 2644)
@@ -16,10 +16,21 @@
import org.jboss.tools.seam.core.SeamCorePlugin;
/**
+ * This content provider is designed to add "Seam Components" node
+ * and sub-tree for each Eclipse project, which is a seam project as well,
+ * to the standard Project Explorer view.
+ *
* @author Viacheslav Kabanovich
*/
public class ProjectContentProvider extends AbstractSeamContentProvider {
+ /**
+ * Returns child nodes for the sub-tree of seam components
+ * to the standard Project Explorer view.
+ * Root node of the sub-tree is appended as child to each node of
+ * Eclipse project, which is a seam project as well.
+ */
+ @Override
public Object[] getChildren(Object parentElement) {
if(parentElement instanceof IJavaProject) {
parentElement = ((IJavaProject)parentElement).getProject();
@@ -37,6 +48,7 @@
}
}
+ @Override
public Object getParent(Object element) {
if(element instanceof ISeamProject) {
return ((ISeamProject)element).getProject();
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/RootContentProvider.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/RootContentProvider.java 2007-07-25
02:15:30 UTC (rev 2643)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/RootContentProvider.java 2007-07-25
07:23:47 UTC (rev 2644)
@@ -20,6 +20,9 @@
import org.jboss.tools.seam.core.SeamCorePlugin;
/**
+ * This content provider is designed for stand-alone Seam Components view
+ * to build all the tree starting from the workspace root.
+ *
* @author Viacheslav Kabanovich
*/
public class RootContentProvider extends AbstractSeamContentProvider {
@@ -27,7 +30,12 @@
public RootContentProvider() {}
-
+ /**
+ * Returns child nodes for the tree of stand alone Seam Components view.
+ * On the first level, array of ISeamProject objects for projects that are
+ * seam projects is returned.
+ */
+ @Override
public Object[] getChildren(Object parentElement) {
if(parentElement instanceof IWorkspaceRoot) {
IWorkspaceRoot root = (IWorkspaceRoot)parentElement;
@@ -50,6 +58,7 @@
}
}
+ @Override
public Object getParent(Object element) {
if(element instanceof ISeamProject) {
return root;
@@ -58,6 +67,7 @@
}
}
+ @Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
super.inputChanged(viewer, oldInput, newInput);
if(newInput instanceof IWorkspaceRoot || newInput == null) {
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/SeamProjectLabelProvider.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/SeamProjectLabelProvider.java 2007-07-25
02:15:30 UTC (rev 2643)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/SeamProjectLabelProvider.java 2007-07-25
07:23:47 UTC (rev 2644)
@@ -13,12 +13,17 @@
import org.jboss.tools.seam.core.ISeamProject;
/**
+ * This implementation is designed for standard Projects Explorer
+ * view to provide 'Seam Components' name for the root node of
+ * the appended sub-tree.
+ *
* @author Viacheslav Kabanovich
*/
public class SeamProjectLabelProvider extends SeamLabelProvider {
public SeamProjectLabelProvider() {}
+ @Override
public String getText(Object element) {
if(element instanceof ISeamProject) {
return "Seam Components";