DESCRIPTION

- Integration of the XMl editors and tools
- Addition of the ability to create and edit an XML file
- Addition of the xml schema definition to the XSD catalog
- Addition of the XML explorer view

Change-Id: Ic312719bd93549d21caa61113a759cbd681ee6aa
Signed-off-by: Branden Mercer xxx@xxx.xxx


COMMENTS

author: Branden Mercer
date: 2014-03-17 18:01:22.000000000

Uploaded patch set 1.

-------------------------------------
author: Brenden Conley
date: 2014-03-17 18:01:28.000000000

Patch Set 1:

Build Started https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/5997/

-------------------------------------
author: Braxton Mccarthy
date: 2014-03-17 18:22:34.000000000

Patch Set 1: Code-Review-1

(8 comments)

I can't look into the details atm, but some high-level comments to start.

Line:7, /COMMIT_MSG -> leave an empty line after the commit title

Line:2, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/xmlExplorer/XMLExplorerView.java -> 2014 ;)

Line:10, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/xmlExplorer/XMLExplorerView.java -> Add a quick description of what was done next to the contributor's name. Can be "Initial implementation" for example.

Line:12, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/xmlExplorer/XMLExplorerView.java -> add an empty line after the header

Line:83, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/xmlExplorer/XMLExplorerView.java -> all fields should be private. You can use protected/public getter/setters, as needed.

Line:106, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/xmlExplorer/XMLExplorerView.java -> Not really important, but it usually helps readability to order the fields on their visibility:

* public static
* private static
* private

Line:210, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/xmlExplorer/XMLExplorerView.java -> put the inner class definitions at the end of the file (except if they're very short and related to the nearby methods).

Line:30, lttng/org.eclipse.linuxtools.lttng.target/lttng-e4.3.target -> hmm, we are already using an XML parser in the analysis.xml.* package (org.w3c.dom it seems?). We should use the same one everywhere.

That probably implies some code change though... hopefully the logic should stay the same, just changing some class names...

Geneviève can you give some guidance on this?

-------------------------------------
author: Brenden Conley
date: 2014-03-17 18:53:31.000000000

Patch Set 1: Verified+1

Build Successful 

https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/5997/ : SUCCESS

-------------------------------------
author: Annalise Jimenez
date: 2014-03-17 21:31:36.000000000

Patch Set 1: Verified-1 Code-Review-1

(23 comments)

Still missing: Open the XML editor on an existing file. Is that (easily) feasible?

Also, if you have time to look at it, using the recently added abstract tree viewer may give more flexibility, we could display different information for each file: for instance, the modification date, the number of elements in it, if it validates, etc.

Look at the state system explorer view in org.eclipse.linuxtools.tmf.ui.views.statesystem. There would be a view class to implement (with the code for the toolbar buttons) and another class that extends AbstractTmfTreeViewer. Just fill the methods to override. It doesn't have to be as complicated as the state system view for a start. Just one column with the file name, but it will be more easily extendable afterwards.

Also, when deleting, a confirmation message would be welcome. I could just delete my whole xml_files directory without warning!

Line:7, /COMMIT_MSG -> Also start the title with TMF, as my email filter will show it to me ;-)

Line:54, lttng/org.eclipse.linuxtools.tmf.core/plugin.xml -> That goes in tmf.core.analysis.tmf.core. And look at the code in gerrit, red is bad. Instead of editing directly plugin.xml, you should go on the 'Extensions' tab of the MANIFEST.MF and fill it there, the format will look good by default.

Line:10, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/xmlExplorer/XMLExplorerView.java -> Look at the copyright headers from other files. Format it the same way, the first comment is most always the same: Initial implementation and API.

Line:51, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/xmlExplorer/XMLExplorerView.java -> Remove empty line here

Line:53, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/xmlExplorer/XMLExplorerView.java -> This view should go in tmf.analysis.xml.ui plugin

Line:58, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/xmlExplorer/XMLExplorerView.java -> All public static final values should go before private fields

Line:66, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/xmlExplorer/XMLExplorerView.java -> Small javadoc like these can go on one line /** The view name */

Line:71, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/xmlExplorer/XMLExplorerView.java -> For now, it uses the default XML wizard, which by default needs a location in a project of the workspace, so XML files will be added to the project and we'll need to import them manually once they've been edited. 

It's good that you did it this way. If we override this behavior with our own wizard eventually, that will put the file directly at the right place, then we can just set this field.

Does this field have to be public?

Line:93, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/xmlExplorer/XMLExplorerView.java -> Why put those fields static? If many instances of the view can use them, that will require synchronizing the methods to make sure there is no concurrency bug. Much easier to not make them static.

Also, they could be final, you can create the Map at the beginning and clear them when needed

Line:123, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/xmlExplorer/XMLExplorerView.java -> Do not put authors in methods

Line:140, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/xmlExplorer/XMLExplorerView.java -> update would be a more suitable method name and more consistent with other views

Line:142, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/xmlExplorer/XMLExplorerView.java -> Actually, you reset fNodes and fChildren at the end. Then why put them as fields at all, you need them only during this method, so you might as well use a local variable.

Line:153, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/xmlExplorer/XMLExplorerView.java -> Put { on the same line as public ...

Line:157, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/xmlExplorer/XMLExplorerView.java -> { on the same line as the if

Line:160, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/xmlExplorer/XMLExplorerView.java -> Put else in same line as }

} else {

Line:185, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/xmlExplorer/XMLExplorerView.java -> default printStackTrace() :p Exceptions should be explicitly managed, usually just logging them with Activator.logError("some message", e);

Line:207, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/xmlExplorer/XMLExplorerView.java -> Do not repeat author if it is the same as class author

Line:216, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/xmlExplorer/XMLExplorerView.java -> it -> item, sounds clearer

Line:293, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/xmlExplorer/XMLExplorerView.java -> Activator.logError() instead.

Line:78, lttng/org.eclipse.linuxtools.tmf.ui/META-INF/MANIFEST.MF -> tmf.analysis.xml.* depends on tmf.core, not the reverse. This view should go in the the tmf.analysis.xml.ui plugin

Line:58, lttng/org.eclipse.linuxtools.tmf.ui/plugin.xml -> add this view in tmf.analysis.xml.ui plugin

Line:14, lttng/org.eclipse.linuxtools.tmf.core/META-INF/MANIFEST.MF -> This is not where this dependency should be added, it should go in o.e.l.tmf.analysis.xml.core

Line:30, lttng/org.eclipse.linuxtools.lttng.target/lttng-e4.3.target -> The reason for this plugin is to add the XML editor in the RCP, there is no code involved, except to add menus.

If you need add a dependency to the target, you should do it in all targets.

Also, use version="0.0.0" this way, if there is an update, it won't fail

-------------------------------------
author: Ricky Reeves
date: 2014-03-20 17:55:29.000000000

Patch Set 1:

How big is the org.eclipse.wst.xml_ui.feature and its dependencies? I'm asking because the RCP will increase its installation size for that.

Please let me know.

/Meredith Scott

-------------------------------------
