X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=org.argeo.cms.e4%2Fsrc%2Forg%2Fargeo%2Fcms%2Fe4%2Fusers%2FAbstractRoleEditor.java;h=31f2d1c8d557ae7b4e26e7a9acb553e4aa3e02ca;hb=03f646fd0d7e7ce393694c836c779bc67a4eef55;hp=589cca60dea140f21dfcd5af0c63f996018c62e8;hpb=d6390257a328199a2a4a677b33e79b6535175169;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.cms.e4/src/org/argeo/cms/e4/users/AbstractRoleEditor.java b/org.argeo.cms.e4/src/org/argeo/cms/e4/users/AbstractRoleEditor.java index 589cca60d..31f2d1c8d 100644 --- a/org.argeo.cms.e4/src/org/argeo/cms/e4/users/AbstractRoleEditor.java +++ b/org.argeo.cms.e4/src/org/argeo/cms/e4/users/AbstractRoleEditor.java @@ -1,18 +1,3 @@ -/* - * Copyright (C) 2007-2012 Argeo GmbH - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ package org.argeo.cms.e4.users; import java.util.ArrayList; @@ -22,11 +7,10 @@ import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; import javax.inject.Inject; +import org.argeo.cms.auth.UserAdminUtils; import org.argeo.cms.ui.eclipse.forms.AbstractFormPart; import org.argeo.cms.ui.eclipse.forms.IManagedForm; import org.argeo.cms.ui.eclipse.forms.ManagedForm; -import org.argeo.cms.util.CmsUtils; -import org.argeo.cms.util.UserAdminUtils; import org.argeo.eclipse.ui.EclipseUiUtils; import org.argeo.naming.LdapAttrs; import org.eclipse.core.runtime.IProgressMonitor; @@ -74,7 +58,7 @@ public abstract class AbstractRoleEditor { private NameChangeListener listener; - private IManagedForm managedForm; + private ManagedForm managedForm; // public void init(IEditorSite site, IEditorInput input) throws // PartInitException { @@ -88,11 +72,18 @@ public abstract class AbstractRoleEditor { userAdminWrapper.addListener(listener); updateEditorTitle(null); - managedForm = new ManagedForm(parent); + managedForm = new ManagedForm(parent) { + + @Override + public void staleStateChanged() { + refresh(); + } + }; ScrolledComposite scrolled = managedForm.getForm(); Composite body = new Composite(scrolled, SWT.NONE); scrolled.setContent(body); createUi(body); + managedForm.refresh(); } abstract void createUi(Composite parent); @@ -171,6 +162,7 @@ public abstract class AbstractRoleEditor { @PreDestroy public void dispose() { userAdminWrapper.removeListener(listener); + managedForm.dispose(); } // CONTROLERS FOR THIS EDITOR AND ITS PAGES @@ -248,10 +240,10 @@ public abstract class AbstractRoleEditor { Text createLMT(Composite parent, String label, String value) { Label lbl = new Label(parent, SWT.NONE); lbl.setText(label); - lbl.setLayoutData(new GridData(SWT.RIGHT, SWT.FILL, false, false)); + lbl.setLayoutData(new GridData(SWT.LEAD, SWT.CENTER, false, false)); Text text = new Text(parent, SWT.NONE); text.setText(value); - text.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); + text.setLayoutData(new GridData(SWT.LEAD, SWT.FILL, true, true)); return text; } @@ -259,10 +251,10 @@ public abstract class AbstractRoleEditor { Text createLP(Composite parent, String label, String value) { Label lbl = new Label(parent, SWT.NONE); lbl.setText(label); - lbl.setLayoutData(new GridData(SWT.LEAD, SWT.FILL, false, false)); - Text text = new Text(parent, SWT.PASSWORD); + lbl.setLayoutData(new GridData(SWT.LEAD, SWT.CENTER, false, false)); + Text text = new Text(parent, SWT.PASSWORD | SWT.BORDER); text.setText(value); - text.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); + text.setLayoutData(new GridData(SWT.LEAD, SWT.FILL, true, false)); return text; } @@ -270,25 +262,25 @@ public abstract class AbstractRoleEditor { Text createLT(Composite parent, String label, String value) { Label lbl = new Label(parent, SWT.NONE); lbl.setText(label); - lbl.setLayoutData(new GridData(SWT.LEAD, SWT.FILL, false, false)); + lbl.setLayoutData(new GridData(SWT.LEAD, SWT.CENTER, false, false)); lbl.setFont(EclipseUiUtils.getBoldFont(parent)); - Text text = new Text(parent, SWT.NONE); + Text text = new Text(parent, SWT.BORDER); text.setText(value); text.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); - CmsUtils.style(text, CmsWorkbenchStyles.WORKBENCH_FORM_TEXT); + // CmsUiUtils.style(text, CmsWorkbenchStyles.WORKBENCH_FORM_TEXT); return text; } Text createReadOnlyLT(Composite parent, String label, String value) { Label lbl = new Label(parent, SWT.NONE); lbl.setText(label); - lbl.setLayoutData(new GridData(SWT.LEAD, SWT.FILL, false, false)); + lbl.setLayoutData(new GridData(SWT.LEAD, SWT.CENTER, false, false)); lbl.setFont(EclipseUiUtils.getBoldFont(parent)); Text text = new Text(parent, SWT.NONE); text.setText(value); - text.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); + text.setLayoutData(new GridData(SWT.LEAD, SWT.FILL, true, false)); text.setEditable(false); - CmsUtils.style(text, CmsWorkbenchStyles.WORKBENCH_FORM_TEXT); + // CmsUiUtils.style(text, CmsWorkbenchStyles.WORKBENCH_FORM_TEXT); return text; }