JBoss Tools SVN: r1975 - trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/packages.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-05-01 14:36:56 -0400 (Tue, 01 May 2007)
New Revision: 1975
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/packages/PreviewPage.java
Removed:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/packages/NewWARWizard.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/packages/WARInfoWizardPage.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/packages/NewEJBJARAction.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/packages/NewWARAction.java
Log:
remaking ejb and ear package types and wizards bc they don't work
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/packages/NewEJBJARAction.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/packages/NewEJBJARAction.java 2007-05-01 17:46:04 UTC (rev 1974)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/packages/NewEJBJARAction.java 2007-05-01 18:36:56 UTC (rev 1975)
@@ -1,26 +1,88 @@
package org.jboss.ide.eclipse.as.ui.packages;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.ui.IViewActionDelegate;
import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.PlatformUI;
+import org.jboss.ide.eclipse.archives.core.model.ArchivesCore;
+import org.jboss.ide.eclipse.archives.core.model.IArchive;
+import org.jboss.ide.eclipse.archives.core.model.IArchiveType;
+import org.jboss.ide.eclipse.archives.ui.ArchivesSharedImages;
+import org.jboss.ide.eclipse.archives.ui.views.ProjectArchivesView;
+import org.jboss.ide.eclipse.archives.ui.wizards.AbstractArchiveWizard;
+import org.jboss.ide.eclipse.as.ui.packages.NewWARAction.NewWARWizard;
import org.jboss.ide.eclipse.ui.util.ActionWithDelegate;
public class NewEJBJARAction extends ActionWithDelegate implements IViewActionDelegate {
- public NewEJBJARAction() {
- // TODO Auto-generated constructor stub
+ public void run() {
+ NewWARWizard wizard = new NewWARWizard();
+ wizard.init(PlatformUI.getWorkbench(), ProjectArchivesView.getInstance().getSelection());
+ WizardDialog dialog = new WizardDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), wizard);
+ dialog.open();
}
+
+ public ImageDescriptor getImageDescriptor() {
+ return ArchivesSharedImages.getImageDescriptor(ArchivesSharedImages.IMG_WAR);
+ }
+
+ public String getText() {
+ return "EJB JAR";
+ }
+
+ public String getToolTipText() {
+ return "Create a new EJB JAR archive";
+ }
+
+ public void init(IViewPart view) {
+
+ }
- public void run() {
- // TODO Auto-generated method stub
+ public static class NewEJBWizard extends AbstractArchiveWizard {
- }
+ private EjbJarPreviewPage ejbInfoPage;
+
+ public NewEJBWizard () {
+ setWindowTitle("New EJB JAR");
+ }
+
+ public ImageDescriptor getImageDescriptor() {
+ return null;
+ }
- /* (non-Javadoc)
- * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
- */
- public void init(IViewPart view) {
- // TODO Auto-generated method stub
+ public WizardPage[] createWizardPages() {
+ ejbInfoPage = new EjbJarPreviewPage(this);
+
+ return new WizardPage[] { ejbInfoPage };
+ }
+
+ public boolean performFinish(IArchive pkg) {
+ pkg.setArchiveType(ArchivesCore.getArchiveType(""));
+ return true;
+ }
+ public String getArchiveExtension() {
+ return "jar";
+ }
}
+
+ protected static class EjbJarPreviewPage extends PreviewPage {
+ protected EjbJarPreviewPage(NewEJBWizard wiz) {
+ super(wiz, "EJB JAR Preview", "EJB JAR Preview",
+ ArchivesSharedImages.getImageDescriptor(ArchivesSharedImages.IMG_NEW_JAR_WIZARD));
+ }
+ protected void addToPackage() {
+ IArchiveType type = ArchivesCore.getArchiveType("");
+ // fill please
+ }
+
+ protected String getDescriptionMessage() {
+ return "Preview the EJB JAR \n" +
+ "Later, you can customize this structure further.";
+ }
+ }
+
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/packages/NewWARAction.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/packages/NewWARAction.java 2007-05-01 17:46:04 UTC (rev 1974)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/packages/NewWARAction.java 2007-05-01 18:36:56 UTC (rev 1975)
@@ -1,13 +1,20 @@
package org.jboss.ide.eclipse.as.ui.packages;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.ui.IViewActionDelegate;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.PlatformUI;
+import org.jboss.ide.eclipse.archives.core.model.ArchivesCore;
+import org.jboss.ide.eclipse.archives.core.model.IArchive;
+import org.jboss.ide.eclipse.archives.core.model.IArchiveType;
import org.jboss.ide.eclipse.archives.ui.ArchivesSharedImages;
import org.jboss.ide.eclipse.archives.ui.views.ProjectArchivesView;
+import org.jboss.ide.eclipse.archives.ui.wizards.AbstractArchiveWizard;
+import org.jboss.ide.eclipse.as.core.packages.types.WarArchiveType;
import org.jboss.ide.eclipse.ui.util.ActionWithDelegate;
public class NewWARAction extends ActionWithDelegate implements IViewActionDelegate {
@@ -15,13 +22,8 @@
public void run() {
NewWARWizard wizard = new NewWARWizard();
wizard.init(PlatformUI.getWorkbench(), ProjectArchivesView.getInstance().getSelection());
-
WizardDialog dialog = new WizardDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), wizard);
- int response = dialog.open();
- if (response == Dialog.OK)
- {
-
- }
+ dialog.open();
}
public ImageDescriptor getImageDescriptor() {
@@ -33,10 +35,58 @@
}
public String getToolTipText() {
- return "Create a new WAR package";
+ return "Create a new WAR archive";
}
public void init(IViewPart view) {
}
+
+ public static class NewWARWizard extends AbstractArchiveWizard {
+
+ private WarPreviewPage warInfoPage;
+
+ public NewWARWizard ()
+ {
+ setWindowTitle("New WAR");
+ }
+
+ public ImageDescriptor getImageDescriptor() {
+ return null;
+ }
+
+ public WizardPage[] createWizardPages() {
+ warInfoPage = new WarPreviewPage(this);
+
+ return new WizardPage[] { warInfoPage };
+ }
+
+ public boolean performFinish(IArchive pkg) {
+ pkg.setArchiveType(ArchivesCore.getArchiveType(WarArchiveType.WAR_PACKAGE_TYPE));
+ return true;
+ }
+
+ public String getArchiveExtension() {
+ return "war";
+ }
+ }
+
+ protected static class WarPreviewPage extends PreviewPage {
+ protected WarPreviewPage(NewWARWizard wiz) {
+ super(wiz, "WAR information", "WAR Information",
+ ArchivesSharedImages.getImageDescriptor(ArchivesSharedImages.IMG_NEW_WAR_WIZARD));
+ }
+ protected void addToPackage() {
+ IArchiveType type = ArchivesCore.getArchiveType("org.jboss.ide.eclipse.as.core.packages.warPackage");
+ if( type instanceof WarArchiveType ) {
+ ((WarArchiveType)type).fillDefaultConfiguration(wizard.getProject(), wizard.getArchive(), new NullProgressMonitor());
+ }
+ }
+
+ protected String getDescriptionMessage() {
+ return "Information for the setup of your WAR. \n" +
+ "Later, you can customize this packaging structure further.";
+ }
+ }
+
}
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/packages/NewWARWizard.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/packages/NewWARWizard.java 2007-05-01 17:46:04 UTC (rev 1974)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/packages/NewWARWizard.java 2007-05-01 18:36:56 UTC (rev 1975)
@@ -1,37 +0,0 @@
-package org.jboss.ide.eclipse.as.ui.packages;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.wizard.WizardPage;
-import org.jboss.ide.eclipse.archives.core.model.ArchivesCore;
-import org.jboss.ide.eclipse.archives.core.model.IArchive;
-import org.jboss.ide.eclipse.archives.ui.wizards.AbstractArchiveWizard;
-
-public class NewWARWizard extends AbstractArchiveWizard {
-
- private WARInfoWizardPage warInfoPage;
-
- public NewWARWizard ()
- {
- setWindowTitle("New WAR");
- }
-
- public ImageDescriptor getImageDescriptor() {
- return null;
- }
-
- public WizardPage[] createWizardPages() {
- warInfoPage = new WARInfoWizardPage(this);
-
- return new WizardPage[] { warInfoPage };
- }
-
- public boolean performFinish(IArchive pkg) {
- pkg.setArchiveType(ArchivesCore.getArchiveType("org.jboss.ide.eclipse.as.core.packages.warPackage"));
- return true;
- }
-
- public String getArchiveExtension() {
- return "war";
- }
-
-}
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/packages/PreviewPage.java (from rev 1957, trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/packages/WARInfoWizardPage.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/packages/PreviewPage.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/packages/PreviewPage.java 2007-05-01 18:36:56 UTC (rev 1975)
@@ -0,0 +1,253 @@
+package org.jboss.ide.eclipse.as.ui.packages;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
+import org.eclipse.ui.ide.IDE;
+import org.eclipse.wst.server.core.IModuleArtifact;
+import org.eclipse.wst.server.core.internal.ServerPlugin;
+import org.jboss.ide.eclipse.archives.core.model.ArchivesCore;
+import org.jboss.ide.eclipse.archives.core.model.IArchive;
+import org.jboss.ide.eclipse.archives.core.model.IArchiveFolder;
+import org.jboss.ide.eclipse.archives.core.model.IArchiveType;
+import org.jboss.ide.eclipse.archives.ui.ArchivesSharedImages;
+import org.jboss.ide.eclipse.archives.ui.providers.ArchivesContentProvider;
+import org.jboss.ide.eclipse.archives.ui.providers.ArchivesLabelProvider;
+import org.jboss.ide.eclipse.archives.ui.wizards.AbstractArchiveWizard;
+import org.jboss.ide.eclipse.archives.ui.wizards.WizardPageWithNotification;
+import org.jboss.ide.eclipse.as.core.packages.types.WarArchiveType;
+
+public abstract class PreviewPage extends WizardPageWithNotification {
+
+ private Group previewGroup;
+ protected AbstractArchiveWizard wizard;
+ private TreeViewer previewViewer;
+ private boolean hasCreated = false;
+ public PreviewPage (AbstractArchiveWizard wizard, String name, String title, ImageDescriptor descriptor ) {
+ super( name, title, descriptor);
+ this.wizard = wizard;
+ }
+
+ protected abstract String getDescriptionMessage();
+ public void createControl(Composite parent) {
+
+ setMessage(getDescription());
+ Composite main = new Composite(parent, SWT.NONE);
+ main.setLayout(new FormLayout());
+
+ layoutGroups(main);
+ fillGroups();
+
+ setControl(main);
+ }
+ protected void layoutGroups(Composite main) {
+ previewGroup = new Group(main, SWT.NONE);
+ previewGroup.setText("Preview");
+ FormData previewData = new FormData();
+ previewData.left = new FormAttachment(0,5);
+ previewData.right = new FormAttachment(100,-5);
+ previewData.top = new FormAttachment(0,5);
+ previewData.bottom = new FormAttachment(100,-5);
+ previewGroup.setLayoutData(previewData);
+ previewGroup.setLayout(new FormLayout());
+ previewViewer = new TreeViewer(previewGroup);
+ previewViewer.setLabelProvider(new ArchivesLabelProvider());
+ previewViewer.setContentProvider(new ArchivesContentProvider());
+ FormData warPreviewData = new FormData();
+ warPreviewData.left = new FormAttachment(0,5);
+ warPreviewData.right = new FormAttachment(100,-5);
+ warPreviewData.top = new FormAttachment(0,5);
+ warPreviewData.bottom = new FormAttachment(100,-5);
+ previewViewer.getTree().setLayoutData(warPreviewData);
+
+ }
+
+ protected void fillGroups() {
+ }
+ public boolean isPageComplete() {
+ return hasCreated;
+ }
+ public void pageEntered(int button) {
+ if( !hasCreated ) {
+ addToPackage();
+ hasCreated = true;
+ }
+ fillWidgets(wizard.getArchive());
+
+ // if it's already a module type project, hide the meta inf stuff
+ IModuleArtifact moduleArtifact = ServerPlugin.loadModuleArtifact(wizard.getProject());
+ if( moduleArtifact.getModule() != null ) {
+ FormData d = (FormData)previewGroup.getLayoutData();
+ d.top = new FormAttachment(0,5);
+ previewGroup.setLayoutData(d);
+ ((Composite)getControl()).layout();
+ }
+ getWizard().getContainer().updateButtons();
+ }
+
+ protected abstract void addToPackage();
+ protected void fillWidgets(IArchive pkg) {
+ previewViewer.setInput(new IArchive[] {pkg});
+ previewViewer.expandAll();
+ }
+
+ protected IArchiveFolder getFolder(IArchive pkg, String folderName) {
+ IArchiveFolder result = null;
+ IArchiveFolder[] folders = pkg.getFolders();
+ for( int i = 0; i < folders.length; i++ ) {
+ if( folders[i].getName().equals(folderName)) {
+ result = folders[i];
+ break;
+ }
+ }
+ return result;
+ }
+
+ public void pageExited(int button) {}
+
+
+
+
+ // stuff that can be extracted
+ public static class WorkspaceFolderSelectionDialog extends ElementTreeSelectionDialog {
+
+ public WorkspaceFolderSelectionDialog(Shell parent, boolean allowMultiple, String selectedPaths) {
+ super(parent, new FolderLabelProvider(), new FolderContentProvider());
+ setAllowMultiple(allowMultiple);
+ setupDestinationList();
+ setupInitialSelections(selectedPaths);
+ }
+
+ private void setupDestinationList () {
+ List projects = Arrays.asList(ResourcesPlugin.getWorkspace().getRoot().getProjects());
+ setInput(projects);
+ }
+ private void setupInitialSelections(String initialSelection) {
+ ArrayList resources = new ArrayList();
+ String[] paths = initialSelection.split(",");
+ // find IResources
+ IResource res;
+ for( int i = 0; i < paths.length; i++ ) {
+ res = ResourcesPlugin.getWorkspace().getRoot().findMember(paths[i]);
+ resources.add(res);
+ }
+ setInitialSelections((IResource[]) resources.toArray(new IResource[resources.size()]));
+ }
+
+ private static class FolderContentProvider implements ITreeContentProvider {
+ private static final Object[] NO_CHILDREN = new Object[0];
+ public Object[] getChildren(Object parentElement) {
+ if (parentElement instanceof IContainer) {
+ IContainer container = (IContainer) parentElement;
+ try {
+ IResource members[] = container.members();
+ List folders = new ArrayList();
+ for (int i = 0; i < members.length; i++) {
+ if (members[i].getType() == IResource.FOLDER) folders.add(members[i]);
+ }
+ return folders.toArray();
+ } catch (CoreException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ return NO_CHILDREN;
+ }
+
+ public Object getParent(Object element) {
+ if (element instanceof IContainer) {
+ return ((IContainer) element).getParent();
+ }
+ return null;
+ }
+
+ public boolean hasChildren(Object element) {
+ if (element instanceof IContainer) {
+ IContainer container = (IContainer) element;
+ try {
+ IResource members[] = container.members();
+ List folders = new ArrayList();
+ for (int i = 0; i < members.length; i++) {
+ if (members[i].getType() == IResource.FOLDER) folders.add(members[i]);
+ }
+ return folders.size() > 0;
+ } catch (CoreException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ return false;
+ }
+
+ public Object[] getElements(Object inputElement) {
+ if (inputElement instanceof Collection)
+ return ((Collection)inputElement).toArray();
+
+ return NO_CHILDREN;
+ }
+
+ public void dispose() {}
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
+ }
+
+ public static class FolderLabelProvider implements ILabelProvider {
+ public FolderLabelProvider () {}
+ public Image getImage(Object element) {
+ if (element instanceof IProject) {
+ return PlatformUI.getWorkbench().getSharedImages().getImage(IDE.SharedImages.IMG_OBJ_PROJECT);
+ } else if (element instanceof IFolder) {
+ return PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_FOLDER);
+ }
+ return null;
+ }
+
+ public String getText(Object element) {
+ if (element instanceof IContainer) {
+ return ((IContainer)element).getName();
+ }
+ return "";
+ }
+
+ public void addListener(ILabelProviderListener listener) {
+ }
+
+ public void dispose() {
+ }
+
+ public boolean isLabelProperty(Object element, String property) {
+ return true;
+ }
+
+ public void removeListener(ILabelProviderListener listener) {
+ }
+
+ }
+ }
+
+}
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/packages/WARInfoWizardPage.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/packages/WARInfoWizardPage.java 2007-05-01 17:46:04 UTC (rev 1974)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/packages/WARInfoWizardPage.java 2007-05-01 18:36:56 UTC (rev 1975)
@@ -1,341 +0,0 @@
-package org.jboss.ide.eclipse.as.ui.packages;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.List;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.wst.server.core.IModuleArtifact;
-import org.eclipse.wst.server.core.internal.ServerPlugin;
-import org.jboss.ide.eclipse.archives.core.model.ArchivesCore;
-import org.jboss.ide.eclipse.archives.core.model.IArchive;
-import org.jboss.ide.eclipse.archives.core.model.IArchiveFileSet;
-import org.jboss.ide.eclipse.archives.core.model.IArchiveFolder;
-import org.jboss.ide.eclipse.archives.core.model.IArchiveType;
-import org.jboss.ide.eclipse.archives.ui.ArchivesSharedImages;
-import org.jboss.ide.eclipse.archives.ui.providers.ArchivesContentProvider;
-import org.jboss.ide.eclipse.archives.ui.providers.ArchivesLabelProvider;
-import org.jboss.ide.eclipse.archives.ui.wizards.WizardPageWithNotification;
-import org.jboss.ide.eclipse.as.core.packages.types.J2EEArchiveType;
-import org.jboss.ide.eclipse.as.core.packages.types.WarArchiveType;
-import org.jboss.ide.eclipse.as.ui.Messages;
-
-public class WARInfoWizardPage extends WizardPageWithNotification {
-
- private Group webinfGroup, previewGroup;
- private NewWARWizard wizard;
- private TreeViewer warPreview;
- private boolean hasCreated = false;
- private Text webinfFolders;
- private Button webinfFoldersButton;
- public WARInfoWizardPage (NewWARWizard wizard) {
- super("WAR information", "WAR Information", ArchivesSharedImages.getImageDescriptor(ArchivesSharedImages.IMG_NEW_WAR_WIZARD));
- this.wizard = wizard;
- }
-
- public void createControl(Composite parent) {
- setMessage("Information for the setup of your WAR. \n" +
- "Later, you can customize this packaging structure further.");
- Composite main = new Composite(parent, SWT.NONE);
- main.setLayout(new FormLayout());
-
- layoutGroups(main);
- fillGroups();
-
- setControl(main);
- }
- protected void layoutGroups(Composite main) {
- webinfGroup = new Group(main, SWT.NONE);
- FormData webinfData = new FormData();
- webinfData.left = new FormAttachment(0,5);
- webinfData.right = new FormAttachment(100,-5);
- webinfData.top = new FormAttachment(0,5);
- webinfGroup.setLayoutData(webinfData);
- webinfGroup.setText("WEB-INF Folders");
-
- previewGroup = new Group(main, SWT.NONE);
- previewGroup.setText("Preview");
- FormData previewData = new FormData();
- previewData.left = new FormAttachment(0,5);
- previewData.right = new FormAttachment(100,-5);
- previewData.top = new FormAttachment(webinfGroup,5);
- previewData.bottom = new FormAttachment(100,-5);
- previewGroup.setLayoutData(previewData);
- previewGroup.setLayout(new FormLayout());
- warPreview = new TreeViewer(previewGroup);
- warPreview.setLabelProvider(new ArchivesLabelProvider());
- warPreview.setContentProvider(new ArchivesContentProvider());
- FormData warPreviewData = new FormData();
- warPreviewData.left = new FormAttachment(0,5);
- warPreviewData.right = new FormAttachment(100,-5);
- warPreviewData.top = new FormAttachment(0,5);
- warPreviewData.bottom = new FormAttachment(100,-5);
- warPreview.getTree().setLayoutData(warPreviewData);
-
- }
-
- protected void fillGroups() {
- webinfGroup.setLayout(new FormLayout());
- webinfFolders = new Text(webinfGroup, SWT.BORDER | SWT.READ_ONLY);
- webinfFoldersButton = new Button(webinfGroup, SWT.PUSH);
- webinfFoldersButton.setText(Messages.browse);
-
- FormData buttonData = new FormData();
- buttonData.right = new FormAttachment(100,-5);
- webinfFoldersButton.setLayoutData(buttonData);
-
- FormData textData = new FormData();
- textData.left = new FormAttachment(0,5);
- textData.right = new FormAttachment(webinfFoldersButton, -5);
- webinfFolders.setLayoutData(textData);
-
- webinfFoldersButton.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- }
- public void widgetSelected(SelectionEvent e) {
- WorkspaceFolderSelectionDialog dialog = new WorkspaceFolderSelectionDialog(new Shell(), true, webinfFolders.getText());
- if( dialog.open() == Window.OK) {
- ArrayList selectedFolders = new ArrayList();
- Object[] o = dialog.getResult();
- for( int i = 0; i < o.length; i++ ) {
- selectedFolders.add(((IResource)o[i]).getFullPath().toOSString());
- }
-
- IArchiveFolder webinf = getFolder(wizard.getArchive(), J2EEArchiveType.WEBINF);
- IArchiveFileSet[] sets = webinf.getFileSets();
- for( int i = 0; i < sets.length; i++ ) {
- //String path = sets[i].getSourceContainer.getFullPath().toOSString();
- String path = sets[i].getSourcePath().toOSString();
- if( selectedFolders.contains(path)) {
- selectedFolders.remove(path); // already added
- } else {
- // remove ir
- webinf.removeChild(sets[i]);
- }
- }
- // add whatever's left as new filesets
- for( int i = 0; i < selectedFolders.size(); i++ ) {
- J2EEArchiveType.addFileset(wizard.getProject(),
- webinf, (String)selectedFolders.get(i), "**/*");
- }
- fillWidgets(wizard.getArchive());
- }
- }
- });
- }
- public boolean isPageComplete() {
- return hasCreated;
- }
- public void pageEntered(int button) {
- if( !hasCreated ) {
- addToPackage();
- hasCreated = true;
- }
- fillWidgets(wizard.getArchive());
-
- // if it's already a module type project, hide the meta inf stuff
- IModuleArtifact moduleArtifact = ServerPlugin.loadModuleArtifact(wizard.getProject());
- if( moduleArtifact.getModule() != null ) {
- webinfGroup.setVisible(false);
- FormData d = (FormData)previewGroup.getLayoutData();
- d.top = new FormAttachment(0,5);
- previewGroup.setLayoutData(d);
- ((Composite)getControl()).layout();
- }
- getWizard().getContainer().updateButtons();
- }
-
- protected void addToPackage() {
- // fill it
- IArchiveType type = ArchivesCore.getArchiveType("org.jboss.ide.eclipse.as.core.packages.warPackage");
- if( type instanceof WarArchiveType ) {
- ((WarArchiveType)type).fillDefaultConfiguration(wizard.getProject(), wizard.getArchive(), new NullProgressMonitor());
- }
- }
- protected void fillWidgets(IArchive pkg) {
- warPreview.setInput(new IArchive[] {pkg});
- warPreview.expandAll();
-
- fillWebinfText(pkg);
- }
-
- protected void fillWebinfText(IArchive pkg) {
- // set webinf text
- IArchiveFolder webinf = getFolder(pkg, J2EEArchiveType.WEBINF);
- String s = "";
- if( webinf != null ) {
- IArchiveFileSet[] filesets = webinf.getFileSets();
- for( int i = 0; i < filesets.length; i++ ) {
-// String path = filesets[i].getSourceContainer().getFullPath().toOSString();
- String path = filesets[i].getSourcePath().toOSString();
- s += path + ",";
- }
- if( s.length() > 0 )
- s = s.substring(0, s.length()-1);
- }
- webinfFolders.setText(s);
- }
-
- protected IArchiveFolder getFolder(IArchive pkg, String folderName) {
- IArchiveFolder result = null;
- IArchiveFolder[] folders = pkg.getFolders();
- for( int i = 0; i < folders.length; i++ ) {
- if( folders[i].getName().equals(folderName)) {
- result = folders[i];
- break;
- }
- }
- return result;
- }
-
- public void pageExited(int button) {}
-
-
-
-
- // stuff that can be extracted
- public static class WorkspaceFolderSelectionDialog extends ElementTreeSelectionDialog {
-
- public WorkspaceFolderSelectionDialog(Shell parent, boolean allowMultiple, String selectedPaths) {
- super(parent, new FolderLabelProvider(), new FolderContentProvider());
- setAllowMultiple(allowMultiple);
- setupDestinationList();
- setupInitialSelections(selectedPaths);
- }
-
- private void setupDestinationList () {
- List projects = Arrays.asList(ResourcesPlugin.getWorkspace().getRoot().getProjects());
- setInput(projects);
- }
- private void setupInitialSelections(String initialSelection) {
- ArrayList resources = new ArrayList();
- String[] paths = initialSelection.split(",");
- // find IResources
- IResource res;
- for( int i = 0; i < paths.length; i++ ) {
- res = ResourcesPlugin.getWorkspace().getRoot().findMember(paths[i]);
- resources.add(res);
- }
- setInitialSelections((IResource[]) resources.toArray(new IResource[resources.size()]));
- }
-
- private static class FolderContentProvider implements ITreeContentProvider {
- private static final Object[] NO_CHILDREN = new Object[0];
- public Object[] getChildren(Object parentElement) {
- if (parentElement instanceof IContainer) {
- IContainer container = (IContainer) parentElement;
- try {
- IResource members[] = container.members();
- List folders = new ArrayList();
- for (int i = 0; i < members.length; i++) {
- if (members[i].getType() == IResource.FOLDER) folders.add(members[i]);
- }
- return folders.toArray();
- } catch (CoreException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- return NO_CHILDREN;
- }
-
- public Object getParent(Object element) {
- if (element instanceof IContainer) {
- return ((IContainer) element).getParent();
- }
- return null;
- }
-
- public boolean hasChildren(Object element) {
- if (element instanceof IContainer) {
- IContainer container = (IContainer) element;
- try {
- IResource members[] = container.members();
- List folders = new ArrayList();
- for (int i = 0; i < members.length; i++) {
- if (members[i].getType() == IResource.FOLDER) folders.add(members[i]);
- }
- return folders.size() > 0;
- } catch (CoreException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- return false;
- }
-
- public Object[] getElements(Object inputElement) {
- if (inputElement instanceof Collection)
- return ((Collection)inputElement).toArray();
-
- return NO_CHILDREN;
- }
-
- public void dispose() {}
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
- }
-
- public static class FolderLabelProvider implements ILabelProvider {
- public FolderLabelProvider () {}
- public Image getImage(Object element) {
- if (element instanceof IProject) {
- return PlatformUI.getWorkbench().getSharedImages().getImage(IDE.SharedImages.IMG_OBJ_PROJECT);
- } else if (element instanceof IFolder) {
- return PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_FOLDER);
- }
- return null;
- }
-
- public String getText(Object element) {
- if (element instanceof IContainer) {
- return ((IContainer)element).getName();
- }
- return "";
- }
-
- public void addListener(ILabelProviderListener listener) {
- }
-
- public void dispose() {
- }
-
- public boolean isLabelProperty(Object element, String property) {
- return true;
- }
-
- public void removeListener(ILabelProviderListener listener) {
- }
-
- }
- }
-
-}
17 years, 8 months
JBoss Tools SVN: r1974 - in trunk/as/plugins/org.jboss.ide.eclipse.as.core: jbosscore/org/jboss/ide/eclipse/as/core/runtime/internal and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-05-01 13:46:04 -0400 (Tue, 01 May 2007)
New Revision: 1974
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/internal/WebtoolsProjectJBossClasspathContainerInitializer.java
Log:
ejb.ui now depends on as.core. That should be the only dependency between as and ejb.
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF 2007-05-01 17:46:01 UTC (rev 1973)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF 2007-05-01 17:46:04 UTC (rev 1974)
@@ -18,8 +18,7 @@
org.eclipse.wst.common.project.facet.core,
org.eclipse.jst.common.project.facet.core,
org.eclipse.wst.xml.core,
- org.jboss.ide.eclipse.archives.core,
- org.jboss.ide.eclipse.ejb3.wizards.core
+ org.jboss.ide.eclipse.archives.core
Eclipse-LazyStart: true
Export-Package: org.jboss.ide.eclipse.as.core,
org.jboss.ide.eclipse.as.core.model,
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/internal/WebtoolsProjectJBossClasspathContainerInitializer.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/internal/WebtoolsProjectJBossClasspathContainerInitializer.java 2007-05-01 17:46:01 UTC (rev 1973)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/internal/WebtoolsProjectJBossClasspathContainerInitializer.java 2007-05-01 17:46:04 UTC (rev 1974)
@@ -134,12 +134,12 @@
if( facetId.equals(JST_JAVA_FACET.getId())) {
return loadJREClasspathEntries(jbsRuntime);
} else if( jbVersion.equals("4.2")) {
- return loadClasspathEntries42(runtimeId, facetId, facetVersion, serverHome, configName);
+ return loadClasspathEntries42(facetId, facetVersion, serverHome, configName);
} else if( jbVersion.equals("4.0"))
- return loadClasspathEntries40(runtimeId, facetId, facetVersion, serverHome, configName);
+ return loadClasspathEntries40(facetId, facetVersion, serverHome, configName);
if( jbVersion.equals("3.2"))
- return loadClasspathEntries32(runtimeId, facetId, facetVersion, serverHome, configName);
- return loadClasspathEntriesDefault(runtimeId, facetId, facetVersion, serverHome, configName);
+ return loadClasspathEntries32( facetId, facetVersion, serverHome, configName);
+ return loadClasspathEntriesDefault(facetId, facetVersion, serverHome, configName);
}
protected boolean isEjb30(String facetId, String facetVersion) {
@@ -164,7 +164,7 @@
return null;
}
- protected IClasspathEntry[] loadClasspathEntries42(String runtimeId, String facetId, String facetVersion, String serverHome, String configName) {
+ protected IClasspathEntry[] loadClasspathEntries42(String facetId, String facetVersion, String serverHome, String configName) {
IPath homePath = new Path(serverHome);
IPath configPath = homePath.append("server").append(configName);
ArrayList list = new ArrayList();
@@ -199,7 +199,7 @@
return (IClasspathEntry[]) list.toArray(new IClasspathEntry[list.size()]);
}
- protected IClasspathEntry[] loadClasspathEntries40(String runtimeId, String facetId, String facetVersion, String serverHome, String configName) {
+ protected IClasspathEntry[] loadClasspathEntries40(String facetId, String facetVersion, String serverHome, String configName) {
IPath homePath = new Path(serverHome);
IPath configPath = homePath.append("server").append(configName);
ArrayList list = new ArrayList();
@@ -235,7 +235,7 @@
}
- protected IClasspathEntry[] loadClasspathEntries32(String runtimeId, String facetId, String facetVersion, String serverHome, String configName) {
+ protected IClasspathEntry[] loadClasspathEntries32(String facetId, String facetVersion, String serverHome, String configName) {
IPath homePath = new Path(serverHome);
IPath configPath = homePath.append("server").append(configName);
ArrayList list = new ArrayList();
@@ -243,17 +243,24 @@
IPath p = configPath.append("deploy").append("jbossweb-tomcat50.sar");
list.add(getEntry(p.append("jsp-api.jar")));
list.add(getEntry(p.append("servlet-api.jar")));
- } else if( facetId.equals(EJB_FACET.getId()) || facetId.equals(EAR_FACET.getId()) ) {
+ } else if( (facetId.equals(EJB_FACET.getId()) && !isEjb30(facetId, facetVersion))
+ || facetId.equals(EAR_FACET.getId()) ) {
list.add(getEntry(homePath.append("client").append("jboss-j2ee.jar")));
} else if( facetId.equals(APP_CLIENT_FACET.getId())) {
list.add(getEntry(homePath.append("client").append("jbossall-client.jar")));
}
return (IClasspathEntry[]) list.toArray(new IClasspathEntry[list.size()]);
}
- protected IClasspathEntry[] loadClasspathEntriesDefault(String runtimeId, String facetId, String facetVersion, String serverHome, String configName) {
+ protected IClasspathEntry[] loadClasspathEntriesDefault(String facetId, String facetVersion, String serverHome, String configName) {
return new IClasspathEntry[0];
}
+ protected IClasspathEntry[] pathsAsEntries(IPath[] paths) {
+ IClasspathEntry[] entries = new IClasspathEntry[paths.length];
+ for( int i = 0; i < paths.length; i++ )
+ entries[i] = getEntry(paths[i]);
+ return entries;
+ }
}
17 years, 8 months
JBoss Tools SVN: r1973 - trunk/as/plugins/org.jboss.ide.eclipse.as.ui/META-INF.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-05-01 13:46:01 -0400 (Tue, 01 May 2007)
New Revision: 1973
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/META-INF/MANIFEST.MF
Log:
ejb.ui now depends on as.core. That should be the only dependency between as and ejb.
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/META-INF/MANIFEST.MF 2007-05-01 17:45:58 UTC (rev 1972)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/META-INF/MANIFEST.MF 2007-05-01 17:46:01 UTC (rev 1973)
@@ -23,7 +23,6 @@
org.eclipse.debug.core,
org.eclipse.debug.ui,
org.eclipse.ui.views,
- org.jboss.ide.eclipse.as.core,
org.eclipse.ui.editors,
org.eclipse.ui.workbench.texteditor,
org.eclipse.wst.xml.ui,
@@ -52,9 +51,10 @@
org.eclipse.jst.ws.axis.creation.ui,
org.eclipse.wst.ws,
org.eclipse.wst.ws.ui,
+ org.apache.ant,
+ org.jboss.ide.eclipse.as.core,
org.jboss.ide.eclipse.firstrun,
org.jboss.ide.eclipse.ui,
- org.apache.ant,
org.jboss.ide.eclipse.archives.core,
org.jboss.ide.eclipse.archives.ui
Eclipse-LazyStart: true
17 years, 8 months
JBoss Tools SVN: r1972 - trunk/ejb3/plugins/org.jboss.ide.eclipse.ejb3.wizards.core/src/main/org/jboss/ide/eclipse/ejb3/core/facet.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-05-01 13:45:58 -0400 (Tue, 01 May 2007)
New Revision: 1972
Modified:
trunk/ejb3/plugins/org.jboss.ide.eclipse.ejb3.wizards.core/src/main/org/jboss/ide/eclipse/ejb3/core/facet/Ejb30FacetProjectCreationDataModelProvider.java
Log:
ejb.ui now depends on as.core. That should be the only dependency between as and ejb.
Modified: trunk/ejb3/plugins/org.jboss.ide.eclipse.ejb3.wizards.core/src/main/org/jboss/ide/eclipse/ejb3/core/facet/Ejb30FacetProjectCreationDataModelProvider.java
===================================================================
--- trunk/ejb3/plugins/org.jboss.ide.eclipse.ejb3.wizards.core/src/main/org/jboss/ide/eclipse/ejb3/core/facet/Ejb30FacetProjectCreationDataModelProvider.java 2007-05-01 17:45:57 UTC (rev 1971)
+++ trunk/ejb3/plugins/org.jboss.ide.eclipse.ejb3.wizards.core/src/main/org/jboss/ide/eclipse/ejb3/core/facet/Ejb30FacetProjectCreationDataModelProvider.java 2007-05-01 17:45:58 UTC (rev 1972)
@@ -2,6 +2,8 @@
import java.util.ArrayList;
import java.util.Collection;
+import java.util.List;
+import java.util.Map;
import org.eclipse.jst.common.project.facet.IJavaFacetInstallDataModelProperties;
import org.eclipse.jst.common.project.facet.JavaFacetInstallDataModelProvider;
@@ -16,6 +18,8 @@
import org.eclipse.wst.common.frameworks.datamodel.IDataModelListener;
import org.eclipse.wst.common.project.facet.core.IProjectFacet;
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+import org.eclipse.wst.common.project.facet.core.runtime.IRuntime;
+import org.eclipse.wst.server.core.ServerCore;
public class Ejb30FacetProjectCreationDataModelProvider extends J2EEFacetProjectCreationDataModelProvider {
@@ -60,42 +64,34 @@
}
public DataModelPropertyDescriptor[] getValidPropertyDescriptors(String propertyName) {
-// if (FACET_RUNTIME.equals(propertyName)) {
-// DataModelPropertyDescriptor[] descriptors = super.getValidPropertyDescriptors(propertyName);
-// List list = new ArrayList();
-// for (int i = 0; i < descriptors.length; i++) {
-// IRuntime rt = (IRuntime) descriptors[i].getPropertyValue();
-// if( rt == null ) continue;
-// Map properties = rt.getProperties();
-// String id = (String)properties.get("id");
-// org.eclipse.wst.server.core.IRuntime wstRuntime = ServerCore.findRuntime(id);
-// try {
+ if (FACET_RUNTIME.equals(propertyName)) {
+ DataModelPropertyDescriptor[] descriptors = super.getValidPropertyDescriptors(propertyName);
+ List list = new ArrayList();
+ for (int i = 0; i < descriptors.length; i++) {
+ IRuntime rt = (IRuntime) descriptors[i].getPropertyValue();
+ if( rt == null ) continue;
+ Map properties = rt.getProperties();
+ String id = (String)properties.get("id");
+ org.eclipse.wst.server.core.IRuntime wstRuntime = ServerCore.findRuntime(id);
+ if( wstRuntime != null ) {
// AbstractJBossServerRuntime jbrt = (AbstractJBossServerRuntime) wstRuntime.getAdapter(AbstractJBossServerRuntime.class);
-// if( hasEJB3(jbrt)) {
+// if( jbrt != null ) {
// list.add(descriptors[i]);
+// } else { // it's not a jboss runtime and it claims to support jbide.ejb30
+// list.add(descriptors[i]);
// }
-// } catch( Exception e ) {
-// e.printStackTrace();
-// }
-// }
-// descriptors = new DataModelPropertyDescriptor[list.size()];
-// for (int i = 0; i < descriptors.length; i++) {
-// descriptors[i] = (DataModelPropertyDescriptor) list.get(i);
-// }
-// return descriptors;
-// }
+ list.add(descriptors[i]);
+ }
+ }
+ descriptors = new DataModelPropertyDescriptor[list.size()];
+ for (int i = 0; i < descriptors.length; i++) {
+ descriptors[i] = (DataModelPropertyDescriptor) list.get(i);
+ }
+ return descriptors;
+ }
return super.getValidPropertyDescriptors(propertyName);
}
-// protected boolean hasEJB3(AbstractJBossServerRuntime jbrt) {
-// IPath jarToCheck = EJB3ClasspathContainer.jbossConfigRelativeJarPaths[0];
-//
-// String jbossBaseDir = jbrt.getRuntime().getLocation().toOSString();
-// String jbossConfigDir = jbrt.getJBossConfiguration();
-// IPath absoluteJarPath = new Path(jbossBaseDir).append("server").append(jbossConfigDir).append(jarToCheck);
-// return absoluteJarPath.toFile().exists();
-// }
-
}
17 years, 8 months
JBoss Tools SVN: r1971 - in trunk/ejb3/plugins/org.jboss.ide.eclipse.ejb3.wizards.ui: src/main/org/jboss/ide/eclipse/ejb3/ui/wizards and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-05-01 13:45:57 -0400 (Tue, 01 May 2007)
New Revision: 1971
Modified:
trunk/ejb3/plugins/org.jboss.ide.eclipse.ejb3.wizards.ui/META-INF/MANIFEST.MF
trunk/ejb3/plugins/org.jboss.ide.eclipse.ejb3.wizards.ui/src/main/org/jboss/ide/eclipse/ejb3/ui/wizards/Ejb30ProjectFirstPage.java
Log:
ejb.ui now depends on as.core. That should be the only dependency between as and ejb.
Modified: trunk/ejb3/plugins/org.jboss.ide.eclipse.ejb3.wizards.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/ejb3/plugins/org.jboss.ide.eclipse.ejb3.wizards.ui/META-INF/MANIFEST.MF 2007-05-01 16:00:42 UTC (rev 1970)
+++ trunk/ejb3/plugins/org.jboss.ide.eclipse.ejb3.wizards.ui/META-INF/MANIFEST.MF 2007-05-01 17:45:57 UTC (rev 1971)
@@ -43,5 +43,6 @@
org.eclipse.jdt.launching,
org.eclipse.ui.ide,
org.eclipse.jface.databinding,
- org.jboss.ide.eclipse.ejb3.wizards.core
+ org.jboss.ide.eclipse.ejb3.wizards.core,
+ org.jboss.ide.eclipse.as.core
Eclipse-LazyStart: true
Modified: trunk/ejb3/plugins/org.jboss.ide.eclipse.ejb3.wizards.ui/src/main/org/jboss/ide/eclipse/ejb3/ui/wizards/Ejb30ProjectFirstPage.java
===================================================================
--- trunk/ejb3/plugins/org.jboss.ide.eclipse.ejb3.wizards.ui/src/main/org/jboss/ide/eclipse/ejb3/ui/wizards/Ejb30ProjectFirstPage.java 2007-05-01 16:00:42 UTC (rev 1970)
+++ trunk/ejb3/plugins/org.jboss.ide.eclipse.ejb3.wizards.ui/src/main/org/jboss/ide/eclipse/ejb3/ui/wizards/Ejb30ProjectFirstPage.java 2007-05-01 17:45:57 UTC (rev 1971)
@@ -4,13 +4,13 @@
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
-import java.util.Set;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jst.j2ee.internal.wizard.J2EEComponentFacetCreationWizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
@@ -19,22 +19,20 @@
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetProjectCreationDataModelProperties;
import org.eclipse.wst.common.frameworks.datamodel.DataModelPropertyDescriptor;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
import org.eclipse.wst.common.project.facet.core.runtime.IRuntime;
-import org.eclipse.wst.common.project.facet.core.runtime.internal.RuntimeComponent;
-import org.eclipse.wst.common.project.facet.core.runtime.internal.RuntimeManagerImpl;
import org.eclipse.wst.project.facet.ProductManager;
+import org.eclipse.wst.server.core.ServerCore;
import org.eclipse.wst.web.internal.ResourceHandler;
-import org.eclipse.wst.web.ui.internal.wizards.DataModelFacetCreationWizardPage;
+import org.jboss.ide.eclipse.as.core.runtime.server.AbstractJBossServerRuntime;
+import org.jboss.ide.eclipse.as.core.util.EJB30SupportVerifier;
public class Ejb30ProjectFirstPage extends J2EEComponentFacetCreationWizardPage {
public static final String EJB30_FACET_ID = "jbide.ejb30";
-
+ private Label warningLabel;
+
protected String getModuleFacetID() {
return EJB30_FACET_ID;
}
@@ -116,13 +114,33 @@
}
});
- Label label = new Label(group, SWT.NONE);
- label.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
- label.setText("Warning: Make sure you're creating a runtime that supports ejb3.0.");
+ warningLabel = new Label(group, SWT.NONE);
+ warningLabel.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
+ warningLabel.setText("Warning: The selected runtime is missing one or more required libraries");
+ warningLabel.setVisible(false);
+ serverTargetCombo.addSelectionListener(new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+
+ public void widgetSelected(SelectionEvent e) {
+ hideOrShowWarning();
+ }
+ } );
+
Control[] deps = new Control[]{newServerTargetButton};
synchHelper.synchCombo(serverTargetCombo, FACET_RUNTIME, deps);
if (serverTargetCombo.getSelectionIndex() == -1 && serverTargetCombo.getVisibleItemCount() != 0)
serverTargetCombo.select(0);
+
+ hideOrShowWarning();
}
+
+ protected void hideOrShowWarning() {
+ int index = serverTargetCombo.getSelectionIndex();
+ String runtimeName = serverTargetCombo.getItem(index);
+ org.eclipse.wst.server.core.IRuntime rt = ServerCore.findRuntime(runtimeName);
+ warningLabel.setVisible(!EJB30SupportVerifier.verify(rt));
+ }
}
\ No newline at end of file
17 years, 8 months
JBoss Tools SVN: r1970 - trunk/core/plugins/org.jboss.ide.eclipse.archives.core.
by jbosstools-commits@lists.jboss.org
Author: mculpepper(a)jboss.com
Date: 2007-05-01 12:00:42 -0400 (Tue, 01 May 2007)
New Revision: 1970
Modified:
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/build.properties
Log:
log4j.xml should've been in the build.properties EXIN-134
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/build.properties
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/build.properties 2007-04-30 22:30:13 UTC (rev 1969)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/build.properties 2007-05-01 16:00:42 UTC (rev 1970)
@@ -7,7 +7,8 @@
LICENSE-truezip.txt,\
lib/xercesImpl.jar,\
lib/jboss-common-4.0.4.jar,\
- lib/jbossxb-1.0.1.TEST.jar
+ lib/jbossxb-1.0.1.TEST.jar,\
+ log4j.xml
source.packagescore.jar = src/main/
src.includes = LICENSE-truezip.txt,\
src/,\
17 years, 8 months