Skip to content

Commit

Permalink
GERONIMODEVTOOLS-129 Enhanced Editor Support for specifying GBeans in…
Browse files Browse the repository at this point in the history
… all the deployment editors -- Thanks to Shiva for the original patch, and BJ Reed for enhancements!!

git-svn-id: https://svn.apache.org/repos/asf/geronimo/devtools/eclipse-plugin/trunk@690385 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Tim McConnell committed Aug 29, 2008
1 parent 23c17bc commit 7d7ea5e
Show file tree
Hide file tree
Showing 24 changed files with 853 additions and 908 deletions.
Expand Up @@ -29,7 +29,7 @@ public class Messages extends NLS {
static {
NLS.initializeMessages(Activator.PLUGIN_ID + ".internal.Messages", Messages.class);
}
public static String editorTabSource;

public static String editorSectionSecurityTitle;
Expand Down Expand Up @@ -127,6 +127,7 @@ public class Messages extends NLS {
public static String editorSecurityRealmName;
public static String editorApplicationName;
public static String editorCallbackHandler;
public static String editorDomainName;
public static String editorRealmName;
public static String editorSubjectId;
public static String editorejbqlCompilerFactory;
Expand Down Expand Up @@ -239,6 +240,16 @@ public class Messages extends NLS {
public static String wizardPageTitle_EjbLocalRef;
public static String wizardPageDescription_EjbLocalRef;
//
public static String wizardNewTitle_RoleMapping;
public static String wizardEditTitle_RoleMapping;
public static String wizardPageTitle_RoleMapping;
public static String wizardPageDescription_RoleMapping;
//
public static String wizardNewTitle_RunAsSubject;
public static String wizardEditTitle_RunAsSubject;
public static String wizardPageTitle_RunAsSubject;
public static String wizardPageDescription_RunAsSubject;
//
public static String wizardNewTitle_Dependency;
public static String wizardEditTitle_Dependency;
public static String wizardPageTitle_Dependency;
Expand All @@ -251,6 +262,9 @@ public class Messages extends NLS {
public static String artifactId;
public static String version;
public static String type;
public static String element;
public static String customName;
public static String value;
public static String messageDestinationName;
public static String adminModule;
public static String adminLink;
Expand Down Expand Up @@ -294,7 +308,8 @@ public class Messages extends NLS {
public static String securityRunAsSubjects;
public static String securityRunAsSubjectRole;
public static String securityRunAsSubjectRealm;
public static String securityRunAsSubjectId;
public static String securityRunAsSubjectId;
public static String securityRefreshRoles;

public static String editorCorrect;
public static String editorDefault;
Expand Down Expand Up @@ -327,10 +342,7 @@ public class Messages extends NLS {
public static String web;

public static String licenseAgreement;

public static String acceptLicenseAgreement;

public static String rejectLicenseAgreement;

public static String confirmLicenseRejection;
}
Expand Up @@ -103,6 +103,7 @@ editorContextRoot=Context Root:
editorWorkDir=Working Directory:
editorSecurityRealmName=Security Realm Name:
editorCallbackHandler=Callback Handler:
editorDomainName=Domain Name:
editorRealmName=Realm Name:
editorSubjectId=Subject Id:
editorApplicationName=Application Name:
Expand Down Expand Up @@ -183,7 +184,7 @@ wizardNewTitle_Dependency=New Dependency
wizardEditTitle_Dependency=Edit Dependency
wizardPageTitle_Dependency=Dependency Details
wizardPageDescription_Dependency=Provide details for this dependency.
wizardTabManual_Dependency=Add Manually
wizardTabManual_Dependency=Manual Input
wizardTabServer_Dependency=Add From Server

wizardNewTitle_Import=New Import
Expand Down Expand Up @@ -211,6 +212,21 @@ wizardEditTitle_ExtModule=Edit External Module
wizardPageTitle_ExtModule=External Module Details
wizardPageDescription_ExtModule=Provide details for this external module.

wizardNewTitle_ServiceRef=New Service Reference
wizardEditTitle_ServiceRef=Edit Service Reference
wizardPageTitle_ServiceRef=Service Reference Details
wizardPageDescription_ServiceRef=Provide details for this service reference.

wizardNewTitle_RoleMapping=New Role Mapping
wizardEditTitle_RoleMapping=Edit Role Mapping
wizardPageTitle_RoleMapping=Role Mapping Details
wizardPageDescription_RoleMapping=Provide details for this role mapping.

wizardNewTitle_RunAsSubject=New Run As Subject
wizardEditTitle_RunAsSubject=Edit Run As Subject
wizardPageTitle_RunAsSubject=Run As Subject Details
wizardPageDescription_RunAsSubject=Provide details for this run-as subject.

securityCredentialStore=Credential Store:
securityDefaultSubject=Default Subject:
securityDefaultSubjectRealmName=Realm Name
Expand All @@ -221,12 +237,16 @@ securityRunAsSubjects=Run As Subjects:
securityRunAsSubjectRole=Role
securityRunAsSubjectRealm=Realm
securityRunAsSubjectId=Id
securityRefreshRoles=Refresh Roles from Deployment Descriptor/Annotations

dependencyGroupLabel=Dependency type and location
groupId=Group Id
artifactId=Artifact Id
version=Version
type=Artifact Type
type=Type
element=Element
customName=Custom Name
value=Value

messageDestinationName=Message Destination Name
adminModule=Admin Module
Expand Down
Expand Up @@ -199,7 +199,7 @@ protected void createAddButton(FormToolkit toolkit, Composite buttonComp) {
addButton = toolkit.createButton(buttonComp, CommonMessages.add, SWT.NONE);
addButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
Wizard wizard = getAddWizard();
Wizard wizard = getWizard();
if (wizard != null) {
WizardDialog dialog = new WizardDialog(Display.getCurrent().getActiveShell(), wizard);
dialog.open();
Expand All @@ -219,7 +219,7 @@ protected void createEditButton(FormToolkit toolkit, Composite buttonComp) {
public void widgetSelected(SelectionEvent e) {
Object selectedObject = ((StructuredSelection) getViewer().getSelection()).getFirstElement();
if (selectedObject != null) {
Wizard wizard = getEditWizard();
Wizard wizard = getWizard();
if (wizard != null) {
if (wizard instanceof AbstractWizard) {
((AbstractWizard) wizard).setEObject(selectedObject);
Expand Down Expand Up @@ -262,9 +262,7 @@ protected void activateRemoveButton() {

abstract public String getDescription();

abstract public Wizard getAddWizard();

abstract public Wizard getEditWizard();
abstract protected Wizard getWizard();

abstract public Class getTableEntryObjectType();

Expand Down
Expand Up @@ -131,15 +131,5 @@ protected void activateButton(Button button) {
button.setEnabled(selected);
}

@Override
public Wizard getAddWizard() {
return getWizard();
}

@Override
public Wizard getEditWizard() {
return getWizard();
}

protected abstract Wizard getWizard();
abstract protected Wizard getWizard();
}
Expand Up @@ -82,7 +82,6 @@ public void removeItem(Object anItem) {
}

protected void activateButton(Button button) {
boolean Selected = tree.getSelectionCount() > 0;
button.setEnabled(Selected);
button.setEnabled(tree.getSelectionCount() > 0);
}
}
Expand Up @@ -60,7 +60,7 @@ public void createEditFields(Composite composite) {
if (eObject != null) {
initialValue = (String) JAXBUtils.getValue(eObject, getTableColumnEAttributes()[i]);
}
textEntries[i] = createTextFeild(composite, initialValue);
textEntries[i] = createTextField(composite, initialValue);
}
}

Expand Down Expand Up @@ -111,15 +111,6 @@ protected String getWizardPageDescription() {
return getWizardFirstPageDescription();
}

@Override
protected String getWizardWindowTitle() {
return getAddWizardWindowTitle();
}

public abstract String getAddWizardWindowTitle();

public abstract String getEditWizardWindowTitle();

public abstract String getWizardFirstPageTitle();

public abstract String getWizardFirstPageDescription();
Expand Down
Expand Up @@ -16,6 +16,7 @@
*/
package org.apache.geronimo.st.ui.wizards;

import org.apache.geronimo.st.core.jaxb.JAXBObjectFactory;
import org.apache.geronimo.st.ui.Activator;
import org.apache.geronimo.st.ui.sections.AbstractListSection;
import org.eclipse.jface.resource.ImageDescriptor;
Expand All @@ -41,11 +42,12 @@ public abstract class AbstractWizard extends Wizard {
public AbstractWizard(AbstractListSection section) {
super();
this.section = section;
setWindowTitle(getWizardWindowTitle());
setWindowTitle(getAddWizardWindowTitle());
}

public void setEObject(Object object) {
eObject = object;
setWindowTitle(getEditWizardWindowTitle());
}

public abstract class AbstractWizardPage extends WizardPage {
Expand Down Expand Up @@ -82,7 +84,7 @@ protected Label createLabel(Composite composite, String labelString) {
return label;
}

protected Text createTextFeild(Composite composite, String initialValue) {
protected Text createTextField(Composite composite, String initialValue) {
Text text = new Text(composite, SWT.SINGLE | SWT.BORDER);
GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL);
data.grabExcessHorizontalSpace = true;
Expand All @@ -107,12 +109,14 @@ protected Combo createCombo(Composite composite, String[] items, boolean editabl
}
}

protected abstract String getWizardWindowTitle();

protected abstract String getWizardPageTitle();

protected abstract String getWizardPageDescription();

protected abstract String getAddWizardWindowTitle();

protected abstract String getEditWizardWindowTitle();

protected ImageDescriptor getImageDescriptor() {
return Activator.imageDescriptorFromPlugin("org.apache.geronimo.ui", "icons/bigG.gif");
}
Expand Down
Expand Up @@ -21,11 +21,13 @@
import org.apache.geronimo.jee.application.Module;
import org.apache.geronimo.jee.application.Path;
import org.apache.geronimo.jee.deployment.Artifact;
import org.apache.geronimo.jee.deployment.Attribute;
import org.apache.geronimo.jee.deployment.ClassFilter;
import org.apache.geronimo.jee.deployment.Dependencies;
import org.apache.geronimo.jee.deployment.Dependency;
import org.apache.geronimo.jee.deployment.Environment;
import org.apache.geronimo.jee.deployment.Gbean;
import org.apache.geronimo.jee.deployment.Reference;
import org.apache.geronimo.jee.naming.EjbRef;
import org.apache.geronimo.jee.naming.EjbLocalRef;
import org.apache.geronimo.jee.naming.GbeanRef;
Expand All @@ -34,6 +36,10 @@
import org.apache.geronimo.jee.naming.ResourceRef;
import org.apache.geronimo.jee.naming.ServiceRef;
import org.apache.geronimo.jee.security.Description;
import org.apache.geronimo.jee.security.DistinguishedName;
import org.apache.geronimo.jee.security.LoginDomainPrincipal;
import org.apache.geronimo.jee.security.Principal;
import org.apache.geronimo.jee.security.RealmPrincipal;
import org.apache.geronimo.jee.security.RoleMappings;
import org.apache.geronimo.jee.security.Role;
import org.apache.geronimo.jee.security.Security;
Expand Down Expand Up @@ -78,6 +84,14 @@ public Object create(Class type) {
return (new org.apache.geronimo.jee.security.ObjectFactory()).createDescription();
} else if ( type.equals( Role.class ) ) {
return (new org.apache.geronimo.jee.security.ObjectFactory()).createRole();
} else if ( type.equals( DistinguishedName.class ) ) {
return (new org.apache.geronimo.jee.security.ObjectFactory()).createDistinguishedName();
} else if ( type.equals( Principal.class ) ) {
return (new org.apache.geronimo.jee.security.ObjectFactory()).createPrincipal();
} else if ( type.equals( LoginDomainPrincipal.class ) ) {
return (new org.apache.geronimo.jee.security.ObjectFactory()).createLoginDomainPrincipal();
} else if ( type.equals( RealmPrincipal.class ) ) {
return (new org.apache.geronimo.jee.security.ObjectFactory()).createRealmPrincipal();
} else if ( type.equals( Gbean.class ) ) {
return (new org.apache.geronimo.jee.deployment.ObjectFactory()).createGbean();
} else if ( type.equals( Artifact.class ) ) {
Expand All @@ -92,6 +106,10 @@ public Object create(Class type) {
return (new org.apache.geronimo.jee.deployment.ObjectFactory()).createEnvironment();
} else if ( type.equals( org.apache.geronimo.jee.deployment.Pattern.class ) ) {
return (new org.apache.geronimo.jee.deployment.ObjectFactory()).createPattern();
} else if ( type.equals( Attribute.class ) ) {
return (new org.apache.geronimo.jee.deployment.ObjectFactory()).createAttribute();
} else if ( type.equals( Reference.class ) ) {
return (new org.apache.geronimo.jee.deployment.ObjectFactory()).createReference();
} else if ( type.equals( ExtModule.class ) ) {
return (new org.apache.geronimo.jee.application.ObjectFactory()).createExtModule();
} else if ( type.equals( Module.class ) ) {
Expand Down
Expand Up @@ -20,7 +20,7 @@
import org.apache.geronimo.st.ui.pages.AbstractGeronimoFormPage;
import org.apache.geronimo.st.v21.core.GeronimoServerInfo;
import org.apache.geronimo.st.v21.ui.sections.SecurityAdvancedSection;
import org.apache.geronimo.st.v21.ui.sections.SecurityRoleMappingsSection;
import org.apache.geronimo.st.v21.ui.sections.SecurityRoleMappingSection;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.ui.forms.IManagedForm;
import org.eclipse.ui.forms.editor.FormEditor;
Expand All @@ -40,7 +40,7 @@ public SecurityPage(FormEditor editor, String id, String title) {
* @see org.apache.geronimo.ui.pages.AbstractGeronimoFormPage#fillBody(org.eclipse.ui.forms.IManagedForm)
*/
protected void fillBody(IManagedForm managedForm) {
managedForm.addPart(new SecurityRoleMappingsSection(getDeploymentPlan(), getDeploymentDescriptor(), body, toolkit, getStyle()));
managedForm.addPart(new SecurityRoleMappingSection(getDeploymentPlan(), getDeploymentDescriptor(), body, toolkit, getStyle()));
managedForm.addPart(new SecurityAdvancedSection(getDeploymentPlan(), body, toolkit, getStyle()));
}

Expand Down
Expand Up @@ -26,7 +26,6 @@
import org.apache.geronimo.st.ui.CommonMessages;
import org.apache.geronimo.st.ui.sections.AbstractTableSection;
import org.apache.geronimo.st.v21.ui.Activator;
import org.apache.geronimo.st.v21.ui.wizards.DependencyAddWizard;
import org.apache.geronimo.st.v21.ui.wizards.DependencyWizard;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.IContentProvider;
Expand All @@ -40,10 +39,9 @@
*/
public class DependencySection extends AbstractTableSection {

boolean isServerEnvironment;
protected Environment environment;

protected boolean isServerEnvironment;

public DependencySection(JAXBElement plan, Environment environment, Composite parent, FormToolkit toolkit, int style) {
this(plan, environment, parent, toolkit, style, true);
}
Expand All @@ -53,7 +51,7 @@ public DependencySection(JAXBElement plan, Environment environment, Composite pa
this.environment = environment;
this.isServerEnvironment = isServerEnvironment;
this.COLUMN_NAMES = new String[] {
CommonMessages.groupId, CommonMessages.artifactId, CommonMessages.version, CommonMessages.type
CommonMessages.groupId, CommonMessages.artifactId, CommonMessages.version, CommonMessages.artifactType
};
createClient();
getSection().setExpanded(false);
Expand Down Expand Up @@ -89,14 +87,9 @@ private Dependencies getDependencies() {
return environment.getDependencies();
}

@Override
public Wizard getAddWizard() {
return new DependencyAddWizard(this);
}

@Override
public Wizard getWizard() {
return new DependencyWizard(this, isServerEnvironment);
return new DependencyWizard(this);
}

public ImageDescriptor getImageDescriptor() {
Expand Down
Expand Up @@ -39,7 +39,7 @@ public ExtModuleSection(JAXBElement plan, Composite parent, FormToolkit toolkit,
this.objectContainer = extModules;
COLUMN_NAMES = new String[] {
CommonMessages.moduleType, CommonMessages.path, CommonMessages.internalPath,
CommonMessages.groupId, CommonMessages.artifactId, CommonMessages.version, CommonMessages.type };
CommonMessages.groupId, CommonMessages.artifactId, CommonMessages.version, CommonMessages.artifactType };
createClient();
}

Expand Down

0 comments on commit 7d7ea5e

Please sign in to comment.