Clean: fix typos, update comments
authorBruno Sinou <bsinou@argeo.org>
Wed, 26 Feb 2014 14:23:38 +0000 (14:23 +0000)
committerBruno Sinou <bsinou@argeo.org>
Wed, 26 Feb 2014 14:23:38 +0000 (14:23 +0000)
git-svn-id: https://svn.argeo.org/slc/trunk@6858 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

16 files changed:
plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/commands/DisplayRepoInformation.java
plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/commands/RefreshDistributionOverviewPage.java
plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/commands/RefreshDistributionsView.java
plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/commands/RegisterRepository.java
plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/commands/UnregisterRemoteRepo.java
plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/controllers/DistSessionFactory.java
plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/controllers/DistTreeComparator.java
plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/controllers/DistTreeContentProvider.java
plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/controllers/DistTreeDoubleClickListener.java
plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/editors/ArtifactsBrowserPage.java
plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/editors/BundleDetailsPage.java
plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/editors/DistributionEditor.java
plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/editors/DistributionOverviewPage.java
plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/editors/GenericBundleEditor.java
plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/editors/GenericBundleEditorInput.java
plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/views/DistributionsView.java

index e5c733dfa9d863c0610c326fa7cbc0e97bdbd772..e439491c9cb0aa0f717391231e9e6df436f349d6 100644 (file)
@@ -46,7 +46,7 @@ import org.eclipse.ui.handlers.HandlerUtil;
  */
 public class DisplayRepoInformation extends AbstractHandler {
        public final static String ID = DistPlugin.ID + ".displayRepoInformation";
-       public final static String DEFAULT_LABEL = "Repository infos";
+       public final static String DEFAULT_LABEL = "Information";
        public final static ImageDescriptor DEFAULT_ICON = DistPlugin
                        .getImageDescriptor("icons/help.gif");
 
index 90305390da890e8d629c73b3931dcc05d9df0885..f78ede5b4ecadaacc8573f67f214b5e18ab29112 100644 (file)
@@ -28,15 +28,13 @@ import org.eclipse.ui.forms.editor.IFormPage;
 /**
  * Force refresh of the Distribution overview page of the corresponding editor
  */
-
 public class RefreshDistributionOverviewPage extends AbstractHandler {
        // private static final Log log = LogFactory
        // .getLog(RefreshDistributionOverviewPage.class);
+
        public final static String ID = DistPlugin.ID
                        + ".refreshDistributionOverviewPage";
        public final static String DEFAULT_LABEL = "Refresh the distribution overview";
-
-       // public final static String DEFAULT_ICON_PATH = "icons/refresh.png";
        public final static ImageDescriptor DEFAULT_ICON = DistPlugin
                        .getImageDescriptor("icons/refresh.png");
 
@@ -51,4 +49,4 @@ public class RefreshDistributionOverviewPage extends AbstractHandler {
                }
                return null;
        }
-}
+}
\ No newline at end of file
index f6af017880ff60cc20d97e2537044d49f2aefe57..b7d3ed680083785a8b48aef322adba4a1eafd90c 100644 (file)
@@ -25,16 +25,14 @@ import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.ui.IWorkbenchPart;
 
 /**
- * Force refresh of the DistributionsView
+ * Force refresh of the Distributions View
  */
-
 public class RefreshDistributionsView extends AbstractHandler {
        public final static String ID = DistPlugin.ID + ".refreshDistributionsView";
        public final static String DEFAULT_LABEL = "Refresh the distribution view";
        public final static ImageDescriptor DEFAULT_ICON = DistPlugin
                        .getImageDescriptor("icons/refresh.png");
 
-
        public Object execute(ExecutionEvent event) throws ExecutionException {
                IWorkbenchPart activePart = DistPlugin.getDefault().getWorkbench()
                                .getActiveWorkbenchWindow().getActivePage().getActivePart();
index 5a75c07cb38ce6015de41b216c420e2ec1593859..c044c59d848126eb1b3879c313bc16078d15bef1 100644 (file)
@@ -33,18 +33,16 @@ import org.eclipse.jface.wizard.WizardDialog;
 import org.eclipse.ui.handlers.HandlerUtil;
 
 /**
- * Connect to a remote repository.
+ * Register a remote repository by creating a node in the current
  */
 public class RegisterRepository extends AbstractHandler implements ArgeoNames,
                SlcNames {
 
        public final static String ID = DistPlugin.ID + ".registerRepository";
        public final static String DEFAULT_LABEL = "Register a repository...";
-       // public final static String DEFAULT_ICON_PATH = "icons/addRepo.gif";
        public final static ImageDescriptor DEFAULT_ICON = DistPlugin
                        .getImageDescriptor("icons/addRepo.gif");
 
-
        /* DEPENDENCY INJECTION */
        private RepositoryFactory repositoryFactory;
        private Repository nodeRepository;
@@ -58,11 +56,6 @@ public class RegisterRepository extends AbstractHandler implements ArgeoNames,
                int result = dialog.open();
                if (result == Dialog.OK)
                        CommandHelpers.callCommand(RefreshDistributionsView.ID);
-
-               // RemoteRepositoryLoginDialog dlg = new RemoteRepositoryLoginDialog(
-               // Display.getDefault().getActiveShell());
-               // if (dlg.open() == Dialog.OK) {
-               // }
                return null;
        }
 
@@ -77,154 +70,4 @@ public class RegisterRepository extends AbstractHandler implements ArgeoNames,
        public void setNodeRepository(Repository nodeRepository) {
                this.nodeRepository = nodeRepository;
        }
-
-       // class RemoteRepositoryLoginDialog extends TitleAreaDialog {
-       // private Text name;
-       // private Text uri;
-       // private Text username;
-       // private Text password;
-       // private Button saveInKeyring;
-       //
-       // public RemoteRepositoryLoginDialog(Shell parentShell) {
-       // super(parentShell);
-       // }
-       //
-       // protected Point getInitialSize() {
-       // return new Point(600, 400);
-       // }
-       //
-       // protected Control createDialogArea(Composite parent) {
-       // Composite dialogarea = (Composite) super.createDialogArea(parent);
-       // dialogarea.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true,
-       // true));
-       // Composite composite = new Composite(dialogarea, SWT.NONE);
-       // composite.setLayout(new GridLayout(2, false));
-       // composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true,
-       // false));
-       // setMessage("Login to remote repository", IMessageProvider.NONE);
-       // name = createLT(composite, "Name", "Example Java Repository");
-       // uri = createLT(composite, "URI",
-       // "https://example.com/data/jcr/java");
-       // username = createLT(composite, "User", "");
-       // password = createLP(composite, "Password");
-       //
-       // saveInKeyring = createLC(composite, "Remember password", false);
-       // parent.pack();
-       // return composite;
-       // }
-       //
-       // @Override
-       // protected void createButtonsForButtonBar(Composite parent) {
-       // super.createButtonsForButtonBar(parent);
-       // Button test = createButton(parent, 2, "Test", false);
-       // test.addSelectionListener(new SelectionAdapter() {
-       // public void widgetSelected(SelectionEvent arg0) {
-       // testConnection();
-       // }
-       // });
-       // }
-       //
-       // void testConnection() {
-       // Session session = null;
-       // try {
-       // if (uri.getText().startsWith("http")) {// http, https
-       // URI checkedUri = new URI(uri.getText());
-       // String checkedUriStr = checkedUri.toString();
-       // Hashtable<String, String> params = new Hashtable<String, String>();
-       // params.put(ArgeoJcrConstants.JCR_REPOSITORY_URI,
-       // checkedUriStr);
-       // Repository repository = ArgeoJcrUtils.getRepositoryByUri(
-       // repositoryFactory, checkedUriStr);
-       // if (username.getText().trim().equals("")) {// anonymous
-       // session = repository.login();
-       // } else {
-       // // FIXME use getTextChars() when upgrading to 3.7
-       // // see
-       // // https://bugs.eclipse.org/bugs/show_bug.cgi?id=297412
-       // char[] pwd = password.getText().toCharArray();
-       // SimpleCredentials sc = new SimpleCredentials(
-       // username.getText(), pwd);
-       // session = repository.login(sc);
-       // }
-       // } else {// alias
-       // Repository repository = ArgeoJcrUtils.getRepositoryByAlias(
-       // repositoryFactory, uri.getText());
-       // session = repository.login();
-       // }
-       // MessageDialog.openInformation(getParentShell(), "Success",
-       // "Connection to '" + uri.getText() + "' successful");
-       // } catch (Exception e) {
-       // ErrorFeedback.show(
-       // "Connection test failed for " + uri.getText(), e);
-       // } finally {
-       // JcrUtils.logoutQuietly(session);
-       // }
-       // }
-       //
-       // @Override
-       // protected void okPressed() {
-       // Session nodeSession = null;
-       // try {
-       // nodeSession = nodeRepository.login();
-       // String reposPath = UserJcrUtils.getUserHome(nodeSession)
-       // .getPath() + RepoConstants.REPOSITORIES_BASE_PATH;
-       //
-       // Node repos = nodeSession.getNode(reposPath);
-       // String repoNodeName = JcrUtils.replaceInvalidChars(name
-       // .getText());
-       // if (repos.hasNode(repoNodeName))
-       // throw new ArgeoException(
-       // "There is already a remote repository named "
-       // + repoNodeName);
-       // Node repoNode = repos.addNode(repoNodeName,
-       // ArgeoTypes.ARGEO_REMOTE_REPOSITORY);
-       // repoNode.setProperty(ARGEO_URI, uri.getText());
-       // repoNode.setProperty(ARGEO_USER_ID, username.getText());
-       // repoNode.addMixin(NodeType.MIX_TITLE);
-       // repoNode.setProperty(Property.JCR_TITLE, name.getText());
-       // nodeSession.save();
-       // if (saveInKeyring.getSelection()) {
-       // String pwdPath = repoNode.getPath() + '/' + ARGEO_PASSWORD;
-       // keyring.set(pwdPath, password.getText().toCharArray());
-       // nodeSession.save();
-       // }
-       // MessageDialog.openInformation(getParentShell(),
-       // "Repository Added",
-       // "Remote repository " + uri.getText() + "' added");
-       //
-       // super.okPressed();
-       // } catch (Exception e) {
-       // ErrorFeedback.show("Cannot add remote repository", e);
-       // } finally {
-       // JcrUtils.logoutQuietly(nodeSession);
-       // }
-       // }
-       //
-       // /** Creates label and text. */
-       // protected Text createLT(Composite parent, String label, String initial) {
-       // new Label(parent, SWT.NONE).setText(label);
-       // Text text = new Text(parent, SWT.SINGLE | SWT.LEAD | SWT.BORDER);
-       // text.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-       // text.setText(initial);
-       // return text;
-       // }
-       //
-       // /** Creates label and check. */
-       // protected Button createLC(Composite parent, String label,
-       // Boolean initial) {
-       // new Label(parent, SWT.NONE).setText(label);
-       // Button check = new Button(parent, SWT.CHECK);
-       // check.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-       // check.setSelection(initial);
-       // return check;
-       // }
-       //
-       // protected Text createLP(Composite parent, String label) {
-       // new Label(parent, SWT.NONE).setText(label);
-       // Text text = new Text(parent, SWT.SINGLE | SWT.LEAD | SWT.BORDER
-       // | SWT.PASSWORD);
-       // text.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-       // return text;
-       // }
-       // }
 }
index b05571e340d700a69771b505487fc0bdd0f4bc1c..1dab10f45ac0dcf67209d11b588f3b9c89bbe23c 100644 (file)
@@ -34,15 +34,14 @@ import org.eclipse.jface.resource.ImageDescriptor;
 
 /**
  * Unregisters a remote repository by deleting the corresponding RepoNode from
- * the NodeRepository. It does not affect the repository instance
+ * the node Repository. It does not affect the repository instance
  */
-
 public class UnregisterRemoteRepo extends AbstractHandler {
        // private static final Log log = LogFactory
        // .getLog(UnregisterRemoteRepo.class);
+       
        public final static String ID = DistPlugin.ID + ".unregisterRemoteRepo";
-       public final static String DEFAULT_LABEL = "Unregister this repository";
-       // public final static String DEFAULT_ICON_PATH = "icons/removeItem.gif";
+       public final static String DEFAULT_LABEL = "Unregister";
        public final static ImageDescriptor DEFAULT_ICON = DistPlugin
                        .getImageDescriptor("icons/removeItem.gif");
 
index 0788f5703732a416fe35c4e45830caf10f813da6..0587cd72822edc58cf686119c78b69fc734e0a70 100644 (file)
@@ -14,7 +14,7 @@ import org.argeo.slc.repo.RepoUtils;
 import org.argeo.util.security.Keyring;
 
 /**
- * Provides shortcut to retrieve sessions, repositories and workspaces that are
+ * Provide shortcuts to retrieve sessions, repositories and workspaces that are
  * persisted in the current user node using path only.
  */
 public class DistSessionFactory {
index 5bfbc98a8630f55024d123b33c05b8716147269a..ca67024ffbbd6788ce330f0a328e0dc08b5bd464 100644 (file)
@@ -7,7 +7,7 @@ import org.argeo.slc.client.ui.dist.model.WorkspaceElem;
 import org.eclipse.jface.viewers.Viewer;
 import org.eclipse.jface.viewers.ViewerComparator;
 
-/** Specific behaviour to enhence Distribution tree browsers */
+/** Specific comparator to enhance Distribution tree browsers */
 public class DistTreeComparator extends ViewerComparator {
 
        public int category(Object element) {
index 61347b5ef3d50d732ee43aaa791722e694fb4e91..a62e01dcdbd01a542416b6bfad5f04e16f9db1b5 100644 (file)
@@ -27,7 +27,7 @@ import org.eclipse.jface.viewers.ITreeContentProvider;
 import org.eclipse.jface.viewers.Viewer;
 
 /**
- * Enables browsing in local and remote slc distribution repositories. Keyring
+ * Enables browsing in local and remote SLC software repositories. Keyring
  * and repository factory must be injected
  */
 public class DistTreeContentProvider implements ITreeContentProvider {
index 45fcfa16892ef1137e2d3406d8c16335b9bfb5b8..bfa97665856a8785cc41e82a8e26d2be53b74a0c 100644 (file)
@@ -10,7 +10,7 @@ import org.eclipse.jface.viewers.IDoubleClickListener;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.ui.PartInitException;
 
-/** Listen to double-clicks */
+/** Listen to double-clicks on the distributions view tree. */
 public class DistTreeDoubleClickListener implements IDoubleClickListener {
 
        public void doubleClick(DoubleClickEvent event) {
index 48afaec6ca8cf3d34ad63337a324e220b60beadf..583114a109041e8cb44d5c2bf12f77c585f61479 100644 (file)
@@ -58,15 +58,16 @@ import org.eclipse.ui.forms.editor.FormPage;
 import org.eclipse.ui.forms.widgets.ScrolledForm;
 
 /**
- * Exposes the various group id of a distribution as a tree.
+ * Expose Maven artifacts of a given workspace as a tree. Artifacts are grouped
+ * by Maven group.
  */
 public class ArtifactsBrowserPage extends FormPage implements DistConstants,
                RepoConstants {
-
-       final static String PAGE_ID = "artifactsBrowserPage";
        // private final static Log log = LogFactory
        // .getLog(ArtifactsBrowserPage.class);
 
+       final static String PAGE_ID = "artifactsBrowserPage";
+
        // Business object
        private Session session;
 
@@ -83,8 +84,6 @@ public class ArtifactsBrowserPage extends FormPage implements DistConstants,
                try {
                        ScrolledForm form = managedForm.getForm();
                        Composite parent = form.getBody();
-                       // Enable the different parts to fill the whole page when the tab is
-                       // maximized
                        parent.setLayout(new FillLayout());
                        createExportPackageSection(parent);
                        getEditor().getSite().setSelectionProvider(artifactTreeViewer);
index b9e7ab30662bd947fcf5e0b3820acb3015509895..c33cca469f7581d9e4147f76874b77e1159b2382 100644 (file)
@@ -64,9 +64,8 @@ import org.eclipse.ui.forms.widgets.ScrolledForm;
 import org.eclipse.ui.forms.widgets.Section;
 
 /**
- * Presents main information of a given OSGI bundle
+ * Present main information of a given OSGI bundle
  */
-
 public class BundleDetailsPage extends FormPage implements SlcNames, SlcTypes {
        // private final static Log log =
        // LogFactory.getLog(ArtifactDetailsPage.class);
@@ -109,7 +108,7 @@ public class BundleDetailsPage extends FormPage implements SlcNames, SlcTypes {
                }
        }
 
-       /** Add useful info for the current bundle */
+       /** Displays useful info for the current bundle */
        private void createdetailsPart(Composite parent) throws RepositoryException {
                Composite details = toolkit.createComposite(parent);
                GridLayout layout = new GridLayout(2, false);
@@ -122,7 +121,6 @@ public class BundleDetailsPage extends FormPage implements SlcNames, SlcTypes {
                createHyperlink(details, "Licence", DistConstants.SLC_BUNDLE_LICENCE);
                createField(details, "Vendor", DistConstants.SLC_BUNDLE_VENDOR);
                addSourceAvailableLabel(details);
-
        }
 
        // helper to check if sources are available
index bdbaf6831559b4117118f2205bee90e1fa3302c2..bd683478b7650ab5e0c58aab5673603c7ec5e18c 100644 (file)
@@ -29,7 +29,7 @@ import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.forms.editor.FormEditor;
 
 /**
- * Editor to browse, analyze and modify an OSGi distribution
+ * Browse, analyse and modify an OSGi distribution
  */
 public class DistributionEditor extends FormEditor implements SlcNames {
        // private final static Log log =
@@ -81,5 +81,4 @@ public class DistributionEditor extends FormEditor implements SlcNames {
        public boolean isSaveAsAllowed() {
                return false;
        }
-
-}
+}
\ No newline at end of file
index 3c27a960728b9135ba98f994b8a7fce9dc13a75e..1499bd5b75143925c1289f650bfc189446e6b7d3 100644 (file)
@@ -86,12 +86,13 @@ import org.eclipse.ui.forms.editor.FormPage;
 import org.eclipse.ui.forms.widgets.FormToolkit;
 import org.eclipse.ui.forms.widgets.ScrolledForm;
 
-/** Table giving an overview of an OSGi distribution with corresponding filters */
+/** Show all bundles contained in a given workspace as filter-able table */
 public class DistributionOverviewPage extends FormPage implements SlcNames {
-       final static String PAGE_ID = "distributionOverviewPage";
        // final private static Log log = LogFactory
        // .getLog(DistributionOverviewPage.class);
 
+       final static String PAGE_ID = "distributionOverviewPage";
+
        // Business Objects
        private Session session;
 
index 1274f7c83ddf1102d09fe39624ad32badbb98c0c..7429ed0caaa8e9a66defd343ff3573f67bdbfd1d 100644 (file)
@@ -26,14 +26,12 @@ import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.forms.editor.FormEditor;
 
 /**
- * 
- * Exposes a bundle and enable its management
- * 
+ * Expose a bundle and enable its management
  */
 public class GenericBundleEditor extends FormEditor {
-
        // private final static Log log =
        // LogFactory.getLog(GenericNodeEditor.class);
+
        public final static String ID = DistPlugin.ID + ".genericBundleEditor";
 
        // business objects
@@ -63,11 +61,6 @@ public class GenericBundleEditor extends FormEditor {
                }
        }
 
-       @Override
-       public void doSaveAs() {
-               // unused compulsory method
-       }
-
        @Override
        public void doSave(IProgressMonitor monitor) {
                try {
@@ -80,8 +73,14 @@ public class GenericBundleEditor extends FormEditor {
 
        }
 
+       // unused compulsory methods
        @Override
        public boolean isSaveAsAllowed() {
-               return true;
+               return false;
        }
-}
+
+       @Override
+       public void doSaveAs() {
+       }
+
+}
\ No newline at end of file
index e0d24c35b9209b026489d5b344a1267d4a29974e..fb9412e9b598ebede1c7d7bd3afffd06d5f82781 100644 (file)
@@ -26,13 +26,12 @@ import org.eclipse.ui.IPersistableElement;
 
 /**
  * An editor input based the JCR node object.
- * */
-
+ */
 public class GenericBundleEditorInput implements IEditorInput, SlcNames {
 
        private final Node artifactNode;
-       // cache key properties at creation time to avoid Exception at recovering time
-       // when the session has been closed
+       // cache key properties at creation time to avoid Exception at recovering
+       // time when the session has been closed
        private String artifactId;
        private String groupId;
        private String version;
index bec66da3f0e86ff6f0b6909066b7e4310495ac76..908aff571be7285c915bd833f9a09addec45e19c 100644 (file)
@@ -261,6 +261,16 @@ public class DistributionsView extends ViewPart implements SlcNames, ArgeoNames
                                if (ici != null)
                                        menuManager.remove(ici);
 
+                               // Publish workspace
+                               params = new HashMap<String, String>();
+                               params.put(PublishWorkspace.PARAM_TARGET_REPO_PATH,
+                                               targetRepoPath);
+                               params.put(PublishWorkspace.PARAM_WORKSPACE_NAME, workspaceName);
+                               CommandUtils.refreshParametrizedCommand(submenu, window,
+                                               PublishWorkspace.ID, PublishWorkspace.DEFAULT_LABEL,
+                                               PublishWorkspace.DEFAULT_ICON, isDistribElem
+                                                               && singleElement && !isReadOnly, params);
+                               
                                // Normalize distribution (Legacy)
                                params = new HashMap<String, String>();
                                params.put(NormalizeDistribution.PARAM_TARGET_REPO_PATH,
@@ -273,15 +283,7 @@ public class DistributionsView extends ViewPart implements SlcNames, ArgeoNames
                                                NormalizeDistribution.DEFAULT_ICON, isDistribElem
                                                                && singleElement && !isReadOnly, params);
 
-                               // publish workspace
-                               params = new HashMap<String, String>();
-                               params.put(PublishWorkspace.PARAM_TARGET_REPO_PATH,
-                                               targetRepoPath);
-                               params.put(PublishWorkspace.PARAM_WORKSPACE_NAME, workspaceName);
-                               CommandUtils.refreshParametrizedCommand(submenu, window,
-                                               PublishWorkspace.ID, PublishWorkspace.DEFAULT_LABEL,
-                                               PublishWorkspace.DEFAULT_ICON, isDistribElem
-                                                               && singleElement && !isReadOnly, params);
+                       
 
                                if (submenu.getSize() > 0)
                                        menuManager.add(submenu);