X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=org.argeo.suite.ui%2Fsrc%2Forg%2Fargeo%2Fsuite%2Fui%2FRecentItems.java;h=0ab37c5041fa1016cf9247ee21f80feb12428d9d;hb=a55bb0dc7e9fbcefb645d34ce24b326d1506a623;hp=09480ba5a226096d1e145665a1f21755cba8b9a6;hpb=d16d512082582d231d1cccc2b035fb41831f571b;p=gpl%2Fargeo-suite.git diff --git a/org.argeo.suite.ui/src/org/argeo/suite/ui/RecentItems.java b/org.argeo.suite.ui/src/org/argeo/suite/ui/RecentItems.java index 09480ba..0ab37c5 100644 --- a/org.argeo.suite.ui/src/org/argeo/suite/ui/RecentItems.java +++ b/org.argeo.suite.ui/src/org/argeo/suite/ui/RecentItems.java @@ -14,7 +14,6 @@ import javax.jcr.observation.EventListener; import javax.jcr.query.Query; import javax.jcr.query.QueryResult; -import org.argeo.api.NodeConstants; import org.argeo.cms.ui.CmsTheme; import org.argeo.cms.ui.CmsUiProvider; import org.argeo.cms.ui.CmsView; @@ -24,6 +23,7 @@ import org.argeo.connect.ui.util.BasicNodeListContentProvider; import org.argeo.connect.ui.widgets.DelayedText; import org.argeo.connect.util.XPathUtils; import org.argeo.eclipse.ui.EclipseUiUtils; +import org.argeo.entity.EntityConstants; import org.argeo.entity.EntityTypes; import org.argeo.jcr.Jcr; import org.argeo.jcr.JcrUtils; @@ -45,7 +45,6 @@ import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.TableColumn; import org.eclipse.swt.widgets.Text; @@ -63,20 +62,22 @@ public class RecentItems implements CmsUiProvider { public Control createUi(Composite parent, Node context) throws RepositoryException { theme = CmsTheme.getCmsTheme(parent); parent.setLayout(new GridLayout()); +// parent.setLayout(CmsUiUtils.noSpaceGridLayout()); + parent.setLayout(new GridLayout()); - Composite top = new Composite(parent, SWT.NONE); - CmsUiUtils.style(top, SuiteStyle.recentItems); - top.setLayoutData(CmsUiUtils.fillWidth()); - top.setLayout(CmsUiUtils.noSpaceGridLayout(2)); - Label lbl = new Label(top, SWT.NONE); - lbl.setLayoutData(CmsUiUtils.fillAll()); - lbl.setText(SuiteMsg.recentItems.lead()); - CmsUiUtils.style(lbl, SuiteStyle.recentItems); - - ToolBar topToolBar = new ToolBar(top, SWT.NONE); - ToolItem addItem = new ToolItem(topToolBar, SWT.FLAT); -// CmsUiUtils.style(addItem, SuiteStyle.recentItems); - addItem.setImage(SuiteIcon.add.getSmallIcon(theme)); +// Composite top = new Composite(parent, SWT.BORDER); +// CmsUiUtils.style(top, SuiteStyle.recentItems); +// top.setLayoutData(CmsUiUtils.fillWidth()); +// top.setLayout(CmsUiUtils.noSpaceGridLayout(2)); +// Label lbl = new Label(top, SWT.FLAT); +// lbl.setLayoutData(CmsUiUtils.fillWidth()); +// lbl.setText(SuiteMsg.recentItems.lead()); +// CmsUiUtils.style(lbl, SuiteStyle.recentItems); +// +// ToolBar topToolBar = new ToolBar(top, SWT.NONE); +// ToolItem addItem = new ToolItem(topToolBar, SWT.FLAT); +//// CmsUiUtils.style(addItem, SuiteStyle.recentItems); +// addItem.setImage(SuiteIcon.add.getSmallIcon(theme)); if (context == null) return null; @@ -93,7 +94,8 @@ public class RecentItems implements CmsUiProvider { deleteItem.setEnabled(false); // CmsUiUtils.style(deleteItem, SuiteStyle.recentItems); deleteItem.setImage(SuiteIcon.delete.getSmallIcon(theme)); - + ToolItem addItem = new ToolItem(bottomToolBar, SWT.FLAT); + addItem.setImage(SuiteIcon.add.getSmallIcon(theme)); entityViewer.getViewer().addDoubleClickListener(new IDoubleClickListener() { @Override @@ -123,7 +125,7 @@ public class RecentItems implements CmsUiProvider { } public void init(Map properties) { - entityType = properties.get(NodeConstants.DATA_TYPE); + entityType = properties.get(EntityConstants.TYPE); } class SingleEntityViewer { @@ -212,7 +214,8 @@ public class RecentItems implements CmsUiProvider { } protected TableViewer createListPart(Composite parent, ILabelProvider labelProvider) { - parent.setLayout(new GridLayout()); +// parent.setLayout(new GridLayout()); +// parent.setLayout(CmsUiUtils.noSpaceGridLayout()); Composite tableComposite = new Composite(parent, SWT.NONE); GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_VERTICAL