From: Mathieu Baudier Date: Mon, 12 Jun 2023 07:55:27 +0000 (+0200) Subject: Refactor UX X-Git-Tag: v2.3.15~25 X-Git-Url: http://git.argeo.org/?p=gpl%2Fargeo-suite.git;a=commitdiff_plain;h=e007028c81cf85df3c23b761856779427f86a633 Refactor UX --- diff --git a/org.argeo.app.core/OSGI-INF/l10n/bundle.properties b/org.argeo.app.core/OSGI-INF/l10n/bundle.properties new file mode 100644 index 0000000..d4bf08a --- /dev/null +++ b/org.argeo.app.core/OSGI-INF/l10n/bundle.properties @@ -0,0 +1,123 @@ +dashboard=dashboard +#people=contacts +documents=documents +locations=locations +recentItems=recent items + +appTitle=Argeo Suite + +# +# PEOPLE +# org.argeo.people.ui.PeopleMsg +# +person=person +user=user +org=organisation +group=group + +# NewPersonWizard +firstName=First Name +lastName=Last Name +salutation=Salutation +email=Email +personWizardWindowTitle=New person +personWizardPageTitle=Create a contact +personWizardFeedback=Contact was created + +# NewOrgWizard +legalName=Legal name +legalForm=Legal form +vatId=VAT ID +orgWizardWindowTitle=New organisation +orgWizardPageTitle=Create an organisation +orgWizardFeedback=Organisation was created + +# Roles +userAdminRole=Can create users and modify them +groupAdminRole=Can create groups and organisations and modify them +publisherRole=Can validate and publish content +coworkerRole=Is an active user of the organisation + +# Group +chooseAMember=Choose a member + +# ContextAddressComposite +chooseAnOrganisation=Choose an organisation +street=Street +streetComplement=Street complement +zipCode=Zip code +city=City +state=State +country=Country +geopoint=Geopoint + +# FilteredOrderableEntityTable +filterHelp=Type filter criterion separated by a space + +# BankAccountComposite +accountHolder=Account holder +bankName=Bank name +currency=Currency +accountNumber=Account number +bankNumber=Bank number +BIC=BIC +IBAN=IBAN + +# EditJobDialog +position=Role +chosenItem=Chose item +department=Department +isPrimary=Is primary +searchAndChooseEntity=Search and choose a corresponding entity + +# ContactListCTab (e4) +notes=Notes +addAContact=Add a contact +contactValue=Contact value +linkedCompany=Linked company + +# OrgAdminInfoCTab (e4) +paymentAccount=Payment account + +# OrgEditor (e4) +orgDetails=Details +orgActivityLog=Activity log +team=Team +orgAdmin=Admin. + +# PersonEditor (e4) +personDetails=Contact details +personActivityLog=Activity log +personOrgs=Organisations +personSecurity=Security + +# PersonSecurityCTab (e4) +resetPassword=Reset password + +# Generic +label=Label +aCustomLabel=A custom label +description=Description +value=Value +name=Name +primary=Primary +add=Add +save=Save +pickUp=Pick up + +# Tags +confirmNewTag=Tag #{0} is not yet registered. Are you sure you want to create it? +cannotCreateTag=Tag #{0} is not yet registered and you don't have enough rights to create it. + +# People +people=people + +# Library +content=content + +# Geo +map=map + +# Feedback messages +allFieldsMustBeSet=All fields must be set + diff --git a/org.argeo.app.core/OSGI-INF/l10n/bundle_de.properties b/org.argeo.app.core/OSGI-INF/l10n/bundle_de.properties new file mode 100644 index 0000000..0af19c2 --- /dev/null +++ b/org.argeo.app.core/OSGI-INF/l10n/bundle_de.properties @@ -0,0 +1,98 @@ +dashboard=dashboard +people=Kontakte +documents=Dokumente +locations=Orte +recentItems=neulich + +appTitle=Argeo Suite + +# +# PEOPLE +# org.argeo.people.ui.PeopleMsg +# +person=Person +organisation=Organisation + +# NewPersonWizard +firstName=Vorname +lastName=Nachname +salutation=Salutation +email=E-Mail +personWizardWindowTitle=Neue Person +personWizardPageTitle=Kontakt erstellen + +# NewOrgWizard +legalName=Name +legalForm=Geschäftsform +vatId=Ust ID +orgWizardWindowTitle=Neue Organisation +orgWizardPageTitle=Organisation erstellen + + +# ContextAddressComposite +chooseAnOrganisation=Organisation wählen +street=Strasse +streetComplement=Strasse Zusatz +zipCode=PLZ +city=Stadt +state=Bundesland +country=Land +geopoint=Geopoint + +# FilteredOrderableEntityTable +filterHelp=Type filter criterion separated by a space + +# BankAccountComposite +accountHolder=Kontoinhaber +bankName=Name der Bank +currency=Währung +accountNumber=Kontonummer +bankNumber=BLZ +BIC=BIC +IBAN=IBAN + +# EditJobDialog +position=Rolle +chosenItem=Auswahl +department=Abteilung +isPrimary=Ist Primär +searchAndChooseEntity=Suche und wähle ein zugehöriges Objekt + +# ContactListCTab (e4) +notes=Bemerkungen +addAContact=Kontakt hinzufügen +contactValue=Kontakt value +linkedCompany=zugehörige Firma + +# OrgAdminInfoCTab (e4) +paymentAccount=Geschäftskonto + +# OrgEditor (e4) +orgDetails=Details +orgActivityLog=Aktivitäten Log +team=Team +orgAdmin=Admin. + +# PersonEditor (e4) +personDetails=Kontakt Daten +personActivityLog=Aktivitäten Log +personOrgs=Organisationen +personSecurity=Sicherheit + +# PersonSecurityCTab (e4) +resetPassword=Passwort zurücksetzen + +# Generic +label=Beschriftung +aCustomLabel=Eine spezifische Beschriftung +description=Beschreibung +value=Wert +name=Name +primary=Haupt- +add=Hinzufügen +save=Speichern +pickUp=Aussuchen + +# Tags +confirmNewTag=Das Hashtag '{0}' existiert noch nicht. WollenSie es hinzufügen? +cannotCreateTag=Das Hashtag '{0}' existiert nicht uns Sie haben nicht die Rechte, um es hinzufügen. diff --git a/org.argeo.app.core/OSGI-INF/l10n/bundle_fr.properties b/org.argeo.app.core/OSGI-INF/l10n/bundle_fr.properties new file mode 100644 index 0000000..0015269 --- /dev/null +++ b/org.argeo.app.core/OSGI-INF/l10n/bundle_fr.properties @@ -0,0 +1,117 @@ +dashboard=dashboard +people=contacts +documents=documents +locations=lieux +recentItems=récent + +appTitle=Argeo Suite + +# +# GENERIC +# + +# +# PEOPLE +# org.argeo.people.ui.PeopleMsg +# +person=personne +user=utilisateur +org=organisation +group=groupe + +# NewPersonWizard +firstName=Prénom +lastName=Nom +salutation=Salutation +email=Email +personWizardWindowTitle=Nouvelle personne +personWizardPageTitle=Créer un contact +personWizardFeedback=Le contact a été créé + +# NewOrgWizard +legalName=Nom +legalForm=Forme légale +vatId=ID TVA +orgWizardWindowTitle=Nouvelle organisation +orgWizardPageTitle=Créer une organisation +orgWizardFeedback=L'organisation a été crée + +# Roles +userAdminRole=Peut créer des utilisateurs et les modifier +groupAdminRole=Peut créer des groupes et des organisations et les modifier +publisherRole=Peut publier et valider du contenu +coworkerRole=Est un membre en activité de l'organisation + +# Group +chooseAMember=Choisir un membre + +# ContextAddressComposite +chooseAnOrganisation=Choisir une organisation +street=Rue +streetComplement=Complément rue +zipCode=Code postal +city=Ville +state=État +country=Pays +geopoint=Géocoordonnées + +# FilteredOrderableEntityTable +filterHelp=Sasir les critères de filtrage séparés par des espaces + +# BankAccountComposite +accountHolder=Propriétaire du compte +bankName=Nom de la banque +currency=Devise +accountNumber=Numéro de compte +bankNumber=Numéro de banque +BIC=BIC +IBAN=IBAN + +# EditJobDialog +position=Rôle +chosenItem=Choisir une élément +department=Service +isPrimary=Principal +searchAndChooseEntity=Cherhcer et choisir l'entitée correspondante + +# ContactListCTab (e4) +notes=Notes +addAContact=Ajouter un contact +contactValue=Valeur +linkedCompany=Entreprise liée + +# OrgAdminInfoCTab (e4) +paymentAccount=Compte de paiement + +# OrgEditor (e4) +orgDetails=Détails +orgActivityLog=Activités +team=Équipe +orgAdmin=Admin. + +# PersonEditor (e4) +personDetails=Détails du contact +personActivityLog=Activités +personOrgs=Organisations +personSecurity=Accès + +# PersonSecurityCTab (e4) +resetPassword=Force le mot de passe + +# Generic +label=Étiquette +aCustomLabel=Une étiquette spécifique +description=Description +value=Valeur +name=Nom +primary=Principal +add=Ajouter +save=Sauver +pickUp=Choisir + +# Tags +confirmNewTag=Le tag #{0} n'existe pas encore. Voulez-vous le créer? +cannotCreateTag=Le tag #{0} n'existe pas encore et vous n'avez pas les droits pour le créer. + +# Feedback messages +allFieldsMustBeSet=Toutes les données doivent être renseignées diff --git a/org.argeo.app.core/src/org/argeo/app/ux/AbstractArgeoApp.java b/org.argeo.app.core/src/org/argeo/app/ux/AbstractArgeoApp.java new file mode 100644 index 0000000..2bb9c6a --- /dev/null +++ b/org.argeo.app.core/src/org/argeo/app/ux/AbstractArgeoApp.java @@ -0,0 +1,7 @@ +package org.argeo.app.ux; + +import org.argeo.cms.AbstractCmsApp; + +public abstract class AbstractArgeoApp extends AbstractCmsApp { + +} diff --git a/org.argeo.app.core/src/org/argeo/app/ux/SuiteIcon.java b/org.argeo.app.core/src/org/argeo/app/ux/SuiteIcon.java new file mode 100644 index 0000000..7ae9360 --- /dev/null +++ b/org.argeo.app.core/src/org/argeo/app/ux/SuiteIcon.java @@ -0,0 +1,22 @@ +package org.argeo.app.ux; + +import org.argeo.api.cms.ux.CmsIcon; + +/** Icon names used by Argeo Suite. */ +public enum SuiteIcon implements CmsIcon { + add, save, close, closeAll, search, delete, logout, dashboard, + // people + people, group, person, organisation, addressBook, users, organisationContact, + // library + documents, document, folder, + // management + report, + // admin and settings + settings, user, + // misc + task, tag, location, inbox, map, todo, + // actions + openUserMenu, + // + ; +} diff --git a/org.argeo.app.core/src/org/argeo/app/ux/SuiteMsg.java b/org.argeo.app.core/src/org/argeo/app/ux/SuiteMsg.java new file mode 100644 index 0000000..d244bd3 --- /dev/null +++ b/org.argeo.app.core/src/org/argeo/app/ux/SuiteMsg.java @@ -0,0 +1,45 @@ +package org.argeo.app.ux; + +import org.argeo.cms.Localized; + +/** Localized messages. */ +public enum SuiteMsg implements Localized { + // Entities + user, org, person, group, + // UI parts + dashboard, people, documents, locations, recentItems, + // NewPersonWizard + firstName, lastName, salutation, email, personWizardWindowTitle, personWizardPageTitle, personWizardFeedback, + // NewOrgWizard + orgWizardWindowTitle, orgWizardPageTitle, orgWizardFeedback, legalName, legalForm, vatId, + // Roles + userAdminRole, groupAdminRole, publisherRole, coworkerRole, + // Group + chooseAMember, + // ContextAddressComposite + chooseAnOrganisation, street, streetComplement, zipCode, city, state, country, geopoint, + // FilteredOrderableEntityTable + filterHelp, + // BankAccountComposite + accountHolder, bankName, currency, accountNumber, bankNumber, BIC, IBAN, + // EditJobDialog + position, chosenItem, department, isPrimary, searchAndChooseEntity, + // ContactListCTab (e4) + notes, addAContact, contactValue, linkedCompany, + // OrgAdminInfoCTab (e4) + paymentAccount, + // OrgEditor (e4) + orgDetails, orgActivityLog, team, orgAdmin, + // PersonEditor (e4) + personDetails, personActivityLog, personOrgs, personSecurity, + // PersonSecurityCTab (e4) + resetPassword, + // Generic + label, aCustomLabel, description, value, name, primary, add, save, pickup, + // Tag + confirmNewTag, cannotCreateTag, + // Feedback messages + allFieldsMustBeSet, + // + ; +} diff --git a/org.argeo.app.core/src/org/argeo/app/ux/SuiteStyle.java b/org.argeo.app.core/src/org/argeo/app/ux/SuiteStyle.java new file mode 100644 index 0000000..a115210 --- /dev/null +++ b/org.argeo.app.core/src/org/argeo/app/ux/SuiteStyle.java @@ -0,0 +1,35 @@ +package org.argeo.app.ux; + +import org.argeo.api.cms.ux.CmsStyle; + +/** Styles used by Argeo Suite work UI. */ +public enum SuiteStyle implements CmsStyle { + // header + header, headerTitle, headerMenu, headerMenuItem, + // footer + footer, + // recent items + recentItems, + // lead pane + leadPane, leadPaneItem, leadPaneSectionTitle, leadPaneSubSectionTitle, + // entry area + entryArea, + // group composite + titleContainer, titleLabel, subTitleLabel, formLine, formColumn, navigationBar, navigationTitle, navigationButton, + // forms elements + simpleLabel, simpleText, simpleInput, + // table + titleCell, + // layers + workArea, + // tabbed area + mainTabBody, mainTabSelected, mainTab, + // buttons + inlineButton; + + @Override + public String getClassPrefix() { + return "argeo-suite"; + } + +} diff --git a/org.argeo.app.core/src/org/argeo/app/ux/SuiteUxEvent.java b/org.argeo.app.core/src/org/argeo/app/ux/SuiteUxEvent.java new file mode 100644 index 0000000..4d690fd --- /dev/null +++ b/org.argeo.app.core/src/org/argeo/app/ux/SuiteUxEvent.java @@ -0,0 +1,34 @@ +package org.argeo.app.ux; + +import java.util.HashMap; +import java.util.Map; + +import org.argeo.api.acr.Content; +import org.argeo.api.cms.CmsEvent; + +/** Events specific to Argeo Suite UX. */ +public enum SuiteUxEvent implements CmsEvent { + openNewPart, refreshPart, switchLayer; + + public final static String LAYER = "layer"; + public final static String USERNAME = "username"; + + // ACR + public final static String CONTENT_PATH = "contentPath"; + + public String getTopicBase() { + return "argeo.suite.ui"; + } + + public static Map eventProperties(Content content) { + Map properties = new HashMap<>(); + properties.put(CONTENT_PATH, content.getPath()); + return properties; + } + +// public static Map eventProperties(User user) { +// Map properties = new HashMap<>(); +// properties.put(USERNAME, user.getName()); +// return properties; +// } +} diff --git a/swt/org.argeo.app.swt/src/org/argeo/app/swt/ux/DefaultEditionLayer.java b/swt/org.argeo.app.swt/src/org/argeo/app/swt/ux/DefaultEditionLayer.java new file mode 100644 index 0000000..fd5dca7 --- /dev/null +++ b/swt/org.argeo.app.swt/src/org/argeo/app/swt/ux/DefaultEditionLayer.java @@ -0,0 +1,317 @@ +package org.argeo.app.swt.ux; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import org.argeo.api.acr.Content; +import org.argeo.app.ux.SuiteIcon; +import org.argeo.app.ux.SuiteStyle; +import org.argeo.cms.Localized; +import org.argeo.cms.swt.CmsSwtTheme; +import org.argeo.cms.swt.CmsSwtUtils; +import org.argeo.cms.swt.acr.SwtTabbedArea; +import org.argeo.cms.swt.acr.SwtUiProvider; +import org.argeo.cms.util.LangUtils; +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.SashForm; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.osgi.framework.BundleContext; +import org.osgi.framework.Constants; +import org.osgi.framework.wiring.BundleWiring; + +/** An app layer based on an entry area and an editor area. */ +public class DefaultEditionLayer implements SwtAppLayer { + private String id; + private SwtUiProvider entryArea; + private SwtUiProvider defaultView; + private SwtUiProvider workArea; + private List weights = new ArrayList<>(); + private boolean startMaximized = false; + private boolean fixedEntryArea = false; + private boolean singleTab = false; + private Localized title = null; + private Localized singleTabTitle = null; + + @Override + public Control createUiPart(Composite parent, Content context) { + // TODO Factorize more, or split into more specialised classes? + if (entryArea != null) { + if (fixedEntryArea) { + FixedEditionArea editionArea = new FixedEditionArea(parent, parent.getStyle()); + Control entryAreaC = entryArea.createUiPart(editionArea.getEntryArea(), context); + CmsSwtUtils.style(entryAreaC, SuiteStyle.entryArea); + if (this.defaultView != null) { + editionArea.getTabbedArea().view(defaultView, context); + } + return editionArea; + } else { + SashFormEditionArea editionArea = new SashFormEditionArea(parent, parent.getStyle()); + entryArea.createUiPart(editionArea.getEntryArea(), context); + if (this.defaultView != null) { + editionArea.getTabbedArea().view(defaultView, context); + } + return editionArea; + } + } else { + if (this.workArea != null) { + Composite area = new Composite(parent, SWT.NONE); + this.workArea.createUiPart(area, context); + return area; + } + CmsSwtTheme theme = CmsSwtUtils.getCmsTheme(parent); + SwtTabbedArea tabbedArea = createTabbedArea(parent, theme); + return tabbedArea; + } + } + + @Override + public void view(SwtUiProvider uiProvider, Composite workAreaC, Content context) { + if (workArea != null) { + CmsSwtUtils.clear(workAreaC); + workArea.createUiPart(workAreaC, context); + workAreaC.layout(true, true); + return; + } + + // tabbed area + SwtTabbedArea tabbedArea = findTabbedArea(workAreaC); + if (tabbedArea == null) + throw new IllegalArgumentException("Unsupported work area " + workAreaC.getClass().getName()); + if (uiProvider == null) { + // reset + tabbedArea.closeAllTabs(); + if (this.defaultView != null) { + tabbedArea.view(defaultView, context); + } + } else { + tabbedArea.view(uiProvider, context); + } + } + + @Override + public Content getCurrentContext(Composite workArea) { + SwtTabbedArea tabbedArea = findTabbedArea(workArea); + if (tabbedArea == null) + return null; + return tabbedArea.getCurrentContext(); + } + + private SwtTabbedArea findTabbedArea(Composite workArea) { + SwtTabbedArea tabbedArea = null; + if (workArea instanceof SashFormEditionArea) { + tabbedArea = ((SashFormEditionArea) workArea).getTabbedArea(); + } else if (workArea instanceof FixedEditionArea) { + tabbedArea = ((FixedEditionArea) workArea).getTabbedArea(); + } else if (workArea instanceof SwtTabbedArea) { + tabbedArea = (SwtTabbedArea) workArea; + } + return tabbedArea; + } + + @Override + public void open(SwtUiProvider uiProvider, Composite workArea, Content context) { + SwtTabbedArea tabbedArea = ((SashFormEditionArea) workArea).getTabbedArea(); + tabbedArea.open(uiProvider, context); + } + + @Override + public Localized getTitle() { + return title; + } + + @Override + public String getId() { + return id; + } + + public void init(BundleContext bundleContext, Map properties) { + String pid = (String) properties.get(Constants.SERVICE_PID); + id = pid; + + weights = LangUtils.toStringList(properties.get(Property.weights.name())); + startMaximized = properties.containsKey(Property.startMaximized.name()) + && "true".equals(properties.get(Property.startMaximized.name())); + fixedEntryArea = properties.containsKey(Property.fixedEntryArea.name()) + && "true".equals(properties.get(Property.fixedEntryArea.name())); + if (fixedEntryArea && weights.size() != 0) { + throw new IllegalArgumentException("Property " + Property.weights.name() + " should not be set if property " + + Property.fixedEntryArea.name() + " is set."); + } + singleTab = properties.containsKey(Property.singleTab.name()) + && "true".equals(properties.get(Property.singleTab.name())); + + String titleStr = (String) properties.get(SwtAppLayer.Property.title.name()); + if (titleStr != null) { + if (titleStr.startsWith("%")) { + title = new Localized() { + + @Override + public String name() { + return titleStr; + } + + @Override + public ClassLoader getL10nClassLoader() { + return bundleContext != null + ? bundleContext.getBundle().adapt(BundleWiring.class).getClassLoader() + : getClass().getClassLoader(); + } + }; + } else { + title = new Localized.Untranslated(titleStr); + } + } + + String singleTabTitleStr = (String) properties.get(SwtAppLayer.Property.singleTabTitle.name()); + if (singleTabTitleStr != null) { + if (singleTabTitleStr.startsWith("%")) { + singleTabTitle = new Localized() { + + @Override + public String name() { + return singleTabTitleStr; + } + + @Override + public ClassLoader getL10nClassLoader() { + return bundleContext != null + ? bundleContext.getBundle().adapt(BundleWiring.class).getClassLoader() + : getClass().getClassLoader(); + } + }; + } else { + singleTabTitle = new Localized.Untranslated(singleTabTitleStr); + } + } + + } + + public void destroy(BundleContext bundleContext, Map properties) { + + } + + public void setEntryArea(SwtUiProvider entryArea) { + this.entryArea = entryArea; + } + + public void setWorkArea(SwtUiProvider workArea) { + this.workArea = workArea; + } + + public void setDefaultView(SwtUiProvider defaultView) { + this.defaultView = defaultView; + } + + SwtTabbedArea createTabbedArea(Composite parent, CmsSwtTheme theme) { + SwtTabbedArea tabbedArea = new SwtTabbedArea(parent, SWT.NONE); + tabbedArea.setSingleTab(singleTab); + if (singleTabTitle != null) + tabbedArea.setSingleTabTitle(singleTabTitle.lead()); + tabbedArea.setBodyStyle(SuiteStyle.mainTabBody.style()); + tabbedArea.setTabStyle(SuiteStyle.mainTab.style()); + tabbedArea.setTabSelectedStyle(SuiteStyle.mainTabSelected.style()); + tabbedArea.setCloseIcon(theme.getSmallIcon(SuiteIcon.close)); + tabbedArea.setLayoutData(CmsSwtUtils.fillAll()); + return tabbedArea; + } + +// /** A work area based on an entry area and and a tabbed area. */ + class SashFormEditionArea extends SashForm { + private static final long serialVersionUID = 2219125778722702618L; + private SwtTabbedArea tabbedArea; + private Composite entryC; + + SashFormEditionArea(Composite parent, int style) { + super(parent, SWT.HORIZONTAL); + CmsSwtTheme theme = CmsSwtUtils.getCmsTheme(parent); + + Composite editorC; + if (SWT.RIGHT_TO_LEFT == (style & SWT.RIGHT_TO_LEFT)) {// arabic, hebrew, etc. + editorC = new Composite(this, SWT.BORDER); + entryC = new Composite(this, SWT.BORDER); + } else { + entryC = new Composite(this, SWT.NONE); + editorC = new Composite(this, SWT.NONE); + } + + // sash form specific + if (weights.size() != 0) { + int[] actualWeight = new int[weights.size()]; + for (int i = 0; i < weights.size(); i++) { + actualWeight[i] = Integer.parseInt(weights.get(i)); + } + setWeights(actualWeight); + } else { + int[] actualWeights = new int[] { 3000, 7000 }; + setWeights(actualWeights); + } + if (startMaximized) + setMaximizedControl(editorC); + + GridLayout editorAreaLayout = CmsSwtUtils.noSpaceGridLayout(); +// editorAreaLayout.verticalSpacing = 0; +// editorAreaLayout.marginBottom = 0; +// editorAreaLayout.marginHeight = 0; +// editorAreaLayout.marginLeft = 0; +// editorAreaLayout.marginRight = 0; + editorC.setLayout(editorAreaLayout); + + tabbedArea = createTabbedArea(editorC, theme); + } + + SwtTabbedArea getTabbedArea() { + return tabbedArea; + } + + Composite getEntryArea() { + return entryC; + } + + } + + class FixedEditionArea extends Composite { + private static final long serialVersionUID = -5525672639277322465L; + private SwtTabbedArea tabbedArea; + private Composite entryC; + + public FixedEditionArea(Composite parent, int style) { + super(parent, style); + CmsSwtTheme theme = CmsSwtUtils.getCmsTheme(parent); + + setLayout(CmsSwtUtils.noSpaceGridLayout(2)); + + Composite editorC; + if (SWT.RIGHT_TO_LEFT == (style & SWT.RIGHT_TO_LEFT)) {// arabic, hebrew, etc. + editorC = new Composite(this, SWT.NONE); + entryC = new Composite(this, SWT.NONE); + } else { + entryC = new Composite(this, SWT.NONE); + editorC = new Composite(this, SWT.NONE); + } + entryC.setLayoutData(CmsSwtUtils.fillHeight()); + + GridLayout editorAreaLayout = CmsSwtUtils.noSpaceGridLayout(); +// editorAreaLayout.verticalSpacing = 0; +// editorAreaLayout.marginBottom = 0; +// editorAreaLayout.marginHeight = 0; +// editorAreaLayout.marginLeft = 0; +// editorAreaLayout.marginRight = 0; + editorC.setLayout(editorAreaLayout); + editorC.setLayoutData(CmsSwtUtils.fillAll()); + + tabbedArea = createTabbedArea(editorC, theme); + } + + SwtTabbedArea getTabbedArea() { + return tabbedArea; + } + + Composite getEntryArea() { + return entryC; + } + } + +} \ No newline at end of file diff --git a/swt/org.argeo.app.swt/src/org/argeo/app/swt/ux/SwtAppLayer.java b/swt/org.argeo.app.swt/src/org/argeo/app/swt/ux/SwtAppLayer.java new file mode 100644 index 0000000..e99d165 --- /dev/null +++ b/swt/org.argeo.app.swt/src/org/argeo/app/swt/ux/SwtAppLayer.java @@ -0,0 +1,27 @@ +package org.argeo.app.swt.ux; + +import org.argeo.api.acr.Content; +import org.argeo.cms.Localized; +import org.argeo.cms.swt.acr.SwtUiProvider; +import org.eclipse.swt.widgets.Composite; + +/** An UI layer for the main work area. */ +public interface SwtAppLayer extends SwtUiProvider { + static enum Property { + title, icon, weights, startMaximized, singleTab, singleTabTitle, fixedEntryArea; + } + + String getId(); + + void view(SwtUiProvider uiProvider, Composite workArea, Content context); + + Content getCurrentContext(Composite workArea); + + default void open(SwtUiProvider uiProvider, Composite workArea, Content context) { + view(uiProvider, workArea, context); + } + + default Localized getTitle() { + return null; + } +} diff --git a/swt/org.argeo.app.swt/src/org/argeo/app/swt/ux/SwtAppUi.java b/swt/org.argeo.app.swt/src/org/argeo/app/swt/ux/SwtAppUi.java new file mode 100644 index 0000000..a604fc0 --- /dev/null +++ b/swt/org.argeo.app.swt/src/org/argeo/app/swt/ux/SwtAppUi.java @@ -0,0 +1,224 @@ +package org.argeo.app.swt.ux; + +import java.util.HashMap; +import java.util.Map; + +import org.argeo.api.acr.Content; +import org.argeo.api.cms.CmsLog; +import org.argeo.app.ux.SuiteStyle; +import org.argeo.cms.Localized; +import org.argeo.cms.swt.CmsSwtUi; +import org.argeo.cms.swt.CmsSwtUtils; +import org.eclipse.swt.SWT; +import org.eclipse.swt.layout.FormLayout; +import org.eclipse.swt.widgets.Composite; + +/** The view for the default UX of Argeo Suite. */ +public class SwtAppUi extends CmsSwtUi { + private static final long serialVersionUID = 6207018859086689108L; + private final static CmsLog log = CmsLog.getLog(SwtAppUi.class); + + private Localized title; + private Composite header; + private Composite footer; + private Composite belowHeader; + private Composite leadPane; + private Composite sidePane; + private Composite dynamicArea; + + private Content userDir; + + private Map layers = new HashMap<>(); + private Map workAreas = new HashMap<>(); + private String currentLayerId = null; + + private boolean loginScreen = false; + + public SwtAppUi(Composite parent, int style) { + super(parent, style); + this.setLayout(CmsSwtUtils.noSpaceGridLayout()); + + header = new Composite(this, SWT.NONE); + header.setLayout(CmsSwtUtils.noSpaceGridLayout()); + CmsSwtUtils.style(header, SuiteStyle.header); + header.setLayoutData(CmsSwtUtils.fillWidth()); + + belowHeader = new Composite(this, SWT.NONE); + belowHeader.setLayoutData(CmsSwtUtils.fillAll()); + + footer = new Composite(this, SWT.NONE); + footer.setLayout(CmsSwtUtils.noSpaceGridLayout()); + CmsSwtUtils.style(footer, SuiteStyle.footer); + footer.setLayoutData(CmsSwtUtils.fillWidth()); + } + + public void refreshBelowHeader(boolean initApp) { + CmsSwtUtils.clear(belowHeader); + int style = getStyle(); + if (initApp) { + belowHeader.setLayout(CmsSwtUtils.noSpaceGridLayout(3)); + + if (SWT.RIGHT_TO_LEFT == (style & SWT.RIGHT_TO_LEFT)) {// arabic, hebrew, etc. + sidePane = new Composite(belowHeader, SWT.NONE); + sidePane.setLayout(CmsSwtUtils.noSpaceGridLayout()); + sidePane.setLayoutData(CmsSwtUtils.fillHeight()); + dynamicArea = new Composite(belowHeader, SWT.NONE); + leadPane = new Composite(belowHeader, SWT.NONE); + } else { + leadPane = new Composite(belowHeader, SWT.NONE); + dynamicArea = new Composite(belowHeader, SWT.NONE); + sidePane = new Composite(belowHeader, SWT.NONE); + sidePane.setLayout(CmsSwtUtils.noSpaceGridLayout()); + sidePane.setLayoutData(CmsSwtUtils.fillHeight()); + } + leadPane.setLayoutData(CmsSwtUtils.fillHeight()); + leadPane.setLayout(CmsSwtUtils.noSpaceGridLayout()); + CmsSwtUtils.style(leadPane, SuiteStyle.leadPane); + + dynamicArea.setLayoutData(CmsSwtUtils.fillAll()); + dynamicArea.setLayout(new FormLayout()); + + } else { + belowHeader.setLayout(CmsSwtUtils.noSpaceGridLayout()); + } + } + + /* + * LAYERS + */ + + public Composite getCurrentWorkArea() { + if (currentLayerId == null) + throw new IllegalStateException("No current layer"); + return workAreas.get(currentLayerId); + } + + public String getCurrentLayerId() { + return currentLayerId; + } + + private Composite getLayer(String id, Content context) { + if (!layers.containsKey(id)) + return null; + if (!workAreas.containsKey(id)) + initLayer(id, layers.get(id), context); + return workAreas.get(id); + } + + public Composite switchToLayer(String layerId, Content context) { + Composite current = null; + if (currentLayerId != null) { + current = getCurrentWorkArea(); + if (currentLayerId.equals(layerId)) + return current; + } + if (context == null) { + if (!getCmsView().isAnonymous()) + context = getUserDir(); + } + Composite toShow = getLayer(layerId, context); + if (toShow != null) { + currentLayerId = layerId; + if (!isDisposed()) { + if (!toShow.isDisposed()) { + toShow.moveAbove(null); + } else { + log.warn("Cannot show work area because it is disposed."); + toShow = initLayer(layerId, layers.get(layerId), context); + toShow.moveAbove(null); + } + dynamicArea.layout(true, true); + } + return toShow; + } else { + return current; + } + } + + public void switchToLayer(SwtAppLayer layer, Content context) { + // TODO make it more robust + for (String layerId : layers.keySet()) { + SwtAppLayer l = layers.get(layerId); + if (layer.getId().equals(l.getId())) { + switchToLayer(layerId, context); + return; + } + } + throw new IllegalArgumentException("Layer is not registered."); + } + + public void addLayer(String id, SwtAppLayer layer) { + layers.put(id, layer); + } + + public void removeLayer(String id) { + layers.remove(id); + if (workAreas.containsKey(id)) { + Composite workArea = workAreas.remove(id); + if (!workArea.isDisposed()) + workArea.dispose(); + } + } + + protected Composite initLayer(String id, SwtAppLayer layer, Content context) { + Composite workArea = getCmsView().doAs(() -> (Composite) layer.createUiPart(dynamicArea, context)); + CmsSwtUtils.style(workArea, SuiteStyle.workArea); + workArea.setLayoutData(CmsSwtUtils.coverAll()); + workAreas.put(id, workArea); + return workArea; + } + + public synchronized void logout() { + userDir = null; + currentLayerId = null; + workAreas.clear(); + } + + /* + * GETTERS / SETTERS + */ + + public Composite getHeader() { + return header; + } + + public Composite getFooter() { + return footer; + } + + public Composite getLeadPane() { + return leadPane; + } + + public Composite getSidePane() { + return sidePane; + } + + public Composite getBelowHeader() { + return belowHeader; + } + + public Content getUserDir() { + return userDir; + } + + public void setUserDir(Content userDir) { + this.userDir = userDir; + } + + public Localized getTitle() { + return title; + } + + public void setTitle(Localized title) { + this.title = title; + } + + public boolean isLoginScreen() { + return loginScreen; + } + + public void setLoginScreen(boolean loginScreen) { + this.loginScreen = loginScreen; + } +} diff --git a/swt/org.argeo.app.swt/src/org/argeo/app/swt/ux/SwtArgeoApp.java b/swt/org.argeo.app.swt/src/org/argeo/app/swt/ux/SwtArgeoApp.java new file mode 100644 index 0000000..733c0db --- /dev/null +++ b/swt/org.argeo.app.swt/src/org/argeo/app/swt/ux/SwtArgeoApp.java @@ -0,0 +1,34 @@ +package org.argeo.app.swt.ux; + +import java.util.Set; + +import org.argeo.api.cms.ux.CmsUi; +import org.argeo.app.ux.AbstractArgeoApp; + +public class SwtArgeoApp extends AbstractArgeoApp { + @Override + public Set getUiNames() { + // TODO Auto-generated method stub + return null; + } + + @Override + public CmsUi initUi(Object uiParent) { + // TODO Auto-generated method stub + return null; + } + + @Override + public void refreshUi(CmsUi cmsUi, String state) { + // TODO Auto-generated method stub + + } + + @Override + public void setState(CmsUi cmsUi, String state) { + // TODO Auto-generated method stub + + } + + +} diff --git a/swt/org.argeo.app.ui/OSGI-INF/adminLeadPane.xml b/swt/org.argeo.app.ui/OSGI-INF/adminLeadPane.xml index 8d69ead..306ad94 100644 --- a/swt/org.argeo.app.ui/OSGI-INF/adminLeadPane.xml +++ b/swt/org.argeo.app.ui/OSGI-INF/adminLeadPane.xml @@ -8,5 +8,5 @@ argeo.suite.ui.termsLayer - + diff --git a/swt/org.argeo.app.ui/OSGI-INF/cmsApp.xml b/swt/org.argeo.app.ui/OSGI-INF/cmsApp.xml index f9de1dd..a82f9af 100644 --- a/swt/org.argeo.app.ui/OSGI-INF/cmsApp.xml +++ b/swt/org.argeo.app.ui/OSGI-INF/cmsApp.xml @@ -7,7 +7,7 @@ - + diff --git a/swt/org.argeo.app.ui/OSGI-INF/contentLayer.xml b/swt/org.argeo.app.ui/OSGI-INF/contentLayer.xml index 7e56e47..9a550f4 100644 --- a/swt/org.argeo.app.ui/OSGI-INF/contentLayer.xml +++ b/swt/org.argeo.app.ui/OSGI-INF/contentLayer.xml @@ -1,8 +1,8 @@ - + - + diff --git a/swt/org.argeo.app.ui/OSGI-INF/dashboardLayer.xml b/swt/org.argeo.app.ui/OSGI-INF/dashboardLayer.xml index c8c6ac9..a62d6e5 100644 --- a/swt/org.argeo.app.ui/OSGI-INF/dashboardLayer.xml +++ b/swt/org.argeo.app.ui/OSGI-INF/dashboardLayer.xml @@ -1,8 +1,8 @@ - + - + diff --git a/swt/org.argeo.app.ui/OSGI-INF/l10n/bundle.properties b/swt/org.argeo.app.ui/OSGI-INF/l10n/bundle.properties index d4bf08a..8a9cc95 100644 --- a/swt/org.argeo.app.ui/OSGI-INF/l10n/bundle.properties +++ b/swt/org.argeo.app.ui/OSGI-INF/l10n/bundle.properties @@ -1,123 +1 @@ -dashboard=dashboard -#people=contacts -documents=documents -locations=locations -recentItems=recent items - -appTitle=Argeo Suite - -# -# PEOPLE -# org.argeo.people.ui.PeopleMsg -# -person=person -user=user -org=organisation -group=group - -# NewPersonWizard -firstName=First Name -lastName=Last Name -salutation=Salutation -email=Email -personWizardWindowTitle=New person -personWizardPageTitle=Create a contact -personWizardFeedback=Contact was created - -# NewOrgWizard -legalName=Legal name -legalForm=Legal form -vatId=VAT ID -orgWizardWindowTitle=New organisation -orgWizardPageTitle=Create an organisation -orgWizardFeedback=Organisation was created - -# Roles -userAdminRole=Can create users and modify them -groupAdminRole=Can create groups and organisations and modify them -publisherRole=Can validate and publish content -coworkerRole=Is an active user of the organisation - -# Group -chooseAMember=Choose a member - -# ContextAddressComposite -chooseAnOrganisation=Choose an organisation -street=Street -streetComplement=Street complement -zipCode=Zip code -city=City -state=State -country=Country -geopoint=Geopoint - -# FilteredOrderableEntityTable -filterHelp=Type filter criterion separated by a space - -# BankAccountComposite -accountHolder=Account holder -bankName=Bank name -currency=Currency -accountNumber=Account number -bankNumber=Bank number -BIC=BIC -IBAN=IBAN - -# EditJobDialog -position=Role -chosenItem=Chose item -department=Department -isPrimary=Is primary -searchAndChooseEntity=Search and choose a corresponding entity - -# ContactListCTab (e4) -notes=Notes -addAContact=Add a contact -contactValue=Contact value -linkedCompany=Linked company - -# OrgAdminInfoCTab (e4) -paymentAccount=Payment account - -# OrgEditor (e4) -orgDetails=Details -orgActivityLog=Activity log -team=Team -orgAdmin=Admin. - -# PersonEditor (e4) -personDetails=Contact details -personActivityLog=Activity log -personOrgs=Organisations -personSecurity=Security - -# PersonSecurityCTab (e4) -resetPassword=Reset password - -# Generic -label=Label -aCustomLabel=A custom label -description=Description -value=Value -name=Name -primary=Primary -add=Add -save=Save -pickUp=Pick up - -# Tags -confirmNewTag=Tag #{0} is not yet registered. Are you sure you want to create it? -cannotCreateTag=Tag #{0} is not yet registered and you don't have enough rights to create it. - -# People -people=people - -# Library -content=content - -# Geo -map=map - -# Feedback messages -allFieldsMustBeSet=All fields must be set - +people=People diff --git a/swt/org.argeo.app.ui/OSGI-INF/l10n/bundle_de.properties b/swt/org.argeo.app.ui/OSGI-INF/l10n/bundle_de.properties deleted file mode 100644 index 0af19c2..0000000 --- a/swt/org.argeo.app.ui/OSGI-INF/l10n/bundle_de.properties +++ /dev/null @@ -1,98 +0,0 @@ -dashboard=dashboard -people=Kontakte -documents=Dokumente -locations=Orte -recentItems=neulich - -appTitle=Argeo Suite - -# -# PEOPLE -# org.argeo.people.ui.PeopleMsg -# -person=Person -organisation=Organisation - -# NewPersonWizard -firstName=Vorname -lastName=Nachname -salutation=Salutation -email=E-Mail -personWizardWindowTitle=Neue Person -personWizardPageTitle=Kontakt erstellen - -# NewOrgWizard -legalName=Name -legalForm=Geschäftsform -vatId=Ust ID -orgWizardWindowTitle=Neue Organisation -orgWizardPageTitle=Organisation erstellen - - -# ContextAddressComposite -chooseAnOrganisation=Organisation wählen -street=Strasse -streetComplement=Strasse Zusatz -zipCode=PLZ -city=Stadt -state=Bundesland -country=Land -geopoint=Geopoint - -# FilteredOrderableEntityTable -filterHelp=Type filter criterion separated by a space - -# BankAccountComposite -accountHolder=Kontoinhaber -bankName=Name der Bank -currency=Währung -accountNumber=Kontonummer -bankNumber=BLZ -BIC=BIC -IBAN=IBAN - -# EditJobDialog -position=Rolle -chosenItem=Auswahl -department=Abteilung -isPrimary=Ist Primär -searchAndChooseEntity=Suche und wähle ein zugehöriges Objekt - -# ContactListCTab (e4) -notes=Bemerkungen -addAContact=Kontakt hinzufügen -contactValue=Kontakt value -linkedCompany=zugehörige Firma - -# OrgAdminInfoCTab (e4) -paymentAccount=Geschäftskonto - -# OrgEditor (e4) -orgDetails=Details -orgActivityLog=Aktivitäten Log -team=Team -orgAdmin=Admin. - -# PersonEditor (e4) -personDetails=Kontakt Daten -personActivityLog=Aktivitäten Log -personOrgs=Organisationen -personSecurity=Sicherheit - -# PersonSecurityCTab (e4) -resetPassword=Passwort zurücksetzen - -# Generic -label=Beschriftung -aCustomLabel=Eine spezifische Beschriftung -description=Beschreibung -value=Wert -name=Name -primary=Haupt- -add=Hinzufügen -save=Speichern -pickUp=Aussuchen - -# Tags -confirmNewTag=Das Hashtag '{0}' existiert noch nicht. WollenSie es hinzufügen? -cannotCreateTag=Das Hashtag '{0}' existiert nicht uns Sie haben nicht die Rechte, um es hinzufügen. diff --git a/swt/org.argeo.app.ui/OSGI-INF/l10n/bundle_fr.properties b/swt/org.argeo.app.ui/OSGI-INF/l10n/bundle_fr.properties deleted file mode 100644 index 0015269..0000000 --- a/swt/org.argeo.app.ui/OSGI-INF/l10n/bundle_fr.properties +++ /dev/null @@ -1,117 +0,0 @@ -dashboard=dashboard -people=contacts -documents=documents -locations=lieux -recentItems=récent - -appTitle=Argeo Suite - -# -# GENERIC -# - -# -# PEOPLE -# org.argeo.people.ui.PeopleMsg -# -person=personne -user=utilisateur -org=organisation -group=groupe - -# NewPersonWizard -firstName=Prénom -lastName=Nom -salutation=Salutation -email=Email -personWizardWindowTitle=Nouvelle personne -personWizardPageTitle=Créer un contact -personWizardFeedback=Le contact a été créé - -# NewOrgWizard -legalName=Nom -legalForm=Forme légale -vatId=ID TVA -orgWizardWindowTitle=Nouvelle organisation -orgWizardPageTitle=Créer une organisation -orgWizardFeedback=L'organisation a été crée - -# Roles -userAdminRole=Peut créer des utilisateurs et les modifier -groupAdminRole=Peut créer des groupes et des organisations et les modifier -publisherRole=Peut publier et valider du contenu -coworkerRole=Est un membre en activité de l'organisation - -# Group -chooseAMember=Choisir un membre - -# ContextAddressComposite -chooseAnOrganisation=Choisir une organisation -street=Rue -streetComplement=Complément rue -zipCode=Code postal -city=Ville -state=État -country=Pays -geopoint=Géocoordonnées - -# FilteredOrderableEntityTable -filterHelp=Sasir les critères de filtrage séparés par des espaces - -# BankAccountComposite -accountHolder=Propriétaire du compte -bankName=Nom de la banque -currency=Devise -accountNumber=Numéro de compte -bankNumber=Numéro de banque -BIC=BIC -IBAN=IBAN - -# EditJobDialog -position=Rôle -chosenItem=Choisir une élément -department=Service -isPrimary=Principal -searchAndChooseEntity=Cherhcer et choisir l'entitée correspondante - -# ContactListCTab (e4) -notes=Notes -addAContact=Ajouter un contact -contactValue=Valeur -linkedCompany=Entreprise liée - -# OrgAdminInfoCTab (e4) -paymentAccount=Compte de paiement - -# OrgEditor (e4) -orgDetails=Détails -orgActivityLog=Activités -team=Équipe -orgAdmin=Admin. - -# PersonEditor (e4) -personDetails=Détails du contact -personActivityLog=Activités -personOrgs=Organisations -personSecurity=Accès - -# PersonSecurityCTab (e4) -resetPassword=Force le mot de passe - -# Generic -label=Étiquette -aCustomLabel=Une étiquette spécifique -description=Description -value=Valeur -name=Nom -primary=Principal -add=Ajouter -save=Sauver -pickUp=Choisir - -# Tags -confirmNewTag=Le tag #{0} n'existe pas encore. Voulez-vous le créer? -cannotCreateTag=Le tag #{0} n'existe pas encore et vous n'avez pas les droits pour le créer. - -# Feedback messages -allFieldsMustBeSet=Toutes les données doivent être renseignées diff --git a/swt/org.argeo.app.ui/OSGI-INF/leadPane.xml b/swt/org.argeo.app.ui/OSGI-INF/leadPane.xml index 7583aa1..a620438 100644 --- a/swt/org.argeo.app.ui/OSGI-INF/leadPane.xml +++ b/swt/org.argeo.app.ui/OSGI-INF/leadPane.xml @@ -11,5 +11,5 @@ argeo.library.ui.contentLayer argeo.people.ui.peopleLayer argeo.geo.ui.mapLayer - + diff --git a/swt/org.argeo.app.ui/OSGI-INF/mapLayer.xml b/swt/org.argeo.app.ui/OSGI-INF/mapLayer.xml index 1e72041..44f7a0e 100644 --- a/swt/org.argeo.app.ui/OSGI-INF/mapLayer.xml +++ b/swt/org.argeo.app.ui/OSGI-INF/mapLayer.xml @@ -1,9 +1,9 @@ - + - + diff --git a/swt/org.argeo.app.ui/OSGI-INF/peopleLayer.xml b/swt/org.argeo.app.ui/OSGI-INF/peopleLayer.xml index 95bc27d..a81391f 100644 --- a/swt/org.argeo.app.ui/OSGI-INF/peopleLayer.xml +++ b/swt/org.argeo.app.ui/OSGI-INF/peopleLayer.xml @@ -1,9 +1,9 @@ - + - + diff --git a/swt/org.argeo.app.ui/OSGI-INF/termsLayer.xml b/swt/org.argeo.app.ui/OSGI-INF/termsLayer.xml index a3ffef3..ecfea87 100644 --- a/swt/org.argeo.app.ui/OSGI-INF/termsLayer.xml +++ b/swt/org.argeo.app.ui/OSGI-INF/termsLayer.xml @@ -1,8 +1,8 @@ - + - + diff --git a/swt/org.argeo.app.ui/OSGI-INF/wwwLayer.xml b/swt/org.argeo.app.ui/OSGI-INF/wwwLayer.xml index dc316bd..7a419ca 100644 --- a/swt/org.argeo.app.ui/OSGI-INF/wwwLayer.xml +++ b/swt/org.argeo.app.ui/OSGI-INF/wwwLayer.xml @@ -1,9 +1,9 @@ - + - + diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/DefaultEditionLayer.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/DefaultEditionLayer.java deleted file mode 100644 index dfccbe2..0000000 --- a/swt/org.argeo.app.ui/src/org/argeo/app/ui/DefaultEditionLayer.java +++ /dev/null @@ -1,315 +0,0 @@ -package org.argeo.app.ui; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -import org.argeo.api.acr.Content; -import org.argeo.cms.Localized; -import org.argeo.cms.swt.CmsSwtTheme; -import org.argeo.cms.swt.CmsSwtUtils; -import org.argeo.cms.swt.acr.SwtTabbedArea; -import org.argeo.cms.swt.acr.SwtUiProvider; -import org.argeo.cms.util.LangUtils; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.SashForm; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.osgi.framework.BundleContext; -import org.osgi.framework.Constants; -import org.osgi.framework.wiring.BundleWiring; - -/** An app layer based on an entry area and an editor area. */ -public class DefaultEditionLayer implements SuiteLayer { - private String id; - private SwtUiProvider entryArea; - private SwtUiProvider defaultView; - private SwtUiProvider workArea; - private List weights = new ArrayList<>(); - private boolean startMaximized = false; - private boolean fixedEntryArea = false; - private boolean singleTab = false; - private Localized title = null; - private Localized singleTabTitle = null; - - @Override - public Control createUiPart(Composite parent, Content context) { - // TODO Factorize more, or split into more specialised classes? - if (entryArea != null) { - if (fixedEntryArea) { - FixedEditionArea editionArea = new FixedEditionArea(parent, parent.getStyle()); - Control entryAreaC = entryArea.createUiPart(editionArea.getEntryArea(), context); - CmsSwtUtils.style(entryAreaC, SuiteStyle.entryArea); - if (this.defaultView != null) { - editionArea.getTabbedArea().view(defaultView, context); - } - return editionArea; - } else { - SashFormEditionArea editionArea = new SashFormEditionArea(parent, parent.getStyle()); - entryArea.createUiPart(editionArea.getEntryArea(), context); - if (this.defaultView != null) { - editionArea.getTabbedArea().view(defaultView, context); - } - return editionArea; - } - } else { - if (this.workArea != null) { - Composite area = new Composite(parent, SWT.NONE); - this.workArea.createUiPart(area, context); - return area; - } - CmsSwtTheme theme = CmsSwtUtils.getCmsTheme(parent); - SwtTabbedArea tabbedArea = createTabbedArea(parent, theme); - return tabbedArea; - } - } - - @Override - public void view(SwtUiProvider uiProvider, Composite workAreaC, Content context) { - if (workArea != null) { - CmsSwtUtils.clear(workAreaC); - workArea.createUiPart(workAreaC, context); - workAreaC.layout(true, true); - return; - } - - // tabbed area - SwtTabbedArea tabbedArea = findTabbedArea(workAreaC); - if (tabbedArea == null) - throw new IllegalArgumentException("Unsupported work area " + workAreaC.getClass().getName()); - if (uiProvider == null) { - // reset - tabbedArea.closeAllTabs(); - if (this.defaultView != null) { - tabbedArea.view(defaultView, context); - } - } else { - tabbedArea.view(uiProvider, context); - } - } - - @Override - public Content getCurrentContext(Composite workArea) { - SwtTabbedArea tabbedArea = findTabbedArea(workArea); - if (tabbedArea == null) - return null; - return tabbedArea.getCurrentContext(); - } - - private SwtTabbedArea findTabbedArea(Composite workArea) { - SwtTabbedArea tabbedArea = null; - if (workArea instanceof SashFormEditionArea) { - tabbedArea = ((SashFormEditionArea) workArea).getTabbedArea(); - } else if (workArea instanceof FixedEditionArea) { - tabbedArea = ((FixedEditionArea) workArea).getTabbedArea(); - } else if (workArea instanceof SwtTabbedArea) { - tabbedArea = (SwtTabbedArea) workArea; - } - return tabbedArea; - } - - @Override - public void open(SwtUiProvider uiProvider, Composite workArea, Content context) { - SwtTabbedArea tabbedArea = ((SashFormEditionArea) workArea).getTabbedArea(); - tabbedArea.open(uiProvider, context); - } - - @Override - public Localized getTitle() { - return title; - } - - @Override - public String getId() { - return id; - } - - public void init(BundleContext bundleContext, Map properties) { - String pid = (String) properties.get(Constants.SERVICE_PID); - id = pid; - - weights = LangUtils.toStringList(properties.get(Property.weights.name())); - startMaximized = properties.containsKey(Property.startMaximized.name()) - && "true".equals(properties.get(Property.startMaximized.name())); - fixedEntryArea = properties.containsKey(Property.fixedEntryArea.name()) - && "true".equals(properties.get(Property.fixedEntryArea.name())); - if (fixedEntryArea && weights.size() != 0) { - throw new IllegalArgumentException("Property " + Property.weights.name() + " should not be set if property " - + Property.fixedEntryArea.name() + " is set."); - } - singleTab = properties.containsKey(Property.singleTab.name()) - && "true".equals(properties.get(Property.singleTab.name())); - - String titleStr = (String) properties.get(SuiteLayer.Property.title.name()); - if (titleStr != null) { - if (titleStr.startsWith("%")) { - title = new Localized() { - - @Override - public String name() { - return titleStr; - } - - @Override - public ClassLoader getL10nClassLoader() { - return bundleContext != null - ? bundleContext.getBundle().adapt(BundleWiring.class).getClassLoader() - : getClass().getClassLoader(); - } - }; - } else { - title = new Localized.Untranslated(titleStr); - } - } - - String singleTabTitleStr = (String) properties.get(SuiteLayer.Property.singleTabTitle.name()); - if (singleTabTitleStr != null) { - if (singleTabTitleStr.startsWith("%")) { - singleTabTitle = new Localized() { - - @Override - public String name() { - return singleTabTitleStr; - } - - @Override - public ClassLoader getL10nClassLoader() { - return bundleContext != null - ? bundleContext.getBundle().adapt(BundleWiring.class).getClassLoader() - : getClass().getClassLoader(); - } - }; - } else { - singleTabTitle = new Localized.Untranslated(singleTabTitleStr); - } - } - - } - - public void destroy(BundleContext bundleContext, Map properties) { - - } - - public void setEntryArea(SwtUiProvider entryArea) { - this.entryArea = entryArea; - } - - public void setWorkArea(SwtUiProvider workArea) { - this.workArea = workArea; - } - - public void setDefaultView(SwtUiProvider defaultView) { - this.defaultView = defaultView; - } - - SwtTabbedArea createTabbedArea(Composite parent, CmsSwtTheme theme) { - SwtTabbedArea tabbedArea = new SwtTabbedArea(parent, SWT.NONE); - tabbedArea.setSingleTab(singleTab); - if (singleTabTitle != null) - tabbedArea.setSingleTabTitle(singleTabTitle.lead()); - tabbedArea.setBodyStyle(SuiteStyle.mainTabBody.style()); - tabbedArea.setTabStyle(SuiteStyle.mainTab.style()); - tabbedArea.setTabSelectedStyle(SuiteStyle.mainTabSelected.style()); - tabbedArea.setCloseIcon(theme.getSmallIcon(SuiteIcon.close)); - tabbedArea.setLayoutData(CmsSwtUtils.fillAll()); - return tabbedArea; - } - -// /** A work area based on an entry area and and a tabbed area. */ - class SashFormEditionArea extends SashForm { - private static final long serialVersionUID = 2219125778722702618L; - private SwtTabbedArea tabbedArea; - private Composite entryC; - - SashFormEditionArea(Composite parent, int style) { - super(parent, SWT.HORIZONTAL); - CmsSwtTheme theme = CmsSwtUtils.getCmsTheme(parent); - - Composite editorC; - if (SWT.RIGHT_TO_LEFT == (style & SWT.RIGHT_TO_LEFT)) {// arabic, hebrew, etc. - editorC = new Composite(this, SWT.BORDER); - entryC = new Composite(this, SWT.BORDER); - } else { - entryC = new Composite(this, SWT.NONE); - editorC = new Composite(this, SWT.NONE); - } - - // sash form specific - if (weights.size() != 0) { - int[] actualWeight = new int[weights.size()]; - for (int i = 0; i < weights.size(); i++) { - actualWeight[i] = Integer.parseInt(weights.get(i)); - } - setWeights(actualWeight); - } else { - int[] actualWeights = new int[] { 3000, 7000 }; - setWeights(actualWeights); - } - if (startMaximized) - setMaximizedControl(editorC); - - GridLayout editorAreaLayout = CmsSwtUtils.noSpaceGridLayout(); -// editorAreaLayout.verticalSpacing = 0; -// editorAreaLayout.marginBottom = 0; -// editorAreaLayout.marginHeight = 0; -// editorAreaLayout.marginLeft = 0; -// editorAreaLayout.marginRight = 0; - editorC.setLayout(editorAreaLayout); - - tabbedArea = createTabbedArea(editorC, theme); - } - - SwtTabbedArea getTabbedArea() { - return tabbedArea; - } - - Composite getEntryArea() { - return entryC; - } - - } - - class FixedEditionArea extends Composite { - private static final long serialVersionUID = -5525672639277322465L; - private SwtTabbedArea tabbedArea; - private Composite entryC; - - public FixedEditionArea(Composite parent, int style) { - super(parent, style); - CmsSwtTheme theme = CmsSwtUtils.getCmsTheme(parent); - - setLayout(CmsSwtUtils.noSpaceGridLayout(2)); - - Composite editorC; - if (SWT.RIGHT_TO_LEFT == (style & SWT.RIGHT_TO_LEFT)) {// arabic, hebrew, etc. - editorC = new Composite(this, SWT.NONE); - entryC = new Composite(this, SWT.NONE); - } else { - entryC = new Composite(this, SWT.NONE); - editorC = new Composite(this, SWT.NONE); - } - entryC.setLayoutData(CmsSwtUtils.fillHeight()); - - GridLayout editorAreaLayout = CmsSwtUtils.noSpaceGridLayout(); -// editorAreaLayout.verticalSpacing = 0; -// editorAreaLayout.marginBottom = 0; -// editorAreaLayout.marginHeight = 0; -// editorAreaLayout.marginLeft = 0; -// editorAreaLayout.marginRight = 0; - editorC.setLayout(editorAreaLayout); - editorC.setLayoutData(CmsSwtUtils.fillAll()); - - tabbedArea = createTabbedArea(editorC, theme); - } - - SwtTabbedArea getTabbedArea() { - return tabbedArea; - } - - Composite getEntryArea() { - return entryC; - } - } - -} \ No newline at end of file diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/DefaultHeader.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/DefaultHeader.java index 9231f4a..ede28d1 100644 --- a/swt/org.argeo.app.ui/src/org/argeo/app/ui/DefaultHeader.java +++ b/swt/org.argeo.app.ui/src/org/argeo/app/ui/DefaultHeader.java @@ -4,6 +4,8 @@ import java.util.Map; import org.argeo.api.acr.Content; import org.argeo.api.cms.ux.CmsView; +import org.argeo.app.ux.SuiteIcon; +import org.argeo.app.ux.SuiteStyle; import org.argeo.cms.CurrentUser; import org.argeo.cms.Localized; import org.argeo.cms.swt.CmsSwtTheme; diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/DefaultLeadPane.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/DefaultLeadPane.java index 0f3fb2e..9a2faf5 100644 --- a/swt/org.argeo.app.ui/src/org/argeo/app/ui/DefaultLeadPane.java +++ b/swt/org.argeo.app.ui/src/org/argeo/app/ui/DefaultLeadPane.java @@ -13,6 +13,9 @@ import org.argeo.api.cms.CmsLog; import org.argeo.api.cms.ux.CmsView; import org.argeo.app.api.RankedObject; import org.argeo.app.core.SuiteUtils; +import org.argeo.app.swt.ux.SwtAppLayer; +import org.argeo.app.ux.SuiteIcon; +import org.argeo.app.ux.SuiteStyle; import org.argeo.cms.CurrentUser; import org.argeo.cms.Localized; import org.argeo.cms.swt.CmsSwtUtils; @@ -35,7 +38,7 @@ public class DefaultLeadPane implements CmsUiProvider { defaultLayers, adminLayers; } - private Map> layers = Collections.synchronizedSortedMap(new TreeMap<>()); + private Map> layers = Collections.synchronizedSortedMap(new TreeMap<>()); private List defaultLayers; private List adminLayers = new ArrayList<>(); @@ -98,11 +101,11 @@ public class DefaultLeadPane implements CmsUiProvider { // if (intersection.isEmpty()) // continue layers;// skip unauthorized layer } - RankedObject layerObj = layers.get(layerId); + RankedObject layerObj = layers.get(layerId); Localized title = null; if (!adminLayers.contains(layerId)) { - String titleStr = (String) layerObj.getProperties().get(SuiteLayer.Property.title.name()); + String titleStr = (String) layerObj.getProperties().get(SwtAppLayer.Property.title.name()); if (titleStr != null) { if (titleStr.startsWith("%")) { // LocaleUtils.local(titleStr, getClass().getClassLoader()); @@ -113,7 +116,7 @@ public class DefaultLeadPane implements CmsUiProvider { } } - String iconName = (String) layerObj.getProperties().get(SuiteLayer.Property.icon.name()); + String iconName = (String) layerObj.getProperties().get(SwtAppLayer.Property.icon.name()); SuiteIcon icon = null; if (iconName != null) icon = SuiteIcon.valueOf(iconName); @@ -153,18 +156,18 @@ public class DefaultLeadPane implements CmsUiProvider { } - public void addLayer(SuiteLayer layer, Map properties) { + public void addLayer(SwtAppLayer layer, Map properties) { if (properties.containsKey(Constants.SERVICE_PID)) { String pid = (String) properties.get(Constants.SERVICE_PID); RankedObject.putIfHigherRank(layers, pid, layer, properties); } } - public void removeLayer(SuiteLayer layer, Map properties) { + public void removeLayer(SwtAppLayer layer, Map properties) { if (properties.containsKey(Constants.SERVICE_PID)) { String pid = (String) properties.get(Constants.SERVICE_PID); if (layers.containsKey(pid)) { - if (layers.get(pid).equals(new RankedObject(layer, properties))) { + if (layers.get(pid).equals(new RankedObject(layer, properties))) { layers.remove(pid); } } diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/RecentItems.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/RecentItems.java index 03927d4..e16b7d6 100644 --- a/swt/org.argeo.app.ui/src/org/argeo/app/ui/RecentItems.java +++ b/swt/org.argeo.app.ui/src/org/argeo/app/ui/RecentItems.java @@ -18,6 +18,8 @@ import javax.jcr.query.QueryResult; import org.argeo.app.api.EntityType; import org.argeo.app.core.XPathUtils; import org.argeo.app.ui.widgets.DelayedText; +import org.argeo.app.ux.SuiteIcon; +import org.argeo.app.ux.SuiteUxEvent; import org.argeo.cms.swt.CmsSwtTheme; import org.argeo.cms.swt.CmsSwtUtils; import org.argeo.cms.ui.CmsUiProvider; @@ -106,7 +108,7 @@ public class RecentItems implements CmsUiProvider { Node node = (Node) entityViewer.getViewer().getStructuredSelection().getFirstElement(); if (node != null) CmsSwtUtils.getCmsView(parent).sendEvent(SuiteUxEvent.openNewPart.topic(), - SuiteUxEvent.eventProperties(node)); + SuiteUiUtils.eventProperties(node)); } }); @@ -115,7 +117,7 @@ public class RecentItems implements CmsUiProvider { Node node = (Node) entityViewer.getViewer().getStructuredSelection().getFirstElement(); if (node != null) { CmsSwtUtils.getCmsView(parent).sendEvent(SuiteUxEvent.refreshPart.topic(), - SuiteUxEvent.eventProperties(node)); + SuiteUiUtils.eventProperties(node)); deleteItem.setEnabled(true); } else { deleteItem.setEnabled(false); diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/SuiteApp.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/SuiteApp.java index 3dc5007..854268c 100644 --- a/swt/org.argeo.app.ui/src/org/argeo/app/ui/SuiteApp.java +++ b/swt/org.argeo.app.ui/src/org/argeo/app/ui/SuiteApp.java @@ -34,6 +34,9 @@ import org.argeo.app.api.EntityNames; import org.argeo.app.api.EntityType; import org.argeo.app.api.RankedObject; import org.argeo.app.core.SuiteUtils; +import org.argeo.app.swt.ux.SwtAppUi; +import org.argeo.app.ux.SuiteUxEvent; +import org.argeo.app.swt.ux.SwtAppLayer; import org.argeo.cms.AbstractCmsApp; import org.argeo.cms.LocaleUtils; import org.argeo.cms.Localized; @@ -85,13 +88,13 @@ public class SuiteApp extends AbstractCmsApp implements CmsEventSubscriber { // TODO use QName as key for byType private Map> uiProvidersByPid = Collections.synchronizedMap(new HashMap<>()); private Map> uiProvidersByType = Collections.synchronizedMap(new HashMap<>()); - private Map> layersByPid = Collections.synchronizedSortedMap(new TreeMap<>()); - private Map> layersByType = Collections.synchronizedSortedMap(new TreeMap<>()); + private Map> layersByPid = Collections.synchronizedSortedMap(new TreeMap<>()); + private Map> layersByType = Collections.synchronizedSortedMap(new TreeMap<>()); private CmsUserManager cmsUserManager; // TODO make more optimal or via CmsSession/CmsView - private Map managedUis = new HashMap<>(); + private Map managedUis = new HashMap<>(); // ACR private ContentRepository contentRepository; @@ -134,7 +137,7 @@ public class SuiteApp extends AbstractCmsApp implements CmsEventSubscriber { } public void destroy(Map properties) { - for (SuiteUi ui : managedUis.values()) + for (SwtAppUi ui : managedUis.values()) if (!ui.isDisposed()) { ui.getDisplay().syncExec(() -> ui.dispose()); } @@ -162,7 +165,7 @@ public class SuiteApp extends AbstractCmsApp implements CmsEventSubscriber { CmsTheme theme = getTheme(uiName); if (theme != null) CmsSwtUtils.registerCmsTheme(uiParent.getShell(), theme); - SuiteUi argeoSuiteUi = new SuiteUi(uiParent, SWT.INHERIT_DEFAULT); + SwtAppUi argeoSuiteUi = new SwtAppUi(uiParent, SWT.INHERIT_DEFAULT); String uid = cmsView.getUid(); managedUis.put(uid, argeoSuiteUi); argeoSuiteUi.addDisposeListener((e) -> { @@ -185,7 +188,7 @@ public class SuiteApp extends AbstractCmsApp implements CmsEventSubscriber { public void refreshUi(CmsUi cmsUi, String state) { try { Content context = null; - SuiteUi ui = (SuiteUi) cmsUi; + SwtAppUi ui = (SwtAppUi) cmsUi; String uiName = Objects.toString(ui.getParent().getData(UI_NAME_PROPERTY), null); if (uiName == null) @@ -255,7 +258,7 @@ public class SuiteApp extends AbstractCmsApp implements CmsEventSubscriber { refreshPart(headerUiProvider, ui.getHeader(), context); ui.refreshBelowHeader(true); for (String key : layersByPid.keySet()) { - SuiteLayer layer = layersByPid.get(key).get(); + SwtAppLayer layer = layersByPid.get(key).get(); ui.addLayer(key, layer); } @@ -291,7 +294,7 @@ public class SuiteApp extends AbstractCmsApp implements CmsEventSubscriber { return uiProvidersByPid.get(pid).get(); } - private SuiteLayer findLayer(String pid) { + private SwtAppLayer findLayer(String pid) { if (!layersByPid.containsKey(pid)) return null; return layersByPid.get(pid).get(); @@ -401,8 +404,8 @@ public class SuiteApp extends AbstractCmsApp implements CmsEventSubscriber { if (state == null) return; if (!state.startsWith("/")) { - if (cmsUi instanceof SuiteUi) { - SuiteUi ui = (SuiteUi) cmsUi; + if (cmsUi instanceof SwtAppUi) { + SwtAppUi ui = (SwtAppUi) cmsUi; if (LOGIN.equals(state)) { String appTitle = ""; if (ui.getTitle() != null) @@ -418,7 +421,7 @@ public class SuiteApp extends AbstractCmsApp implements CmsEventSubscriber { } return; } - SuiteUi suiteUi = (SuiteUi) cmsUi; + SwtAppUi suiteUi = (SwtAppUi) cmsUi; if (suiteUi.isLoginScreen()) { return; } @@ -437,7 +440,7 @@ public class SuiteApp extends AbstractCmsApp implements CmsEventSubscriber { return node.getPath(); } - private Content stateToNode(SuiteUi suiteUi, String state) { + private Content stateToNode(SwtAppUi suiteUi, String state) { if (suiteUi == null) return null; if (state == null || !state.startsWith("/")) @@ -458,7 +461,7 @@ public class SuiteApp extends AbstractCmsApp implements CmsEventSubscriber { public void onEvent(String topic, Map event) { // Specific UI related events - SuiteUi ui = getRelatedUi(event); + SwtAppUi ui = getRelatedUi(event); if (ui == null) return; ui.getCmsView().runAs(() -> { @@ -472,7 +475,7 @@ public class SuiteApp extends AbstractCmsApp implements CmsEventSubscriber { if (node == null) return; SwtUiProvider uiProvider = findByType(uiProvidersByType, node); - SuiteLayer layer = findByType(layersByType, node); + SwtAppLayer layer = findByType(layersByType, node); ui.switchToLayer(layer, node); layer.view(uiProvider, ui.getCurrentWorkArea(), node); ui.getCmsView().stateChanged(nodeToState(node), appTitle + CmsUxUtils.getTitle(node)); @@ -481,14 +484,14 @@ public class SuiteApp extends AbstractCmsApp implements CmsEventSubscriber { if (node == null) return; SwtUiProvider uiProvider = findByType(uiProvidersByType, node); - SuiteLayer layer = findByType(layersByType, node); + SwtAppLayer layer = findByType(layersByType, node); ui.switchToLayer(layer, node); layer.open(uiProvider, ui.getCurrentWorkArea(), node); ui.getCmsView().stateChanged(nodeToState(node), appTitle + CmsUxUtils.getTitle(node)); } else if (SuiteUiUtils.isTopic(topic, SuiteUxEvent.switchLayer)) { String layerId = get(event, SuiteUxEvent.LAYER); if (layerId != null) { - SuiteLayer suiteLayer = findLayer(layerId); + SwtAppLayer suiteLayer = findLayer(layerId); if (suiteLayer == null) throw new IllegalArgumentException("No layer '" + layerId + "' available."); Localized layerTitle = suiteLayer.getTitle(); @@ -517,7 +520,7 @@ public class SuiteApp extends AbstractCmsApp implements CmsEventSubscriber { } else { Content node = getContentFromEvent(ui, event); if (node != null) { - SuiteLayer layer = findByType(layersByType, node); + SwtAppLayer layer = findByType(layersByType, node); ui.switchToLayer(layer, node); } } @@ -529,7 +532,7 @@ public class SuiteApp extends AbstractCmsApp implements CmsEventSubscriber { }); } - protected Content getContentFromEvent(SuiteUi ui, Map event) { + protected Content getContentFromEvent(SwtAppUi ui, Map event) { ProvidedSession contentSession = (ProvidedSession) CmsUxUtils.getContentSession(contentRepository, ui.getCmsView()); @@ -553,7 +556,7 @@ public class SuiteApp extends AbstractCmsApp implements CmsEventSubscriber { return node; } - private SuiteUi getRelatedUi(Map eventProperties) { + private SwtAppUi getRelatedUi(Map eventProperties) { return managedUis.get(get(eventProperties, CMS_VIEW_UID_PROPERTY)); } @@ -603,7 +606,7 @@ public class SuiteApp extends AbstractCmsApp implements CmsEventSubscriber { } } - public void addLayer(SuiteLayer layer, Map properties) { + public void addLayer(SwtAppLayer layer, Map properties) { if (properties.containsKey(Constants.SERVICE_PID)) { String pid = (String) properties.get(Constants.SERVICE_PID); RankedObject.putIfHigherRank(layersByPid, pid, layer, properties); @@ -615,11 +618,11 @@ public class SuiteApp extends AbstractCmsApp implements CmsEventSubscriber { } } - public void removeLayer(SuiteLayer layer, Map properties) { + public void removeLayer(SwtAppLayer layer, Map properties) { if (properties.containsKey(Constants.SERVICE_PID)) { String pid = (String) properties.get(Constants.SERVICE_PID); if (layersByPid.containsKey(pid)) { - if (layersByPid.get(pid).equals(new RankedObject(layer, properties))) { + if (layersByPid.get(pid).equals(new RankedObject(layer, properties))) { layersByPid.remove(pid); } } @@ -628,7 +631,7 @@ public class SuiteApp extends AbstractCmsApp implements CmsEventSubscriber { List types = LangUtils.toStringList(properties.get(EntityConstants.TYPE)); for (String type : types) { if (layersByType.containsKey(type)) { - if (layersByType.get(type).equals(new RankedObject(layer, properties))) { + if (layersByType.get(type).equals(new RankedObject(layer, properties))) { layersByType.remove(type); } } diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/SuiteIcon.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/SuiteIcon.java deleted file mode 100644 index fae2852..0000000 --- a/swt/org.argeo.app.ui/src/org/argeo/app/ui/SuiteIcon.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.argeo.app.ui; - -import org.argeo.api.cms.ux.CmsIcon; - -/** Icon names used by Argeo Suite. */ -public enum SuiteIcon implements CmsIcon { - add, save, close, closeAll, search, delete, logout, dashboard, - // people - people, group, person, organisation, addressBook, users, organisationContact, - // library - documents, document, folder, - // management - report, - // admin and settings - settings, user, - // misc - task, tag, location, inbox, map, todo, - // actions - openUserMenu, - // - ; -} diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/SuiteLayer.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/SuiteLayer.java deleted file mode 100644 index 6ee8ca0..0000000 --- a/swt/org.argeo.app.ui/src/org/argeo/app/ui/SuiteLayer.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.argeo.app.ui; - -import org.argeo.api.acr.Content; -import org.argeo.cms.Localized; -import org.argeo.cms.swt.acr.SwtUiProvider; -import org.eclipse.swt.widgets.Composite; - -/** An UI layer for the main work area. */ -public interface SuiteLayer extends SwtUiProvider { - static enum Property { - title, icon, weights, startMaximized, singleTab, singleTabTitle, fixedEntryArea; - } - - String getId(); - - void view(SwtUiProvider uiProvider, Composite workArea, Content context); - - Content getCurrentContext(Composite workArea); - - default void open(SwtUiProvider uiProvider, Composite workArea, Content context) { - view(uiProvider, workArea, context); - } - - default Localized getTitle() { - return null; - } -} diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/SuiteMsg.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/SuiteMsg.java deleted file mode 100644 index 4d515d7..0000000 --- a/swt/org.argeo.app.ui/src/org/argeo/app/ui/SuiteMsg.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.argeo.app.ui; - -import org.argeo.cms.Localized; - -/** Localized messages. */ -public enum SuiteMsg implements Localized { - // Entities - user, org, person, group, - // UI parts - dashboard, people, documents, locations, recentItems, - // NewPersonWizard - firstName, lastName, salutation, email, personWizardWindowTitle, personWizardPageTitle, personWizardFeedback, - // NewOrgWizard - orgWizardWindowTitle, orgWizardPageTitle, orgWizardFeedback, legalName, legalForm, vatId, - // Roles - userAdminRole, groupAdminRole, publisherRole, coworkerRole, - // Group - chooseAMember, - // ContextAddressComposite - chooseAnOrganisation, street, streetComplement, zipCode, city, state, country, geopoint, - // FilteredOrderableEntityTable - filterHelp, - // BankAccountComposite - accountHolder, bankName, currency, accountNumber, bankNumber, BIC, IBAN, - // EditJobDialog - position, chosenItem, department, isPrimary, searchAndChooseEntity, - // ContactListCTab (e4) - notes, addAContact, contactValue, linkedCompany, - // OrgAdminInfoCTab (e4) - paymentAccount, - // OrgEditor (e4) - orgDetails, orgActivityLog, team, orgAdmin, - // PersonEditor (e4) - personDetails, personActivityLog, personOrgs, personSecurity, - // PersonSecurityCTab (e4) - resetPassword, - // Generic - label, aCustomLabel, description, value, name, primary, add, save, pickup, - // Tag - confirmNewTag, cannotCreateTag, - // Feedback messages - allFieldsMustBeSet, - // - ; -} diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/SuiteStyle.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/SuiteStyle.java deleted file mode 100644 index 1afff73..0000000 --- a/swt/org.argeo.app.ui/src/org/argeo/app/ui/SuiteStyle.java +++ /dev/null @@ -1,35 +0,0 @@ -package org.argeo.app.ui; - -import org.argeo.api.cms.ux.CmsStyle; - -/** Styles used by Argeo Suite work UI. */ -public enum SuiteStyle implements CmsStyle { - // header - header, headerTitle, headerMenu, headerMenuItem, - // footer - footer, - // recent items - recentItems, - // lead pane - leadPane, leadPaneItem, leadPaneSectionTitle, leadPaneSubSectionTitle, - // entry area - entryArea, - // group composite - titleContainer, titleLabel, subTitleLabel, formLine, formColumn, navigationBar, navigationTitle, navigationButton, - // forms elements - simpleLabel, simpleText, simpleInput, - // table - titleCell, - // layers - workArea, - // tabbed area - mainTabBody, mainTabSelected, mainTab, - // buttons - inlineButton; - - @Override - public String getClassPrefix() { - return "argeo-suite"; - } - -} diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/SuiteUi.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/SuiteUi.java deleted file mode 100644 index c332929..0000000 --- a/swt/org.argeo.app.ui/src/org/argeo/app/ui/SuiteUi.java +++ /dev/null @@ -1,223 +0,0 @@ -package org.argeo.app.ui; - -import java.util.HashMap; -import java.util.Map; - -import org.argeo.api.acr.Content; -import org.argeo.api.cms.CmsLog; -import org.argeo.cms.Localized; -import org.argeo.cms.swt.CmsSwtUi; -import org.argeo.cms.swt.CmsSwtUtils; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.FormLayout; -import org.eclipse.swt.widgets.Composite; - -/** The view for the default UX of Argeo Suite. */ -class SuiteUi extends CmsSwtUi { - private static final long serialVersionUID = 6207018859086689108L; - private final static CmsLog log = CmsLog.getLog(SuiteUi.class); - - private Localized title; - private Composite header; - private Composite footer; - private Composite belowHeader; - private Composite leadPane; - private Composite sidePane; - private Composite dynamicArea; - - private Content userDir; - - private Map layers = new HashMap<>(); - private Map workAreas = new HashMap<>(); - private String currentLayerId = null; - - private boolean loginScreen = false; - - public SuiteUi(Composite parent, int style) { - super(parent, style); - this.setLayout(CmsSwtUtils.noSpaceGridLayout()); - - header = new Composite(this, SWT.NONE); - header.setLayout(CmsSwtUtils.noSpaceGridLayout()); - CmsSwtUtils.style(header, SuiteStyle.header); - header.setLayoutData(CmsSwtUtils.fillWidth()); - - belowHeader = new Composite(this, SWT.NONE); - belowHeader.setLayoutData(CmsSwtUtils.fillAll()); - - footer = new Composite(this, SWT.NONE); - footer.setLayout(CmsSwtUtils.noSpaceGridLayout()); - CmsSwtUtils.style(footer, SuiteStyle.footer); - footer.setLayoutData(CmsSwtUtils.fillWidth()); - } - - public void refreshBelowHeader(boolean initApp) { - CmsSwtUtils.clear(belowHeader); - int style = getStyle(); - if (initApp) { - belowHeader.setLayout(CmsSwtUtils.noSpaceGridLayout(3)); - - if (SWT.RIGHT_TO_LEFT == (style & SWT.RIGHT_TO_LEFT)) {// arabic, hebrew, etc. - sidePane = new Composite(belowHeader, SWT.NONE); - sidePane.setLayout(CmsSwtUtils.noSpaceGridLayout()); - sidePane.setLayoutData(CmsSwtUtils.fillHeight()); - dynamicArea = new Composite(belowHeader, SWT.NONE); - leadPane = new Composite(belowHeader, SWT.NONE); - } else { - leadPane = new Composite(belowHeader, SWT.NONE); - dynamicArea = new Composite(belowHeader, SWT.NONE); - sidePane = new Composite(belowHeader, SWT.NONE); - sidePane.setLayout(CmsSwtUtils.noSpaceGridLayout()); - sidePane.setLayoutData(CmsSwtUtils.fillHeight()); - } - leadPane.setLayoutData(CmsSwtUtils.fillHeight()); - leadPane.setLayout(CmsSwtUtils.noSpaceGridLayout()); - CmsSwtUtils.style(leadPane, SuiteStyle.leadPane); - - dynamicArea.setLayoutData(CmsSwtUtils.fillAll()); - dynamicArea.setLayout(new FormLayout()); - - } else { - belowHeader.setLayout(CmsSwtUtils.noSpaceGridLayout()); - } - } - - /* - * LAYERS - */ - - Composite getCurrentWorkArea() { - if (currentLayerId == null) - throw new IllegalStateException("No current layer"); - return workAreas.get(currentLayerId); - } - - String getCurrentLayerId() { - return currentLayerId; - } - - private Composite getLayer(String id, Content context) { - if (!layers.containsKey(id)) - return null; - if (!workAreas.containsKey(id)) - initLayer(id, layers.get(id), context); - return workAreas.get(id); - } - - Composite switchToLayer(String layerId, Content context) { - Composite current = null; - if (currentLayerId != null) { - current = getCurrentWorkArea(); - if (currentLayerId.equals(layerId)) - return current; - } - if (context == null) { - if (!getCmsView().isAnonymous()) - context = getUserDir(); - } - Composite toShow = getLayer(layerId, context); - if (toShow != null) { - currentLayerId = layerId; - if (!isDisposed()) { - if (!toShow.isDisposed()) { - toShow.moveAbove(null); - } else { - log.warn("Cannot show work area because it is disposed."); - toShow = initLayer(layerId, layers.get(layerId), context); - toShow.moveAbove(null); - } - dynamicArea.layout(true, true); - } - return toShow; - } else { - return current; - } - } - - void switchToLayer(SuiteLayer layer, Content context) { - // TODO make it more robust - for (String layerId : layers.keySet()) { - SuiteLayer l = layers.get(layerId); - if (layer.getId().equals(l.getId())) { - switchToLayer(layerId, context); - return; - } - } - throw new IllegalArgumentException("Layer is not registered."); - } - - void addLayer(String id, SuiteLayer layer) { - layers.put(id, layer); - } - - void removeLayer(String id) { - layers.remove(id); - if (workAreas.containsKey(id)) { - Composite workArea = workAreas.remove(id); - if (!workArea.isDisposed()) - workArea.dispose(); - } - } - - protected Composite initLayer(String id, SuiteLayer layer, Content context) { - Composite workArea = getCmsView().doAs(() -> (Composite) layer.createUiPart(dynamicArea, context)); - CmsSwtUtils.style(workArea, SuiteStyle.workArea); - workArea.setLayoutData(CmsSwtUtils.coverAll()); - workAreas.put(id, workArea); - return workArea; - } - - synchronized void logout() { - userDir = null; - currentLayerId = null; - workAreas.clear(); - } - - /* - * GETTERS / SETTERS - */ - - Composite getHeader() { - return header; - } - - Composite getFooter() { - return footer; - } - - Composite getLeadPane() { - return leadPane; - } - - Composite getSidePane() { - return sidePane; - } - - Composite getBelowHeader() { - return belowHeader; - } - - Content getUserDir() { - return userDir; - } - - void setUserDir(Content userDir) { - this.userDir = userDir; - } - - public Localized getTitle() { - return title; - } - - public void setTitle(Localized title) { - this.title = title; - } - - public boolean isLoginScreen() { - return loginScreen; - } - - public void setLoginScreen(boolean loginScreen) { - this.loginScreen = loginScreen; - } -} diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/SuiteUiUtils.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/SuiteUiUtils.java index 504e8ed..c98847a 100644 --- a/swt/org.argeo.app.ui/src/org/argeo/app/ui/SuiteUiUtils.java +++ b/swt/org.argeo.app.ui/src/org/argeo/app/ui/SuiteUiUtils.java @@ -5,6 +5,8 @@ import java.io.InputStream; import java.io.OutputStream; import java.nio.file.Files; import java.nio.file.Paths; +import java.util.HashMap; +import java.util.Map; import java.util.Objects; import javax.jcr.Node; @@ -19,6 +21,8 @@ import org.argeo.api.cms.ux.CmsIcon; import org.argeo.api.cms.ux.CmsStyle; import org.argeo.app.api.EntityNames; import org.argeo.app.api.EntityType; +import org.argeo.app.ux.SuiteStyle; +import org.argeo.app.ux.SuiteUxEvent; import org.argeo.cms.LocaleUtils; import org.argeo.cms.Localized; import org.argeo.cms.jcr.acr.JcrContent; @@ -428,6 +432,14 @@ public class SuiteUiUtils { return button; } + @Deprecated + public static Map eventProperties(Node node) { + Map properties = new HashMap<>(); + String contentPath = '/' + Jcr.getWorkspaceName(node) + Jcr.getPath(node); + properties.put(SuiteUxEvent.CONTENT_PATH, contentPath); + return properties; + } + // public static String createAndConfigureEntity(Shell shell, Session referenceSession, String mainMixin, // String... additionnalProps) { // diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/SuiteUxEvent.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/SuiteUxEvent.java deleted file mode 100644 index 00aaddc..0000000 --- a/swt/org.argeo.app.ui/src/org/argeo/app/ui/SuiteUxEvent.java +++ /dev/null @@ -1,46 +0,0 @@ -package org.argeo.app.ui; - -import java.util.HashMap; -import java.util.Map; - -import javax.jcr.Node; - -import org.argeo.api.acr.Content; -import org.argeo.api.cms.CmsEvent; -import org.argeo.jcr.Jcr; -import org.osgi.service.useradmin.User; - -/** Events specific to Argeo Suite UX. */ -public enum SuiteUxEvent implements CmsEvent { - openNewPart, refreshPart, switchLayer; - - public final static String LAYER = "layer"; - public final static String USERNAME = "username"; - - // ACR - public final static String CONTENT_PATH = "contentPath"; - - public String getTopicBase() { - return "argeo.suite.ui"; - } - - public static Map eventProperties(Content content) { - Map properties = new HashMap<>(); - properties.put(CONTENT_PATH, content.getPath()); - return properties; - } - - @Deprecated - public static Map eventProperties(Node node) { - Map properties = new HashMap<>(); - String contentPath = '/' + Jcr.getWorkspaceName(node) + Jcr.getPath(node); - properties.put(CONTENT_PATH, contentPath); - return properties; - } - - public static Map eventProperties(User user) { - Map properties = new HashMap<>(); - properties.put(USERNAME, user.getName()); - return properties; - } -} diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/dialogs/NewPersonPage.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/dialogs/NewPersonPage.java index 380330f..54c94f8 100644 --- a/swt/org.argeo.app.ui/src/org/argeo/app/ui/dialogs/NewPersonPage.java +++ b/swt/org.argeo.app.ui/src/org/argeo/app/ui/dialogs/NewPersonPage.java @@ -1,7 +1,7 @@ package org.argeo.app.ui.dialogs; -import org.argeo.app.ui.SuiteMsg; import org.argeo.app.ui.SuiteUiUtils; +import org.argeo.app.ux.SuiteMsg; import org.eclipse.jface.wizard.WizardPage; import org.eclipse.swt.SWT; import org.eclipse.swt.events.ModifyEvent; diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/dialogs/NewPersonWizard.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/dialogs/NewPersonWizard.java index ee9f5b9..2206c55 100644 --- a/swt/org.argeo.app.ui/src/org/argeo/app/ui/dialogs/NewPersonWizard.java +++ b/swt/org.argeo.app.ui/src/org/argeo/app/ui/dialogs/NewPersonWizard.java @@ -4,8 +4,8 @@ import static org.argeo.eclipse.ui.EclipseUiUtils.isEmpty; import javax.jcr.Node; -import org.argeo.app.ui.SuiteMsg; import org.argeo.app.ui.SuiteUiUtils; +import org.argeo.app.ux.SuiteMsg; import org.argeo.eclipse.ui.EclipseUiUtils; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.wizard.Wizard; diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/library/ContentEntryArea.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/library/ContentEntryArea.java index 5047151..4664758 100644 --- a/swt/org.argeo.app.ui/src/org/argeo/app/ui/library/ContentEntryArea.java +++ b/swt/org.argeo.app.ui/src/org/argeo/app/ui/library/ContentEntryArea.java @@ -6,7 +6,7 @@ import org.argeo.api.acr.spi.ProvidedContent; import org.argeo.api.cms.CmsLog; import org.argeo.api.cms.ux.CmsView; import org.argeo.app.api.EntityType; -import org.argeo.app.ui.SuiteUxEvent; +import org.argeo.app.ux.SuiteUxEvent; import org.argeo.cms.swt.CmsSwtUtils; import org.argeo.cms.swt.acr.SwtUiProvider; import org.argeo.cms.swt.widgets.SwtTreeView; diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/library/DocumentsFolderUiProvider.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/library/DocumentsFolderUiProvider.java index 657a851..0ae0ad7 100644 --- a/swt/org.argeo.app.ui/src/org/argeo/app/ui/library/DocumentsFolderUiProvider.java +++ b/swt/org.argeo.app.ui/src/org/argeo/app/ui/library/DocumentsFolderUiProvider.java @@ -7,7 +7,8 @@ import javax.jcr.Node; import javax.jcr.RepositoryException; import org.argeo.api.cms.ux.CmsView; -import org.argeo.app.ui.SuiteUxEvent; +import org.argeo.app.ui.SuiteUiUtils; +import org.argeo.app.ux.SuiteUxEvent; import org.argeo.cms.fs.CmsFsUtils; import org.argeo.cms.swt.CmsSwtUtils; import org.argeo.cms.ui.CmsUiProvider; @@ -29,7 +30,7 @@ public class DocumentsFolderUiProvider implements CmsUiProvider { protected void externalNavigateTo(Path path) { Node folderNode = cmsView.doAs(() -> CmsFsUtils.getNode(Jcr.getSession(context).getRepository(), path)); parent.addDisposeListener((e1) -> Jcr.logout(folderNode)); - cmsView.sendEvent(SuiteUxEvent.openNewPart.topic(), SuiteUxEvent.eventProperties(folderNode)); + cmsView.sendEvent(SuiteUxEvent.openNewPart.topic(), SuiteUiUtils.eventProperties(folderNode)); } }; dfc.setLayoutData(CmsSwtUtils.fillAll()); diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/library/DocumentsTreeUiProvider.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/library/DocumentsTreeUiProvider.java index 6c0bdfc..1f91b64 100644 --- a/swt/org.argeo.app.ui/src/org/argeo/app/ui/library/DocumentsTreeUiProvider.java +++ b/swt/org.argeo.app.ui/src/org/argeo/app/ui/library/DocumentsTreeUiProvider.java @@ -8,7 +8,8 @@ import javax.jcr.Node; import javax.jcr.Repository; import javax.jcr.RepositoryException; -import org.argeo.app.ui.SuiteUxEvent; +import org.argeo.app.ui.SuiteUiUtils; +import org.argeo.app.ux.SuiteUxEvent; import org.argeo.api.cms.CmsConstants; import org.argeo.api.cms.ux.CmsView; import org.argeo.cms.fs.CmsFsUtils; @@ -46,7 +47,7 @@ public class DocumentsTreeUiProvider implements CmsUiProvider { if (Files.isDirectory(newSelected)) { Node folderNode = cmsView.doAs(() -> CmsFsUtils.getNode(repository, newSelected)); parent.addDisposeListener((e1) -> Jcr.logout(folderNode)); - cmsView.sendEvent(SuiteUxEvent.refreshPart.topic(), SuiteUxEvent.eventProperties(folderNode)); + cmsView.sendEvent(SuiteUxEvent.refreshPart.topic(), SuiteUiUtils.eventProperties(folderNode)); } } }); @@ -59,7 +60,7 @@ public class DocumentsTreeUiProvider implements CmsUiProvider { if (Files.isDirectory(newSelected)) { Node folderNode = cmsView.doAs(() -> CmsFsUtils.getNode(repository, newSelected)); parent.addDisposeListener((e1) -> Jcr.logout(folderNode)); - cmsView.sendEvent(SuiteUxEvent.openNewPart.topic(), SuiteUxEvent.eventProperties(folderNode)); + cmsView.sendEvent(SuiteUxEvent.openNewPart.topic(), SuiteUiUtils.eventProperties(folderNode)); } } }); diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/library/JcrContentEntryArea.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/library/JcrContentEntryArea.java index 0fbb5cb..286a4cb 100644 --- a/swt/org.argeo.app.ui/src/org/argeo/app/ui/library/JcrContentEntryArea.java +++ b/swt/org.argeo.app.ui/src/org/argeo/app/ui/library/JcrContentEntryArea.java @@ -13,9 +13,10 @@ import javax.jcr.query.Query; import org.argeo.api.acr.Content; import org.argeo.api.cms.CmsConstants; import org.argeo.app.api.EntityType; -import org.argeo.app.ui.SuiteUxEvent; -import org.argeo.app.ui.SuiteIcon; +import org.argeo.app.ui.SuiteUiUtils; import org.argeo.app.ui.widgets.TreeOrSearchArea; +import org.argeo.app.ux.SuiteIcon; +import org.argeo.app.ux.SuiteUxEvent; import org.argeo.cms.jcr.acr.JcrContentProvider; import org.argeo.cms.swt.CmsSwtTheme; import org.argeo.cms.swt.CmsSwtUtils; @@ -86,7 +87,7 @@ public class JcrContentEntryArea implements CmsUiProvider { Node user = (Node) ui.getTreeViewer().getStructuredSelection().getFirstElement(); if (user != null) { CmsSwtUtils.getCmsView(parent).sendEvent(SuiteUxEvent.openNewPart.topic(), - SuiteUxEvent.eventProperties(user)); + SuiteUiUtils.eventProperties(user)); } } @@ -96,7 +97,7 @@ public class JcrContentEntryArea implements CmsUiProvider { Node user = (Node) ui.getTreeViewer().getStructuredSelection().getFirstElement(); if (user != null) { CmsSwtUtils.getCmsView(parent).sendEvent(SuiteUxEvent.refreshPart.topic(), - SuiteUxEvent.eventProperties(user)); + SuiteUiUtils.eventProperties(user)); } } }); diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/openlayers/OpenLayersMap.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/openlayers/OpenLayersMap.java index 97c0e7c..40b3388 100644 --- a/swt/org.argeo.app.ui/src/org/argeo/app/ui/openlayers/OpenLayersMap.java +++ b/swt/org.argeo.app.ui/src/org/argeo/app/ui/openlayers/OpenLayersMap.java @@ -15,7 +15,7 @@ import javax.jcr.RepositoryException; import org.apache.commons.io.IOUtils; import org.argeo.app.api.EntityNames; import org.argeo.app.api.EntityType; -import org.argeo.app.ui.SuiteUxEvent; +import org.argeo.app.ux.SuiteUxEvent; import org.argeo.api.cms.CmsLog; import org.argeo.api.cms.ux.CmsView; import org.argeo.api.cms.CmsConstants; diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/people/GroupUiProvider.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/people/GroupUiProvider.java index f0de1ca..5129018 100644 --- a/swt/org.argeo.app.ui/src/org/argeo/app/ui/people/GroupUiProvider.java +++ b/swt/org.argeo.app.ui/src/org/argeo/app/ui/people/GroupUiProvider.java @@ -10,9 +10,9 @@ import org.argeo.api.cms.directory.CmsGroup; import org.argeo.api.cms.directory.CmsUser; import org.argeo.api.cms.directory.CmsUserManager; import org.argeo.api.cms.directory.HierarchyUnit; -import org.argeo.app.ui.SuiteIcon; -import org.argeo.app.ui.SuiteMsg; import org.argeo.app.ui.SuiteUiUtils; +import org.argeo.app.ux.SuiteIcon; +import org.argeo.app.ux.SuiteMsg; import org.argeo.cms.CurrentUser; import org.argeo.cms.acr.ContentUtils; import org.argeo.cms.auth.CmsRole; diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/people/HierarchyUnitPart.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/people/HierarchyUnitPart.java index 3316031..8a2059f 100644 --- a/swt/org.argeo.app.ui/src/org/argeo/app/ui/people/HierarchyUnitPart.java +++ b/swt/org.argeo.app.ui/src/org/argeo/app/ui/people/HierarchyUnitPart.java @@ -11,7 +11,7 @@ import org.argeo.api.cms.directory.CmsUserManager; import org.argeo.api.cms.directory.HierarchyUnit; import org.argeo.api.cms.directory.UserDirectory; import org.argeo.api.cms.ux.CmsIcon; -import org.argeo.app.ui.SuiteIcon; +import org.argeo.app.ux.SuiteIcon; import org.argeo.cms.CurrentUser; import org.argeo.cms.acr.ContentUtils; import org.argeo.cms.auth.CmsRole; diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/people/NewOrgForm.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/people/NewOrgForm.java index e39ba0a..b651efa 100644 --- a/swt/org.argeo.app.ui/src/org/argeo/app/ui/people/NewOrgForm.java +++ b/swt/org.argeo.app.ui/src/org/argeo/app/ui/people/NewOrgForm.java @@ -13,8 +13,8 @@ import org.argeo.api.acr.ldap.LdapObj; import org.argeo.api.cms.directory.CmsGroup; import org.argeo.api.cms.directory.CmsUserManager; import org.argeo.api.cms.directory.HierarchyUnit; -import org.argeo.app.ui.SuiteMsg; import org.argeo.app.ui.SuiteUiUtils; +import org.argeo.app.ux.SuiteMsg; import org.argeo.cms.swt.dialogs.CmsFeedback; import org.argeo.cms.swt.widgets.SwtGuidedFormPage; import org.argeo.cms.ux.widgets.AbstractGuidedForm; diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/people/NewUserForm.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/people/NewUserForm.java index 5a73b1b..d70c82a 100644 --- a/swt/org.argeo.app.ui/src/org/argeo/app/ui/people/NewUserForm.java +++ b/swt/org.argeo.app.ui/src/org/argeo/app/ui/people/NewUserForm.java @@ -15,8 +15,8 @@ import org.argeo.api.cms.directory.CmsUser; import org.argeo.api.cms.directory.CmsUserManager; import org.argeo.api.cms.directory.HierarchyUnit; import org.argeo.app.core.SuiteUtils; -import org.argeo.app.ui.SuiteMsg; import org.argeo.app.ui.SuiteUiUtils; +import org.argeo.app.ux.SuiteMsg; import org.argeo.cms.swt.dialogs.CmsFeedback; import org.argeo.cms.swt.widgets.SwtGuidedFormPage; import org.argeo.cms.ux.widgets.AbstractGuidedForm; diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/people/PeopleEntryArea.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/people/PeopleEntryArea.java index f7141a4..5a9a3d6 100644 --- a/swt/org.argeo.app.ui/src/org/argeo/app/ui/people/PeopleEntryArea.java +++ b/swt/org.argeo.app.ui/src/org/argeo/app/ui/people/PeopleEntryArea.java @@ -10,9 +10,9 @@ import org.argeo.api.acr.ldap.LdapAttr; import org.argeo.api.cms.directory.CmsUserManager; import org.argeo.api.cms.directory.HierarchyUnit; import org.argeo.api.cms.ux.CmsView; -import org.argeo.app.ui.SuiteIcon; -import org.argeo.app.ui.SuiteMsg; -import org.argeo.app.ui.SuiteUxEvent; +import org.argeo.app.ux.SuiteIcon; +import org.argeo.app.ux.SuiteMsg; +import org.argeo.app.ux.SuiteUxEvent; import org.argeo.cms.CurrentUser; import org.argeo.cms.acr.ContentUtils; import org.argeo.cms.auth.CmsRole; diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/people/PersonUiProvider.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/people/PersonUiProvider.java index 8a22a10..a658898 100644 --- a/swt/org.argeo.app.ui/src/org/argeo/app/ui/people/PersonUiProvider.java +++ b/swt/org.argeo.app.ui/src/org/argeo/app/ui/people/PersonUiProvider.java @@ -14,9 +14,9 @@ import org.argeo.api.cms.directory.CmsUserManager; import org.argeo.api.cms.directory.HierarchyUnit; import org.argeo.api.cms.directory.HierarchyUnit.Type; import org.argeo.app.api.SuiteRole; -import org.argeo.app.ui.SuiteMsg; -import org.argeo.app.ui.SuiteStyle; import org.argeo.app.ui.SuiteUiUtils; +import org.argeo.app.ux.SuiteMsg; +import org.argeo.app.ux.SuiteStyle; import org.argeo.cms.CmsMsg; import org.argeo.cms.CurrentUser; import org.argeo.cms.Localized; diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/people/UserColumn.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/people/UserColumn.java index 9dae8a4..2214a15 100644 --- a/swt/org.argeo.app.ui/src/org/argeo/app/ui/people/UserColumn.java +++ b/swt/org.argeo.app.ui/src/org/argeo/app/ui/people/UserColumn.java @@ -5,7 +5,7 @@ import org.argeo.api.acr.ldap.LdapAcrUtils; import org.argeo.api.acr.ldap.LdapAttr; import org.argeo.api.acr.ldap.LdapObj; import org.argeo.api.cms.ux.CmsIcon; -import org.argeo.app.ui.SuiteIcon; +import org.argeo.app.ux.SuiteIcon; import org.argeo.cms.CurrentUser; import org.argeo.cms.auth.UserAdminUtils; import org.argeo.cms.ux.widgets.Column;