+ ScrolledForm form = managedForm.getForm();
+ tk = managedForm.getToolkit();
+ GridLayout twt = new GridLayout(1, false);
+ twt.marginWidth = twt.marginHeight = 5;
+ Composite body = form.getBody();
+ body.setLayout(twt);
+
+ try {
+ if (!currentNode.isNodeType(NodeType.MIX_VERSIONABLE)) {
+ tk.createLabel(body, JcrExplorerPlugin
+ .getMessage("warningUnversionableNode"));
+ } else {
+ createHistorySection(form.getBody());
+ createTreeSection(form.getBody());
+ }
+ } catch (RepositoryException e) {
+ throw new ArgeoException(
+ "Unexpected error while checking if node is versionable", e);
+ }
+ }
+
+ protected void createTreeSection(Composite parent) {
+ // Section Layout & MetaData
+ Section section = tk.createSection(parent, Section.TWISTIE);
+ section.setLayoutData(new GridData(GridData.FILL_BOTH));
+ section.setText(JcrExplorerPlugin.getMessage("versionTreeSectionTitle"));
+
+ // Section Body
+ Composite body = tk.createComposite(section, SWT.FILL);
+ // WARNING : 2 following lines are compulsory or body won't be
+ // displayed.
+ body.setLayout(new GridLayout());
+ section.setClient(body);
+
+ body.setLayoutData(new GridData(GridData.FILL_BOTH));
+ section.setExpanded(true);
+
+ nodeContentProvider = new FullVersioningTreeContentProvider();
+ nodesViewer = createNodeViewer(body, nodeContentProvider);
+ nodesViewer.setInput(currentNode);
+ }
+
+ protected TreeViewer createNodeViewer(Composite parent,
+ final ITreeContentProvider nodeContentProvider) {
+
+ final TreeViewer tmpNodeViewer = new TreeViewer(parent, SWT.MULTI);
+
+ tmpNodeViewer.getTree().setLayoutData(
+ new GridData(SWT.FILL, SWT.FILL, true, true));
+
+ tmpNodeViewer.setContentProvider(nodeContentProvider);
+ tmpNodeViewer.setLabelProvider(new VersionLabelProvider());
+ tmpNodeViewer
+ .addDoubleClickListener(new GenericNodeDoubleClickListener(
+ tmpNodeViewer));
+ return tmpNodeViewer;
+ }
+
+ protected void createHistorySection(Composite parent) {
+
+ // Section Layout
+ Section section = tk.createSection(parent, Section.TWISTIE);
+ section.setLayoutData(new GridData(TableWrapData.FILL_GRAB));
+ TableWrapLayout twt = new TableWrapLayout();
+ section.setLayout(twt);
+
+ // Set title of the section
+ section.setText(JcrExplorerPlugin
+ .getMessage("versionHistorySectionTitle"));
+
+ final Text styledText = tk.createText(section, "", SWT.FULL_SELECTION
+ | SWT.BORDER | SWT.MULTI | SWT.WRAP | SWT.V_SCROLL);
+ styledText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ section.setClient(styledText);
+ refreshHistory(styledText);
+ styledText.setEditable(false);
+ section.setExpanded(false);
+
+ AbstractFormPart part = new AbstractFormPart() {
+ public void commit(boolean onSave) {
+ }
+
+ public void refresh() {
+ super.refresh();
+ refreshHistory(styledText);
+ }
+ };
+ getManagedForm().addPart(part);
+ }
+
+ protected void refreshHistory(Text styledText) {