protected void createFormContent(IManagedForm managedForm) {
ScrolledForm form = managedForm.getForm();
- form.setText(WorkbenchUiPlugin
- .getMessage("nodeRightsManagementPageTitle"));
+ form.setText(WorkbenchUiPlugin.getMessage("nodeRightsManagementPageTitle"));
FillLayout layout = new FillLayout();
layout.marginHeight = 5;
layout.marginWidth = 5;
viewer = new TableViewer(table);
// Group / user name
- TableViewerColumn column = createTableViewerColumn(viewer,
- "User/Group Name", 280);
+ TableViewerColumn column = createTableViewerColumn(viewer, "User/Group Name", 280);
column.setLabelProvider(new ColumnLabelProvider() {
private static final long serialVersionUID = -2290781173498395973L;
Node node = (Node) element;
try {
if (node.hasProperty("rep:principalName"))
- return node.getProperty("rep:principalName")
- .getString();
+ return node.getProperty("rep:principalName").getString();
} catch (RepositoryException e) {
- throw new EclipseUiException("Unable to retrieve "
- + "principal name on " + node, e);
+ throw new EclipseUiException("Unable to retrieve " + "principal name on " + node, e);
}
return "";
}
try {
if (node.hasProperty(propertyName)) {
String separator = ", ";
- Value[] langs = node.getProperty(propertyName)
- .getValues();
+ Value[] langs = node.getProperty(propertyName).getValues();
StringBuilder builder = new StringBuilder();
for (Value val : langs) {
String currStr = val.getString();
builder.append(currStr).append(separator);
}
if (builder.lastIndexOf(separator) >= 0)
- return builder.substring(0, builder.length()
- - separator.length());
+ return builder.substring(0, builder.length() - separator.length());
else
return builder.toString();
}
} catch (RepositoryException e) {
- throw new EclipseUiException("Unable to retrieve "
- + "privileges on " + node, e);
+ throw new EclipseUiException("Unable to retrieve " + "privileges on " + node, e);
}
return "";
}
try {
return node.getParent().getParent().getPath();
} catch (RepositoryException e) {
- throw new EclipseUiException("Unable get path for " + node,
- e);
+ throw new EclipseUiException("Unable get path for " + node, e);
}
}
viewer.setInput(getEditorSite());
}
- protected TableViewerColumn createTableViewerColumn(TableViewer viewer,
- String title, int bound) {
- final TableViewerColumn viewerColumn = new TableViewerColumn(viewer,
- SWT.NONE);
- final TableColumn column = viewerColumn.getColumn();
+ protected TableViewerColumn createTableViewerColumn(TableViewer viewer, String title, int bound) {
+ TableViewerColumn viewerColumn = new TableViewerColumn(viewer, SWT.NONE);
+ TableColumn column = viewerColumn.getColumn();
column.setText(title);
column.setWidth(bound);
column.setResizable(true);
loop: while (true) {
if (currNode.hasNode("rep:policy")) {
- NodeIterator nit = currNode.getNode("rep:policy")
- .getNodes();
+ NodeIterator nit = currNode.getNode("rep:policy").getNodes();
while (nit.hasNext()) {
Node currPrivNode = nit.nextNode();
if (currPrivNode.getName().startsWith("allow"))
return privs.toArray();
} catch (Exception e) {
- throw new EclipseUiException(
- "Cannot retrieve authorization for " + context, e);
+ throw new EclipseUiException("Cannot retrieve authorization for " + context, e);
}
}
}
String cname = context.getSession().getClass().getName();
return cname.startsWith("org.apache.jackrabbit");
} catch (RepositoryException e) {
- throw new EclipseUiException(
- "Cannot check JCR implementation used on " + context, e);
+ throw new EclipseUiException("Cannot check JCR implementation used on " + context, e);
}
}
}
ScrolledForm form = managedForm.getForm();
form.setText(WorkbenchUiPlugin.getMessage("nodeVersionHistoryPageTitle"));
tk = managedForm.getToolkit();
+ Composite body = form.getBody();
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,
WorkbenchUiPlugin.getMessage("warningUnversionableNode"));
} else {
- createHistorySection(form.getBody());
- createTreeSection(form.getBody());
+ createHistorySection(body);
+ createTreeSection(body);
}
} catch (RepositoryException e) {
- throw new EclipseUiException(
- "Unexpected error while checking if node is versionable", e);
+ throw new EclipseUiException("Unable to check 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(WorkbenchUiPlugin.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);
+ body.setLayoutData(new GridData(GridData.FILL_BOTH));
+ body.setLayout(new GridLayout());
nodeContentProvider = new FullVersioningTreeContentProvider();
nodesViewer = createNodeViewer(body, nodeContentProvider);
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);
+ styledText.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.FILL_GRAB));
refreshHistory(styledText);
styledText.setEditable(false);
section.setExpanded(false);
} catch (RepositoryException e) {
throw new EclipseUiException("Cannot generate history for node", e);
}
-
}
public List<VersionDiff> listHistoryDiff() {