Fix small glitches and typo
authorbsinou <bsinou@argeo.org>
Wed, 8 Feb 2017 21:07:37 +0000 (22:07 +0100)
committerbsinou <bsinou@argeo.org>
Wed, 8 Feb 2017 21:07:37 +0000 (22:07 +0100)
org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/commands/DeleteNodes.java
org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/commands/EditNode.java
org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/model/SingleJcrNodeElem.java
org.argeo.eclipse.ui.rap/src/org/argeo/eclipse/ui/specific/OpenFile.java
org.argeo.eclipse.ui.rap/src/org/argeo/eclipse/ui/specific/OpenFileService.java
org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/parts/JcrUsersTable.java [deleted file]
org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/utils/SingleSourcingConstants.java
org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/utils/ViewerUtils.java

index 219d854b5455b70df78ff5963003a53430281792..41fa58bdc06f85fc99690b4408c2e48c29cbca2e 100644 (file)
@@ -61,12 +61,12 @@ public class DeleteNodes extends AbstractHandler {
                        SingleJcrNodeElem sjn = ((SingleJcrNodeElem) lst.next());
                        buf.append(sjn.getName()).append(' ');
                }
-               Boolean ok = MessageDialog.openConfirm(
+               Boolean doRemove = MessageDialog.openConfirm(
                                HandlerUtil.getActiveShell(event), "Confirm deletion",
                                "Do you want to delete " + buf + "?");
 
                // operation
-               if (ok) {
+               if (doRemove) {
                        Iterator<?> it = ((IStructuredSelection) selection).iterator();
                        Object obj = null;
                        SingleJcrNodeElem ancestor = null;
index 67949bcb14951596c94900409631b6fe446ac2a9..67f82380b5034d7ef654dbb100c5ce855e8de7ff 100644 (file)
@@ -29,9 +29,9 @@ import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.handlers.HandlerUtil;
 
-/** Generic command to open a path in an editor. */
+/** Generic command to open a Node in an editor. */
 public class EditNode extends AbstractHandler {
-       public final static String EDITOR_PARAM = "editor";
+       public final static String PARAM_EDITOR_ID = "editor";
 
        private String defaultEditorId;
 
@@ -39,18 +39,16 @@ public class EditNode extends AbstractHandler {
 
        public Object execute(ExecutionEvent event) throws ExecutionException {
                String path = event.getParameter(Property.JCR_PATH);
-
                String type = event.getParameter(NodeType.NT_NODE_TYPE);
                if (type == null)
                        type = NodeType.NT_UNSTRUCTURED;
 
-               String editorId = event.getParameter(NodeType.NT_NODE_TYPE);
+               String editorId = event.getParameter(PARAM_EDITOR_ID);
                if (editorId == null)
                        editorId = nodeTypeToEditor.containsKey(type) ? nodeTypeToEditor
                                        .get(type) : defaultEditorId;
 
                NodeEditorInput nei = new NodeEditorInput(path);
-
                try {
                        HandlerUtil.getActiveWorkbenchWindow(event).getActivePage()
                                        .openEditor(nei, editorId);
index c27a13c2f4cc5f8b5284a200ff9657ba788bd693..f323c1bd75d80480449427d243ce22e8a03d43dc 100644 (file)
@@ -26,19 +26,14 @@ import org.argeo.eclipse.ui.TreeParent;
 /**
  * UI Tree component. Wraps a node of a JCR {@link Workspace}. It also keeps a
  * reference to its parent node that can either be a {@link WorkspaceElem}, a
- * {@link SingleJcrNodeElem} or null if the node is "mounted" as the root of the UI
- * tree.
+ * {@link SingleJcrNodeElem} or null if the node is "mounted" as the root of the
+ * UI tree.
  */
-
 public class SingleJcrNodeElem extends TreeParent {
 
        private final Node node;
        private String alias = null;
 
-       // keeps a local reference to the node's name to avoid exception when the
-       // session is lost
-       // private final String name;
-
        /** Creates a new UiNode in the UI Tree */
        public SingleJcrNodeElem(TreeParent parent, Node node, String name) {
                super(name);
@@ -58,7 +53,7 @@ public class SingleJcrNodeElem extends TreeParent {
                this.alias = alias;
        }
 
-       /** returns the node wrapped by the current Ui object */
+       /** Returns the node wrapped by the current UI object */
        public Node getNode() {
                return node;
        }
@@ -68,7 +63,8 @@ public class SingleJcrNodeElem extends TreeParent {
        }
 
        /**
-        * Override normal behavior to initialize children only when first requested
+        * Overrides normal behaviour to initialise children only when first
+        * requested
         */
        @Override
        public synchronized Object[] getChildren() {
@@ -84,9 +80,7 @@ public class SingleJcrNodeElem extends TreeParent {
                                }
                                return super.getChildren();
                        } catch (RepositoryException re) {
-                               throw new EclipseUiException(
-                                               "Unexcpected error while initializing children SingleJcrNode",
-                                               re);
+                               throw new EclipseUiException("Cannot initialize SingleJcrNode children", re);
                        }
                }
        }
@@ -99,10 +93,7 @@ public class SingleJcrNodeElem extends TreeParent {
                        else
                                return false;
                } catch (RepositoryException re) {
-                       throw new EclipseUiException(
-                                       "Unexpected error while checking children node existence",
-                                       re);
+                       throw new EclipseUiException("Cannot check children node existence", re);
                }
        }
-
 }
index 10682c4ce554ab6071eaf73b3753da79f3f85918..efc07337d6b6e15e4b36beb87db50197fbc2b9cf 100644 (file)
@@ -17,6 +17,7 @@ package org.argeo.eclipse.ui.specific;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.argeo.eclipse.ui.EclipseUiUtils;
 import org.argeo.eclipse.ui.utils.SingleSourcingConstants;
 import org.eclipse.core.commands.AbstractHandler;
 import org.eclipse.core.commands.ExecutionEvent;
@@ -46,6 +47,7 @@ public class OpenFile extends AbstractHandler {
        public final static String ID = SingleSourcingConstants.OPEN_FILE_CMD_ID;
        public final static String PARAM_FILE_NAME = SingleSourcingConstants.PARAM_FILE_NAME;
        public final static String PARAM_FILE_URI = SingleSourcingConstants.PARAM_FILE_URI;;
+       
        /* DEPENDENCY INJECTION */
        private String openFileServiceId;
 
@@ -63,23 +65,16 @@ public class OpenFile extends AbstractHandler {
        }
 
        public Object execute(String openFileServiceId, String fileUri, String fileName) {
-               // // Sanity check
-               // if (fileUri == null || "".equals(fileUri.trim())
-               // || openFileServiceId == null
-               // || "".equals(openFileServiceId.trim()))
-               // return null;
-
                StringBuilder url = new StringBuilder();
                url.append(RWT.getServiceManager().getServiceHandlerUrl(openFileServiceId));
 
-               url.append("&").append(SingleSourcingConstants.PARAM_FILE_NAME).append("=");
-               url.append(fileName);
-               url.append("&").append(SingleSourcingConstants.PARAM_FILE_URI).append("=");
-               url.append(fileUri);
+               if (EclipseUiUtils.notEmpty(fileName))
+                       url.append("&").append(SingleSourcingConstants.PARAM_FILE_NAME).append("=").append(fileName);
+               url.append("&").append(SingleSourcingConstants.PARAM_FILE_URI).append("=").append(fileUri);
 
                String downloadUrl = url.toString();
                if (log.isTraceEnabled())
-                       log.debug("URL : " + downloadUrl);
+                       log.trace("Calling OpenFileService with ID: " + openFileServiceId + " , with download URL: " + downloadUrl);
 
                UrlLauncher launcher = RWT.getClient().getService(UrlLauncher.class);
                launcher.openURL(downloadUrl);
index 0a6f3b6870500b317ad611eb6164869c223b0576..a181a29936324a2fe75a15173179bba163246b2b 100644 (file)
@@ -16,7 +16,6 @@
 package org.argeo.eclipse.ui.specific;
 
 import static org.argeo.eclipse.ui.utils.SingleSourcingConstants.FILE_SCHEME;
-import static org.argeo.eclipse.ui.utils.SingleSourcingConstants.JCR_SCHEME;
 import static org.argeo.eclipse.ui.utils.SingleSourcingConstants.SCHEME_HOST_SEPARATOR;
 
 import java.io.IOException;
@@ -47,9 +46,14 @@ public class OpenFileService implements ServiceHandler {
                String fileName = request.getParameter(SingleSourcingConstants.PARAM_FILE_NAME);
                String uri = request.getParameter(SingleSourcingConstants.PARAM_FILE_URI);
 
+               // Use buffered array to directly write the stream?
+               if (!uri.startsWith(SingleSourcingConstants.FILE_SCHEME))
+                       throw new IllegalArgumentException(
+                                       "Open file service can only handle files that are on the server file system");
+
                // Set the Metadata
                response.setContentLength((int) getFileSize(uri));
-               if (fileName == null || "".equals(fileName.trim()))
+               if (EclipseUiUtils.isEmpty(fileName))
                        fileName = getFileName(uri);
                response.setContentType(getMimeType(uri, fileName));
                String contentDisposition = "attachment; filename=\"" + fileName + "\"";
@@ -60,31 +64,14 @@ public class OpenFileService implements ServiceHandler {
                // response.setHeader("Pragma", "no-cache");
                // response.setHeader("Cache-Control", "no-cache, must-revalidate");
 
-               // Use buffered array to directly write the stream?
-               response.getOutputStream().write(getFileAsByteArray(uri));
-       }
-
-       /**
-        * Retrieves the data as Byte Array given an uri.
-        * 
-        * Overwrite to provide application specific behaviours, like opening from a
-        * JCR repository
-        */
-       protected byte[] getFileAsByteArray(String uri) {
-               try {
-                       if (uri.startsWith(SingleSourcingConstants.FILE_SCHEME)) {
-                               Path path = Paths.get(getAbsPathFromUri(uri));
-                               return Files.readAllBytes(path);
-                       }
-                       // else if (uri.startsWith(JCR_SCHEME)) {
-                       // String absPath = Paths.get(getAbsPathFromUri(uri));
-                       // return Files.readAllBytes(path);
-                       // }
+               Path path = Paths.get(getAbsPathFromUri(uri));
+               Files.copy(path, response.getOutputStream());
 
-               } catch (IOException ioe) {
-                       throw new SingleSourcingException("Error getting the file at " + uri, ioe);
-               }
-               return null;
+               // FIXME we always use temporary files for the time being.
+               // the deleteOnClose file only works when the JVM is closed so we
+               // explicitly delete to avoid overloading the server
+               if (path.startsWith("/tmp"))
+                       path.toFile().delete();
        }
 
        protected long getFileSize(String uri) throws IOException {
@@ -106,10 +93,10 @@ public class OpenFileService implements ServiceHandler {
        private String getAbsPathFromUri(String uri) {
                if (uri.startsWith(FILE_SCHEME))
                        return uri.substring((FILE_SCHEME + SCHEME_HOST_SEPARATOR).length());
-               else if (uri.startsWith(JCR_SCHEME))
-                       return uri.substring((JCR_SCHEME + SCHEME_HOST_SEPARATOR).length());
+               // else if (uri.startsWith(JCR_SCHEME))
+               // return uri.substring((JCR_SCHEME + SCHEME_HOST_SEPARATOR).length());
                else
-                       throw new SingleSourcingException("Unknown URI prefix for" + uri);
+                       throw new IllegalArgumentException("Unknown URI prefix for" + uri);
        }
 
        protected String getMimeType(String uri, String fileName) throws IOException {
@@ -119,11 +106,6 @@ public class OpenFileService implements ServiceHandler {
                        if (EclipseUiUtils.notEmpty(mimeType))
                                return mimeType;
                }
-               return getMimeTypeFromName(fileName);
-       }
-
-       /** Overwrite to precise the content type */
-       protected String getMimeTypeFromName(String fileName) {
                return "application/octet-stream";
        }
 }
diff --git a/org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/parts/JcrUsersTable.java b/org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/parts/JcrUsersTable.java
deleted file mode 100644 (file)
index 9ae89a1..0000000
+++ /dev/null
@@ -1,321 +0,0 @@
-package org.argeo.eclipse.ui.parts;
-
-@Deprecated
-public class JcrUsersTable {
-}
-/**
- * Composite that contains a JFace table to display users that are stored in JCR
- * following the Argeo Conventions (See {@link ArgeoNames}
- */
-// public class JcrUsersTable extends Composite implements ArgeoNames {
-// // private final static Log log =
-// // LogFactory.getLog(UserTableComposite.class);
-//
-// private static final long serialVersionUID = -7385959046279360420L;
-//
-// private Session session;
-//
-// private boolean hasFilter;
-// private boolean hasSelectionColumn;
-// private int tableStyle;
-//
-// private TableViewer usersViewer;
-// private Text filterTxt;
-// private String filterHelpMsg = "Type filter criterion "
-// + "separated by a space";
-//
-// private Font italic;
-// private Font bold;
-//
-// /** Overwrite to display other columns */
-// public List<JcrColumnDefinition> getColumnsDef() {
-// List<JcrColumnDefinition> columnDefs = new ArrayList<JcrColumnDefinition>();
-//
-// // User ID
-// columnDefs.add(new JcrColumnDefinition(ARGEO_USER_ID,
-// PropertyType.STRING, "User ID", 100));
-// // Displayed name
-// columnDefs.add(new JcrColumnDefinition(Property.JCR_TITLE,
-// PropertyType.STRING, "Name", 150));
-//
-// // E-mail
-// columnDefs.add(new JcrColumnDefinition(ARGEO_PRIMARY_EMAIL,
-// PropertyType.STRING, "E-mail", 150));
-//
-// // Description
-// columnDefs.add(new JcrColumnDefinition(Property.JCR_DESCRIPTION,
-// PropertyType.STRING, "Description", 200));
-//
-// return columnDefs;
-// }
-//
-// public JcrUsersTable(Composite parent, int style, Session session) {
-// super(parent, SWT.NO_FOCUS);
-// this.tableStyle = style;
-// this.session = session;
-// }
-//
-// /**
-// *
-// * @param addFilter
-// * choose to add a field to filter results or not
-// * @param addSelection
-// * choose to add a column to select some of the displayed results
-// * or not
-// */
-// public void populate(boolean addFilter, boolean addSelection) {
-// // initialization
-// Composite parent = this;
-// italic = EclipseUiUtils.getItalicFont(parent);
-// bold = EclipseUiUtils.getBoldFont(parent);
-// hasFilter = addFilter;
-// hasSelectionColumn = addSelection;
-//
-// // Main Layout
-// GridLayout layout = EclipseUiUtils.noSpaceGridLayout();
-// layout.verticalSpacing = 5;
-// this.setLayout(layout);
-// if (hasFilter)
-// createFilterPart(parent);
-// usersViewer = createTableViewer(parent);
-// // EclipseUiSpecificUtils.enableToolTipSupport(usersViewer);
-// usersViewer.setContentProvider(new UsersContentProvider());
-// refreshFilteredList();
-// }
-//
-// public List<Node> getSelectedUsers() {
-// if (hasSelectionColumn) {
-// Object[] elements = ((CheckboxTableViewer) usersViewer)
-// .getCheckedElements();
-//
-// List<Node> result = new ArrayList<Node>();
-// for (Object obj : elements) {
-// result.add((Node) obj);
-// }
-// return result;
-// } else
-// throw new EclipseUiException("Unvalid request: no selection column "
-// + "has been created for the current table");
-// }
-//
-// /** Returns the User table viewer, typically to add doubleclick listener */
-// public TableViewer getTableViewer() {
-// return usersViewer;
-// }
-//
-// /** Returns filter String or null */
-// protected String getFilterString() {
-// return hasFilter ? filterTxt.getText() : null;
-// }
-//
-// private TableViewer createTableViewer(final Composite parent) {
-// int style = tableStyle | SWT.H_SCROLL | SWT.V_SCROLL;
-// if (hasSelectionColumn)
-// style = style | SWT.CHECK;
-//
-// Table table = new Table(parent, style);
-// table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-//
-// TableViewer viewer;
-// if (hasSelectionColumn)
-// viewer = new CheckboxTableViewer(table);
-// else
-// viewer = new TableViewer(table);
-// table.setLinesVisible(true);
-// table.setHeaderVisible(true);
-//
-// TableViewerColumn column;
-// int offset = 0;
-// if (hasSelectionColumn) {
-// offset = 1;
-// column = ViewerUtils.createTableViewerColumn(viewer, "", SWT.NONE,
-// 25);
-// column.setLabelProvider(new ColumnLabelProvider() {
-// private static final long serialVersionUID = 1L;
-//
-// @Override
-// public String getText(Object element) {
-// return null;
-// }
-// });
-// SelectionAdapter selectionAdapter = new SelectionAdapter() {
-// private static final long serialVersionUID = 1L;
-//
-// boolean allSelected = false;
-//
-// @Override
-// public void widgetSelected(SelectionEvent e) {
-// allSelected = !allSelected;
-// ((CheckboxTableViewer) usersViewer)
-// .setAllChecked(allSelected);
-// }
-// };
-// column.getColumn().addSelectionListener(selectionAdapter);
-// }
-//
-// // Create other columns
-// List<JcrColumnDefinition> colDefs = getColumnsDef();
-//
-// NodeViewerComparator comparator = new NodeViewerComparator();
-// int i = offset;
-// for (JcrColumnDefinition colDef : colDefs) {
-// column = ViewerUtils.createTableViewerColumn(viewer,
-// colDef.getHeaderLabel(), SWT.NONE, colDef.getColumnSize());
-// column.setLabelProvider(new CLProvider(colDef.getPropertyName()));
-// column.getColumn().addSelectionListener(
-// JcrUiUtils.getNodeSelectionAdapter(i,
-// colDef.getPropertyType(), colDef.getPropertyName(),
-// comparator, viewer));
-// i++;
-// }
-//
-// // IMPORTANT: initialize comparator before setting it
-// JcrColumnDefinition firstCol = colDefs.get(0);
-// comparator.setColumn(firstCol.getPropertyType(),
-// firstCol.getPropertyName());
-// viewer.setComparator(comparator);
-//
-// return viewer;
-// }
-//
-// private class CLProvider extends SimpleJcrNodeLabelProvider {
-//
-// private static final long serialVersionUID = 1L;
-//
-// public CLProvider(String propertyName) {
-// super(propertyName);
-// }
-//
-// public String getToolTipText(Object element) {
-// return getText(element);
-// }
-//
-// // @Override
-// // public Font getFont(Object elem) {
-// // // self
-// // String username = getProperty(elem, ARGEO_USER_ID);
-// // if (username.equals(session.getUserID()))
-// // return bold;
-// // // disabled
-// // try {
-// // Node userProfile = (Node) elem;
-// // if (!userProfile.getProperty(ARGEO_ENABLED).getBoolean())
-// // return italic;
-// // else
-// // return null;
-// // } catch (RepositoryException e) {
-// // throw new EclipseUiException("Cannot get font for " + username, e);
-// // }
-// // }
-// }
-//
-// @Override
-// public boolean setFocus() {
-// usersViewer.getTable().setFocus();
-// return true;
-// }
-//
-// @Override
-// public void dispose() {
-// super.dispose();
-// }
-//
-// public void refresh() {
-// refreshFilteredList();
-// }
-//
-// private String getProperty(Object element, String name) {
-// try {
-// Node userProfile = (Node) element;
-// return userProfile.hasProperty(name) ? userProfile
-// .getProperty(name).getString() : "";
-// } catch (RepositoryException e) {
-// throw new EclipseUiException("Cannot get property " + name, e);
-// }
-// }
-//
-// private class UsersContentProvider implements IStructuredContentProvider {
-// private static final long serialVersionUID = 1L;
-//
-// public Object[] getElements(Object inputElement) {
-// return (Object[]) inputElement;
-// }
-//
-// public void dispose() {
-// }
-//
-// public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-// }
-// }
-//
-// /* MANAGE FILTER */
-// private void createFilterPart(Composite parent) {
-// // Text Area for the filter
-// filterTxt = new Text(parent, SWT.BORDER | SWT.SEARCH | SWT.ICON_SEARCH
-// | SWT.ICON_CANCEL);
-// filterTxt.setMessage(filterHelpMsg);
-// filterTxt.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL
-// | GridData.HORIZONTAL_ALIGN_FILL));
-// filterTxt.addModifyListener(new ModifyListener() {
-// private static final long serialVersionUID = 1L;
-//
-// public void modifyText(ModifyEvent event) {
-// refreshFilteredList();
-// }
-// });
-// }
-//
-// /**
-// * Refresh the user list: caller might overwrite in order to display a
-// * subset of all users, typically to remove current user from the list
-// */
-// protected void refreshFilteredList() {
-// List<Node> nodes;
-// try {
-// nodes = JcrUtils.nodeIteratorToList(listFilteredElements(session,
-// hasFilter ? filterTxt.getText() : null));
-// usersViewer.setInput(nodes.toArray());
-// } catch (RepositoryException e) {
-// throw new EclipseUiException("Unable to list users", e);
-// }
-// }
-//
-// /**
-// * Build repository request : caller might overwrite in order to display a
-// * subset of all users
-// */
-// protected NodeIterator listFilteredElements(Session session, String filter)
-// throws RepositoryException {
-// QueryManager queryManager = session.getWorkspace().getQueryManager();
-// QueryObjectModelFactory factory = queryManager.getQOMFactory();
-//
-// Selector source = factory.selector(ArgeoTypes.ARGEO_USER_PROFILE,
-// ArgeoTypes.ARGEO_USER_PROFILE);
-//
-// // Dynamically build constraint depending on the filter String
-// Constraint defaultC = null;
-// if (filter != null && !"".equals(filter.trim())) {
-// String[] strs = filter.trim().split(" ");
-// for (String token : strs) {
-// StaticOperand so = factory.literal(session.getValueFactory()
-// .createValue("*" + token + "*"));
-// Constraint currC = factory.fullTextSearch(
-// source.getSelectorName(), null, so);
-// if (defaultC == null)
-// defaultC = currC;
-// else
-// defaultC = factory.and(defaultC, currC);
-// }
-// }
-//
-// Ordering order = factory.ascending(factory.propertyValue(
-// source.getSelectorName(), ARGEO_USER_ID));
-// Ordering[] orderings = { order };
-//
-// QueryObjectModel query = factory.createQuery(source, defaultC,
-// orderings, null);
-//
-// QueryResult result = query.execute();
-// return result.getNodes();
-// }
-// }
\ No newline at end of file
index 269890082afea09942cac7a3e7b0cb1e7debb4d2..a45eeda4fb619caf18ef3cac56d272ff391acfbd 100644 (file)
@@ -2,7 +2,7 @@ package org.argeo.eclipse.ui.utils;
 
 /**
  * Centralise constants that are used in both RAP and RCP specific code to avoid
- * dupplicated declaration
+ * duplicated declaration
  */
 public interface SingleSourcingConstants {
 
index 4a53e40313d92ec3c2f4fe0e528507f110073f8a..56766917dc976a313db9ea8f729aad05a0672bed 100644 (file)
@@ -24,8 +24,7 @@ import org.eclipse.swt.widgets.TableColumn;
 import org.eclipse.swt.widgets.TreeColumn;
 
 /**
- * Centralizes useful methods to manage Jface Table, Tree and TreeColumn
- * viewers.
+ * Centralise useful methods to manage JFace Table, Tree and TreeColumn viewers.
  */
 public class ViewerUtils {
 
@@ -33,8 +32,7 @@ public class ViewerUtils {
         * Creates a basic column for the given table. For the time being, we do not
         * support movable columns.
         */
-       public static TableColumn createColumn(Table parent, String name,
-                       int style, int width) {
+       public static TableColumn createColumn(Table parent, String name, int style, int width) {
                TableColumn result = new TableColumn(parent, style);
                result.setText(name);
                result.setWidth(width);
@@ -46,8 +44,7 @@ public class ViewerUtils {
         * Creates a TableViewerColumn for the given viewer. For the time being, we
         * do not support movable columns.
         */
-       public static TableViewerColumn createTableViewerColumn(TableViewer parent,
-                       String name, int style, int width) {
+       public static TableViewerColumn createTableViewerColumn(TableViewer parent, String name, int style, int width) {
                TableViewerColumn tvc = new TableViewerColumn(parent, style);
                TableColumn column = tvc.getColumn();
                column.setText(name);
@@ -60,8 +57,7 @@ public class ViewerUtils {
         * Creates a TreeViewerColumn for the given viewer. For the time being, we
         * do not support movable columns.
         */
-       public static TreeViewerColumn createTreeViewerColumn(TreeViewer parent,
-                       String name, int style, int width) {
+       public static TreeViewerColumn createTreeViewerColumn(TreeViewer parent, String name, int style, int width) {
                TreeViewerColumn tvc = new TreeViewerColumn(parent, style);
                TreeColumn column = tvc.getColumn();
                column.setText(name);