From: Bruno Sinou Date: Wed, 26 Feb 2014 14:23:38 +0000 (+0000) Subject: Clean: fix typos, update comments X-Git-Tag: argeo-slc-2.1.7~240 X-Git-Url: http://git.argeo.org/?a=commitdiff_plain;h=d19ee0fc60f905f0f33bbc7ab34da3659accb046;p=gpl%2Fargeo-slc.git Clean: fix typos, update comments git-svn-id: https://svn.argeo.org/slc/trunk@6858 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc --- diff --git a/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/commands/DisplayRepoInformation.java b/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/commands/DisplayRepoInformation.java index e5c733dfa..e439491c9 100644 --- a/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/commands/DisplayRepoInformation.java +++ b/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/commands/DisplayRepoInformation.java @@ -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"); diff --git a/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/commands/RefreshDistributionOverviewPage.java b/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/commands/RefreshDistributionOverviewPage.java index 90305390d..f78ede5b4 100644 --- a/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/commands/RefreshDistributionOverviewPage.java +++ b/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/commands/RefreshDistributionOverviewPage.java @@ -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 diff --git a/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/commands/RefreshDistributionsView.java b/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/commands/RefreshDistributionsView.java index f6af01788..b7d3ed680 100644 --- a/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/commands/RefreshDistributionsView.java +++ b/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/commands/RefreshDistributionsView.java @@ -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(); diff --git a/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/commands/RegisterRepository.java b/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/commands/RegisterRepository.java index 5a75c07cb..c044c59d8 100644 --- a/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/commands/RegisterRepository.java +++ b/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/commands/RegisterRepository.java @@ -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 params = new Hashtable(); - // 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; - // } - // } } diff --git a/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/commands/UnregisterRemoteRepo.java b/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/commands/UnregisterRemoteRepo.java index b05571e34..1dab10f45 100644 --- a/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/commands/UnregisterRemoteRepo.java +++ b/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/commands/UnregisterRemoteRepo.java @@ -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"); diff --git a/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/controllers/DistSessionFactory.java b/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/controllers/DistSessionFactory.java index 0788f5703..0587cd728 100644 --- a/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/controllers/DistSessionFactory.java +++ b/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/controllers/DistSessionFactory.java @@ -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 { diff --git a/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/controllers/DistTreeComparator.java b/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/controllers/DistTreeComparator.java index 5bfbc98a8..ca67024ff 100644 --- a/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/controllers/DistTreeComparator.java +++ b/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/controllers/DistTreeComparator.java @@ -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) { diff --git a/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/controllers/DistTreeContentProvider.java b/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/controllers/DistTreeContentProvider.java index 61347b5ef..a62e01dcd 100644 --- a/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/controllers/DistTreeContentProvider.java +++ b/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/controllers/DistTreeContentProvider.java @@ -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 { diff --git a/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/controllers/DistTreeDoubleClickListener.java b/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/controllers/DistTreeDoubleClickListener.java index 45fcfa168..bfa976658 100644 --- a/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/controllers/DistTreeDoubleClickListener.java +++ b/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/controllers/DistTreeDoubleClickListener.java @@ -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) { diff --git a/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/editors/ArtifactsBrowserPage.java b/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/editors/ArtifactsBrowserPage.java index 48afaec6c..583114a10 100644 --- a/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/editors/ArtifactsBrowserPage.java +++ b/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/editors/ArtifactsBrowserPage.java @@ -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); diff --git a/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/editors/BundleDetailsPage.java b/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/editors/BundleDetailsPage.java index b9e7ab306..c33cca469 100644 --- a/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/editors/BundleDetailsPage.java +++ b/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/editors/BundleDetailsPage.java @@ -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 diff --git a/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/editors/DistributionEditor.java b/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/editors/DistributionEditor.java index bdbaf6831..bd683478b 100644 --- a/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/editors/DistributionEditor.java +++ b/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/editors/DistributionEditor.java @@ -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 diff --git a/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/editors/DistributionOverviewPage.java b/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/editors/DistributionOverviewPage.java index 3c27a9607..1499bd5b7 100644 --- a/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/editors/DistributionOverviewPage.java +++ b/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/editors/DistributionOverviewPage.java @@ -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; diff --git a/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/editors/GenericBundleEditor.java b/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/editors/GenericBundleEditor.java index 1274f7c83..7429ed0ca 100644 --- a/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/editors/GenericBundleEditor.java +++ b/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/editors/GenericBundleEditor.java @@ -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 diff --git a/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/editors/GenericBundleEditorInput.java b/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/editors/GenericBundleEditorInput.java index e0d24c35b..fb9412e9b 100644 --- a/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/editors/GenericBundleEditorInput.java +++ b/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/editors/GenericBundleEditorInput.java @@ -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; diff --git a/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/views/DistributionsView.java b/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/views/DistributionsView.java index bec66da3f..908aff571 100644 --- a/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/views/DistributionsView.java +++ b/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/views/DistributionsView.java @@ -261,6 +261,16 @@ public class DistributionsView extends ViewPart implements SlcNames, ArgeoNames if (ici != null) menuManager.remove(ici); + // Publish workspace + params = new HashMap(); + 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(); 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(); - 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);