+ Add a source available check box to the bundle details page
+ fix an hard coded reference in JcrExecutionModulesView
git-svn-id: https://svn.argeo.org/slc/trunk@6157
4cfe0d0a-d680-48aa-b62c-
e0a02a3f76cc
</command>
-->
</menuContribution>
</command>
-->
</menuContribution>
+ <menuContribution
+ locationURI="toolbar:org.argeo.slc.client.ui.dist.anonymousDistributionsView">
+ <command
+ commandId="org.argeo.slc.client.ui.dist.refreshDistributionsView"
+ icon="icons/refresh.png"
+ label="Refresh"
+ tooltip="Refresh distributions view">
+ </command>
+ </menuContribution>
<!-- Queries -->
<!-- <menuContribution
allPopups="false"
<!-- Queries -->
<!-- <menuContribution
allPopups="false"
JcrUtils.addPrivilege(session, "/", publicRole,
Privilege.JCR_READ);
session.save();
JcrUtils.addPrivilege(session, "/", publicRole,
Privilege.JCR_READ);
session.save();
JcrUtils.logoutQuietly(session);
// CommandHelpers.callCommand(RefreshDistributionsView.ID);
}
JcrUtils.logoutQuietly(session);
// CommandHelpers.callCommand(RefreshDistributionsView.ID);
}
package org.argeo.slc.client.ui.dist.commands;
import org.argeo.slc.client.ui.dist.DistPlugin;
package org.argeo.slc.client.ui.dist.commands;
import org.argeo.slc.client.ui.dist.DistPlugin;
+import org.argeo.slc.client.ui.dist.views.AnonymousDistributionsView;
import org.argeo.slc.client.ui.dist.views.DistributionsView;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.argeo.slc.client.ui.dist.views.DistributionsView;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
.getActiveWorkbenchWindow().getActivePage().getActivePart();
if (activePart instanceof DistributionsView)
((DistributionsView) activePart).refresh();
.getActiveWorkbenchWindow().getActivePage().getActivePart();
if (activePart instanceof DistributionsView)
((DistributionsView) activePart).refresh();
+ else if (activePart instanceof AnonymousDistributionsView)
+ ((AnonymousDistributionsView) activePart).refresh();
import org.argeo.slc.client.ui.dist.utils.AbstractHyperlinkListener;
import org.argeo.slc.jcr.SlcNames;
import org.argeo.slc.jcr.SlcTypes;
import org.argeo.slc.client.ui.dist.utils.AbstractHyperlinkListener;
import org.argeo.slc.jcr.SlcNames;
import org.argeo.slc.jcr.SlcTypes;
+import org.argeo.slc.repo.RepoConstants;
+import org.argeo.slc.repo.RepoUtils;
import org.eclipse.jface.viewers.ColumnLabelProvider;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.ColumnLabelProvider;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.Text;
createField(details, "Symbolic name", SlcNames.SLC_SYMBOLIC_NAME);
createField(details, "Version", SlcNames.SLC_BUNDLE_VERSION);
createField(details, "Group Id", SlcNames.SLC_GROUP_ID);
createField(details, "Symbolic name", SlcNames.SLC_SYMBOLIC_NAME);
createField(details, "Version", SlcNames.SLC_BUNDLE_VERSION);
createField(details, "Group Id", SlcNames.SLC_GROUP_ID);
- // Single sourcing issue: this does not works with rap
createHyperlink(details, "Licence", DistConstants.SLC_BUNDLE_LICENCE);
createHyperlink(details, "Licence", DistConstants.SLC_BUNDLE_LICENCE);
- // createField(details, "Licence", DistConstants.SLC_BUNDLE_LICENCE);
-
createField(details, "Vendor", DistConstants.SLC_BUNDLE_VENDOR);
createField(details, "Vendor", DistConstants.SLC_BUNDLE_VENDOR);
+ addSourceAvailableLabel(details);
+
+ }
+
+ // helper to check if sources are available
+ private void addSourceAvailableLabel(Composite parent) {
+ Button srcChk = toolkit.createButton(parent, "Sources available",
+ SWT.CHECK);
+ srcChk.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 2, 1));
+ try {
+ String srcPath = RepoUtils.relatedPdeSourcePath(
+ RepoConstants.DEFAULT_ARTIFACTS_BASE_PATH, currBundle);
+ srcChk.setSelection(currBundle.getSession().nodeExists(srcPath));
+ } catch (RepositoryException e) {
+ throw new SlcException("Unable to check sources", e);
+ }
+ srcChk.setEnabled(false);
}
// Workaround to add an artificial level to the export package browser
}
// Workaround to add an artificial level to the export package browser
ArgeoNames {
// private final static Log log = LogFactory
// .getLog(AnonymousDistributionsView.class);
ArgeoNames {
// private final static Log log = LogFactory
// .getLog(AnonymousDistributionsView.class);
- public final static String ID = DistPlugin.ID + ".anonymousDistributionsView";
+ public final static String ID = DistPlugin.ID
+ + ".anonymousDistributionsView";
/* DEPENDENCY INJECTION */
private ITreeContentProvider treeContentProvider;
/* DEPENDENCY INJECTION */
private ITreeContentProvider treeContentProvider;
* Force refresh of the whole view
*/
public void refresh() {
* Force refresh of the whole view
*/
public void refresh() {
+ Object[] ee = viewer.getExpandedElements();
viewer.setInput(DistConstants.DEFAULT_PUBLIC_REPOSITORY_URI);
viewer.setInput(DistConstants.DEFAULT_PUBLIC_REPOSITORY_URI);
- viewer.expandToLevel(2);
+ // viewer.expandToLevel(2);
+ viewer.setExpandedElements(ee);
import javax.jcr.query.QueryManager;
import org.argeo.ArgeoException;
import javax.jcr.query.QueryManager;
import org.argeo.ArgeoException;
-import org.argeo.eclipse.ui.ErrorFeedback;
import org.argeo.eclipse.ui.jcr.AsyncUiEventListener;
import org.argeo.jcr.JcrUtils;
import org.argeo.slc.SlcException;
import org.argeo.eclipse.ui.jcr.AsyncUiEventListener;
import org.argeo.jcr.JcrUtils;
import org.argeo.slc.SlcException;
-import org.argeo.slc.client.ui.ClientUiPlugin;
import org.argeo.slc.client.ui.SlcImages;
import org.argeo.slc.core.execution.PrimitiveAccessor;
import org.argeo.slc.core.execution.PrimitiveUtils;
import org.argeo.slc.client.ui.SlcImages;
import org.argeo.slc.core.execution.PrimitiveAccessor;
import org.argeo.slc.core.execution.PrimitiveUtils;
GridData valuedGd = new GridData(SWT.FILL, SWT.FILL, true, true);
// valuedGd.widthHint = 200;
valuesViewer.getTable().setLayoutData(valuedGd);
GridData valuedGd = new GridData(SWT.FILL, SWT.FILL, true, true);
// valuedGd.widthHint = 200;
valuesViewer.getTable().setLayoutData(valuedGd);
+ valuesViewer.getTable().setHeaderVisible(true);
+
valuesViewer.setContentProvider(new ValuesContentProvider());
initializeValuesViewer(valuesViewer);
sashForm.setWeights(getWeights());
valuesViewer.setContentProvider(new ValuesContentProvider());
initializeValuesViewer(valuesViewer);
sashForm.setWeights(getWeights());
}
return null;
} catch (RepositoryException e) {
}
return null;
} catch (RepositoryException e) {
- throw new SlcException("Cannot get celle editor", e);
+ throw new SlcException("Cannot get cell editor", e);
private final static Log log = LogFactory
.getLog(JcrExecutionModulesView.class);
private final static Log log = LogFactory
.getLog(JcrExecutionModulesView.class);
- public static final String ID = "org.argeo.slc.client.ui.jcrExecutionModulesView";
+ public static final String ID = ClientUiPlugin.ID
+ + ".jcrExecutionModulesView";
private TreeViewer viewer;
private TreeViewer viewer;