-/*
- * 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;
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.argeo.util.naming.LdapAttrs;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.e4.ui.di.Persist;
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
private NameChangeListener listener;
- private IManagedForm managedForm;
+ private ManagedForm managedForm;
// public void init(IEditorSite site, IEditorInput input) throws
// PartInitException {
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);
@PreDestroy
public void dispose() {
userAdminWrapper.removeListener(listener);
+ managedForm.dispose();
}
// CONTROLERS FOR THIS EDITOR AND ITS PAGES
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;
}
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;
}
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;
}