JBoss Tools SVN: r3711 - branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2007-09-19 08:26:36 -0400 (Wed, 19 Sep 2007)
New Revision: 3711
Modified:
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
Log:
code adjustment
Modified: branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
===================================================================
--- branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2007-09-19 11:09:29 UTC (rev 3710)
+++ branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2007-09-19 12:26:36 UTC (rev 3711)
@@ -10,7 +10,6 @@
******************************************************************************/
package org.jboss.tools.vpe.editor;
-import java.util.Iterator;
import java.util.List;
import java.util.Properties;
@@ -23,9 +22,6 @@
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.bindings.Binding;
-import org.eclipse.jface.bindings.keys.KeySequence;
-import org.eclipse.jface.bindings.keys.KeyStroke;
import org.eclipse.jface.text.ITextSelection;
import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.jface.viewers.ISelection;
@@ -55,10 +51,7 @@
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.actions.ActionFactory;
-import org.eclipse.ui.internal.keys.WorkbenchKeyboard;
-import org.eclipse.ui.keys.IBindingService;
import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
import org.eclipse.wst.sse.core.internal.model.ModelLifecycleEvent;
import org.eclipse.wst.sse.core.internal.provisional.IModelLifecycleListener;
@@ -867,30 +860,6 @@
keyboardEvent.keyCode=(int)keyEvent.getKeyCode();
}
- //for maximaze/minimaze command(CTRL+M), we shouldn't call event listeners
- List<?> possibleKeyStrokes = WorkbenchKeyboard.generatePossibleKeyStrokes(keyboardEvent);
- IWorkbench iWorkbench = VpePlugin.getDefault().getWorkbench();
- if(iWorkbench.hasService(IBindingService.class)){
- IBindingService iBindingService = (IBindingService) iWorkbench.getService(IBindingService.class);
-
- KeySequence sequenceBeforeKeyStroke = KeySequence.getInstance();
- for (Iterator<?> iterator = possibleKeyStrokes.iterator(); iterator
- .hasNext();){
- KeySequence sequenceAfterKeyStroke = KeySequence.getInstance(
- sequenceBeforeKeyStroke, (KeyStroke) iterator.next());
- if(iBindingService.isPerfectMatch(sequenceAfterKeyStroke)){
- final Binding binding = iBindingService.getPerfectMatch(sequenceAfterKeyStroke);
-
- if((binding!=null)
- && (binding.getParameterizedCommand()!=null)
- && (binding.getParameterizedCommand().getCommand()!=null)
- && (binding.getParameterizedCommand().getCommand().getId()!=null)
- &&binding.getParameterizedCommand().getCommand().getId().equals(VpeController.MAXIMAZE_PART_ID)){
- keyboardEvent.type = SWT.NONE;
- }
- }
- }
- }
//sends xulrunner event to eclipse environment
getXulRunnerEditor().getBrowser().notifyListeners(keyboardEvent.type, keyboardEvent);
17 years, 3 months
JBoss Tools SVN: r3710 - trunk/documentation/qa.
by jbosstools-commits@lists.jboss.org
Author: anis
Date: 2007-09-19 07:09:29 -0400 (Wed, 19 Sep 2007)
New Revision: 3710
Removed:
trunk/documentation/qa/coverage13092007.zip
Log:
Removed file/folder
Deleted: trunk/documentation/qa/coverage13092007.zip
===================================================================
(Binary files differ)
17 years, 3 months
JBoss Tools SVN: r3709 - trunk/documentation/qa/emma/reports.
by jbosstools-commits@lists.jboss.org
Author: anis
Date: 2007-09-19 07:08:55 -0400 (Wed, 19 Sep 2007)
New Revision: 3709
Added:
trunk/documentation/qa/emma/reports/QAcoverage13092007.zip
Log:
Copied remotely
Copied: trunk/documentation/qa/emma/reports/QAcoverage13092007.zip (from rev 3708, trunk/documentation/qa/coverage13092007.zip)
===================================================================
(Binary files differ)
17 years, 3 months
JBoss Tools SVN: r3708 - trunk/documentation/qa.
by jbosstools-commits@lists.jboss.org
Author: viktor_volkov
Date: 2007-09-19 07:05:04 -0400 (Wed, 19 Sep 2007)
New Revision: 3708
Removed:
trunk/documentation/qa/QA test report Build RF3.1.0 RC1.xls
trunk/documentation/qa/QA test report Build RF3.1.0 RC2.xls
trunk/documentation/qa/QA test report Build RF3.1.0 RC3.xls
trunk/documentation/qa/QA test report Build RF3.1.0 RC4.xls
trunk/documentation/qa/QA test report Build RF3.1.0 RC5.xls
trunk/documentation/qa/QA test report JSF1.1RI and JSF 1.2.xls
Log:
Deleted: trunk/documentation/qa/QA test report Build RF3.1.0 RC1.xls
===================================================================
(Binary files differ)
Deleted: trunk/documentation/qa/QA test report Build RF3.1.0 RC2.xls
===================================================================
(Binary files differ)
Deleted: trunk/documentation/qa/QA test report Build RF3.1.0 RC3.xls
===================================================================
(Binary files differ)
Deleted: trunk/documentation/qa/QA test report Build RF3.1.0 RC4.xls
===================================================================
(Binary files differ)
Deleted: trunk/documentation/qa/QA test report Build RF3.1.0 RC5.xls
===================================================================
(Binary files differ)
Deleted: trunk/documentation/qa/QA test report JSF1.1RI and JSF 1.2.xls
===================================================================
(Binary files differ)
17 years, 3 months
JBoss Tools SVN: r3707 - trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2007-09-19 06:11:30 -0400 (Wed, 19 Sep 2007)
New Revision: 3707
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/TaggedComboFieldEditor.java
Log:
JBIDE-918
don't call .toString() on defaultValue (might be null)
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/TaggedComboFieldEditor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/TaggedComboFieldEditor.java 2007-09-19 09:53:31 UTC (rev 3706)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/TaggedComboFieldEditor.java 2007-09-19 10:11:30 UTC (rev 3707)
@@ -34,7 +34,7 @@
this.values = Collections.unmodifiableList(values);
this.floatStyle = floatStyle;
combo = new ComboFieldEditor(
- name,label,values,defaultValue.toString(),floatStyle);
+ name,label,values,defaultValue,floatStyle);
addFieldEditors(new IFieldEditor[]{new LabelFieldEditor(name,label),
combo});
}
17 years, 3 months
JBoss Tools SVN: r3706 - trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2007-09-19 05:53:31 -0400 (Wed, 19 Sep 2007)
New Revision: 3706
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/ClassLoaderHelper.java
Log:
remove noisy system.out classpath scanning
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/ClassLoaderHelper.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/ClassLoaderHelper.java 2007-09-19 08:42:59 UTC (rev 3705)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/ClassLoaderHelper.java 2007-09-19 09:53:31 UTC (rev 3706)
@@ -153,10 +153,10 @@
if (location != null) {
userEntries.add(location);
} else {
- System.out.println("No location: " + runtimeClasspathEntry.getMemento());
+ //System.out.println("No location: " + runtimeClasspathEntry.getMemento());
}
} else {
- System.out.println("Ignored " + runtimeClasspathEntry.getMemento());
+ //System.out.println("Ignored " + runtimeClasspathEntry.getMemento());
}
}
return (String[]) userEntries.toArray(new String[userEntries.size()]);
17 years, 3 months
JBoss Tools SVN: r3705 - trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2007-09-19 04:42:59 -0400 (Wed, 19 Sep 2007)
New Revision: 3705
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/ValidatorFactory.java
Log:
tell why seam folder cannot be used.
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/ValidatorFactory.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/ValidatorFactory.java 2007-09-19 08:38:34 UTC (rev 3704)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/ValidatorFactory.java 2007-09-19 08:42:59 UTC (rev 3705)
@@ -143,8 +143,8 @@
if (!new File(value.toString(), "seam").isFile()) {
errors = createErrorMap();
errors.put(ISeamFacetDataModelProperties.JBOSS_SEAM_HOME,
- "Seam Home Folde field points to " +
- "location that doesn't look like seam home folder");
+ "Home folder points to " +
+ "location that does not look like seam home folder ('seam' script is missing)");
}
return errors;
}
17 years, 3 months
JBoss Tools SVN: r3704 - trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2007-09-19 04:38:34 -0400 (Wed, 19 Sep 2007)
New Revision: 3704
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/SeamRuntimeListFieldEditor.java
Log:
tell user what is incorrect about seam runtime name.
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/SeamRuntimeListFieldEditor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/SeamRuntimeListFieldEditor.java 2007-09-19 07:26:17 UTC (rev 3703)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/SeamRuntimeListFieldEditor.java 2007-09-19 08:38:34 UTC (rev 3704)
@@ -351,7 +351,7 @@
}
if(!name.getValueAsString().matches("[a-zA-Z_][a-zA-Z0-9_\\-\\.]*")) {
- setErrorMessage("Runtime name is not correct");
+ setErrorMessage("Runtime name contain invalid characters, e.g. space is not allowed");
setPageComplete(false);
return;
}
17 years, 3 months
JBoss Tools SVN: r3703 - in trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui: widget/editor and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2007-09-19 03:26:17 -0400 (Wed, 19 Sep 2007)
New Revision: 3703
Removed:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/SeamComponentsView.java
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/SeamRuntimeListFieldEditor.java
Log:
http://jira.jboss.org/jira/browse/JBIDE-848
fix errors under linux.
I found that for some reasons project.localRefresh doesen't works well for Linux, so after creating projects the natures are not loaded, that's why ejb,ear and test projects look like General projects.
Now Import operation is used and it works even during workspace is locked by running new wizard.
Deleted: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/SeamComponentsView.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/SeamComponentsView.java 2007-09-19 07:26:13 UTC (rev 3702)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/SeamComponentsView.java 2007-09-19 07:26:17 UTC (rev 3703)
@@ -1,342 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.seam.ui.views;
-
-import java.util.ArrayList;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerSorter;
-import org.eclipse.jst.j2ee.web.componentcore.util.WebArtifactEdit;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.DrillDownAdapter;
-import org.eclipse.ui.part.ViewPart;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.ModuleCoreNature;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
-
-
-public class SeamComponentsView extends ViewPart {
- private TreeViewer viewer;
- private DrillDownAdapter drillDownAdapter;
- private Action action1;
- private Action action2;
- private Action doubleClickAction;
-
- /*
- * The content provider class is responsible for
- * providing objects to the view. It can wrap
- * existing objects in adapters or simply return
- * objects as-is. These objects may be sensitive
- * to the current input of the view, or ignore
- * it and always show the same content
- * (like Task List, for example).
- */
-
- class TreeObject implements IAdaptable {
- private String name;
- private TreeParent parent;
-
- public TreeObject(String name) {
- this.name = name;
- }
- public String getName() {
- return name;
- }
- public void setParent(TreeParent parent) {
- this.parent = parent;
- }
- public TreeParent getParent() {
- return parent;
- }
- public String toString() {
- return getName();
- }
- public Object getAdapter(Class key) {
- return null;
- }
- }
-
- class TreeParent extends TreeObject {
- private ArrayList children;
- public TreeParent(String name) {
- super(name);
- children = new ArrayList();
- }
- public void addChild(TreeObject child) {
- children.add(child);
- child.setParent(this);
- }
- public void removeChild(TreeObject child) {
- children.remove(child);
- child.setParent(null);
- }
- public TreeObject [] getChildren() {
- return (TreeObject [])children.toArray(new TreeObject[children.size()]);
- }
- public boolean hasChildren() {
- return children.size()>0;
- }
- }
-
- class ViewContentProvider implements IStructuredContentProvider,
- ITreeContentProvider {
- private TreeParent invisibleRoot;
-
- public void inputChanged(Viewer v, Object oldInput, Object newInput) {
- }
- public void dispose() {
- }
- public Object[] getElements(Object parent) {
- if (parent.equals(getViewSite())) {
- if (invisibleRoot==null) initialize();
- return getChildren(invisibleRoot);
- }
- return getChildren(parent);
- }
- public Object getParent(Object child) {
- if (child instanceof TreeObject) {
- return ((TreeObject)child).getParent();
- }
- return null;
- }
- public Object [] getChildren(Object parent) {
- if (parent instanceof TreeParent) {
- return ((TreeParent)parent).getChildren();
- }
- return new Object[0];
- }
- public boolean hasChildren(Object parent) {
- if (parent instanceof TreeParent)
- return ((TreeParent)parent).hasChildren();
- return false;
- }
-/*
- * We will set up a dummy model to initialize tree heararchy.
- * In a real code, you will connect to a real model and
- * expose its hierarchy.
- */
- private void initialize() {
- TreeParent to1 = new TreeParent("Conetx Variable 1");
- TreeObject class1 = new TreeObject("org.domain.package.Class1");
- TreeObject class2 = new TreeObject("org.domain.package.Class2");
- TreeObject role1 = new TreeObject("role1");
- TreeObject xml1 = new TreeObject("component.xml");
- TreeObject xml2 = new TreeObject("Class3.component.xml");
- to1.addChild(class1);
- to1.addChild(class2);
- to1.addChild(xml1);
- to1.addChild(xml2);
- to1.addChild(role1);
-
- TreeParent to2 = new TreeParent("Conetx Variable 2");
- TreeParent to3 = new TreeParent("Conetx Variable 3");
- TreeParent stateless = new TreeParent("STATELESS");
- stateless.addChild(to1);
- stateless.addChild(to2);
- stateless.addChild(to3);
-
- TreeObject to4 = new TreeParent("Conetx Variable 4");
- TreeParent method = new TreeParent("METHOD");
- method.addChild(to4);
-
- TreeParent event = new TreeParent("EVENT");
-
- TreeParent page = new TreeParent("PAGE");
- TreeParent conversation = new TreeParent("CONVERSATION");
- TreeParent session = new TreeParent("SESSION");
- TreeParent app = new TreeParent("APPLICATION");
- TreeParent bp = new TreeParent("BUSINESS_PROCESS");
- TreeParent unspec = new TreeParent("UNSPECIFIED");
-
- TreeParent root1 = new TreeParent("Seam Project 1");
-
- TreeParent root2 = new TreeParent("Seam Project 2");
-
- root1.addChild(stateless);
- root1.addChild(method);
- root1.addChild(event);
- root1.addChild(page);
- root1.addChild(conversation);
- root1.addChild(session);
- root1.addChild(app);
- root1.addChild(bp);
- root1.addChild(unspec);
-
- invisibleRoot = new TreeParent("");
- invisibleRoot.addChild(root1);
- }
- }
- class ViewLabelProvider extends LabelProvider {
-
- public String getText(Object obj) {
- return obj.toString();
- }
- public Image getImage(Object obj) {
- String imageKey = ISharedImages.IMG_OBJ_ELEMENT;
- if (obj instanceof TreeParent)
- imageKey = ISharedImages.IMG_OBJ_FOLDER;
- return PlatformUI.getWorkbench().getSharedImages().getImage(imageKey);
- }
- }
- class NameSorter extends ViewerSorter {
- }
-
- /**
- * The constructor.
- */
- public SeamComponentsView() {
- }
-
- /**
- * This is a callback that will allow us
- * to create the viewer and initialize it.
- */
- public void createPartControl(Composite parent) {
- viewer = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
- drillDownAdapter = new DrillDownAdapter(viewer);
- viewer.setContentProvider(new ViewContentProvider());
- viewer.setLabelProvider(new ViewLabelProvider());
- viewer.setSorter(new NameSorter());
- viewer.setInput(getViewSite());
- makeActions();
- hookContextMenu();
- hookDoubleClickAction();
- contributeToActionBars();
- }
-
- private void hookContextMenu() {
- MenuManager menuMgr = new MenuManager("#PopupMenu");
- menuMgr.setRemoveAllWhenShown(true);
- menuMgr.addMenuListener(new IMenuListener() {
- public void menuAboutToShow(IMenuManager manager) {
- SeamComponentsView.this.fillContextMenu(manager);
- }
- });
- Menu menu = menuMgr.createContextMenu(viewer.getControl());
- viewer.getControl().setMenu(menu);
- getSite().registerContextMenu(menuMgr, viewer);
- }
-
- private void contributeToActionBars() {
- IActionBars bars = getViewSite().getActionBars();
- fillLocalPullDown(bars.getMenuManager());
- fillLocalToolBar(bars.getToolBarManager());
- }
-
- private void fillLocalPullDown(IMenuManager manager) {
- manager.add(action1);
- manager.add(new Separator());
- manager.add(action2);
- }
-
- private void fillContextMenu(IMenuManager manager) {
- manager.add(action1);
- manager.add(action2);
- manager.add(new Separator());
- drillDownAdapter.addNavigationActions(manager);
- // Other plug-ins can contribute there actions here
- manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
- }
-
- private void fillLocalToolBar(IToolBarManager manager) {
- manager.add(action1);
- manager.add(action2);
- manager.add(new Separator());
- drillDownAdapter.addNavigationActions(manager);
- }
-
- private void makeActions() {
- action1 = new Action() {
- public void run() {
-
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject("t9");
- ModuleCoreNature nature = ModuleCoreNature.getModuleCoreNature(project);
- WebArtifactEdit edit =
- WebArtifactEdit.getWebArtifactEditForRead(project);
- IVirtualComponent com = ComponentCore.createComponent(project);
- IVirtualFolder webRootFolder = com.getRootFolder().getFolder(new Path("/WEB-INF/classes"));
- IContainer folder = webRootFolder.getUnderlyingFolder();
- webRootFolder.getUnderlyingFolders();
- showMessage(webRootFolder.getUnderlyingFolder().getLocation().toString());
- }
- };
- action1.setText("Action 1");
- action1.setToolTipText("Action 1 tooltip");
- action1.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().
- getImageDescriptor(ISharedImages.IMG_OBJS_INFO_TSK));
-
- action2 = new Action() {
- public void run() {
- showMessage("Action 2 executed");
- }
- };
- action2.setText("Action 2");
- action2.setToolTipText("Action 2 tooltip");
- action2.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().
- getImageDescriptor(ISharedImages.IMG_OBJS_INFO_TSK));
- doubleClickAction = new Action() {
- public void run() {
- ISelection selection = viewer.getSelection();
- Object obj = ((IStructuredSelection)selection).getFirstElement();
- showMessage("Double-click detected on "+obj.toString());
- }
- };
- }
-
- private void hookDoubleClickAction() {
- viewer.addDoubleClickListener(new IDoubleClickListener() {
- public void doubleClick(DoubleClickEvent event) {
- doubleClickAction.run();
- }
- });
- }
- private void showMessage(String message) {
- MessageDialog.openInformation(
- viewer.getControl().getShell(),
- "Seam Components",
- message);
- }
-
- /**
- * Passing the focus request to the viewer's control.
- */
- public void setFocus() {
- viewer.getControl().setFocus();
- }
-}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/SeamRuntimeListFieldEditor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/SeamRuntimeListFieldEditor.java 2007-09-19 07:26:13 UTC (rev 3702)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/SeamRuntimeListFieldEditor.java 2007-09-19 07:26:17 UTC (rev 3703)
@@ -24,8 +24,11 @@
import org.eclipse.jface.viewers.CheckboxTableViewer;
import org.eclipse.jface.viewers.ICheckStateListener;
import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.jface.wizard.WizardDialog;
@@ -53,10 +56,12 @@
* @author eskimo
*
*/
-public class SeamRuntimeListFieldEditor extends BaseFieldEditor {
+public class SeamRuntimeListFieldEditor extends BaseFieldEditor implements ISelectionChangedListener, SelectionListener {
CheckboxTableViewer tableView = null;
Composite root = null;
+ Button rmBtn = null;
+ Button addBtn = null;
/**
* @param name
* @param label
@@ -126,6 +131,7 @@
gd.grabExcessHorizontalSpace = true;
tableView.getControl().setLayoutData(gd);
+ tableView.addSelectionChangedListener(this);
Composite buttons = new Composite(root,SWT.NONE);
buttons.setLayout(new GridLayout(1,false));
@@ -135,7 +141,7 @@
gd.grabExcessVerticalSpace = true;
buttons.setLayoutData(gd);
- final Button addBtn = new Button(buttons,SWT.PUSH);
+ addBtn = new Button(buttons,SWT.PUSH);
addBtn.setText("Add");
gd = new GridData(GridData.FILL_HORIZONTAL,GridData.CENTER,false,false);
gd.horizontalAlignment = GridData.FILL;
@@ -143,30 +149,17 @@
gd.widthHint = 50;
addBtn.setLayoutData(gd);
- addBtn.addSelectionListener(new SelectionListener() {
- /* (non-Javadoc)
- * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
- */
- public void widgetSelected(SelectionEvent e) {
-
- Wizard wiz = new SeamRuntimeNewWizard((List<SeamRuntime>)getValue(), added);
- WizardDialog dialog = new WizardDialog(Display.getCurrent().getActiveShell(), wiz);
- dialog.open();
- tableView.refresh();
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- }
- });
+ addBtn.addSelectionListener(this);
- /*final Button rmBtn = new Button(buttons,SWT.PUSH);
+ rmBtn = new Button(buttons,SWT.PUSH);
rmBtn.setText("Remove");
gd = new GridData(GridData.FILL_HORIZONTAL,GridData.CENTER,false,false);
gd.horizontalAlignment = GridData.FILL;
gd.verticalAlignment = GridData.VERTICAL_ALIGN_BEGINNING;
rmBtn.setLayoutData(gd);
+ rmBtn.addSelectionListener(this);
- final Button editBtn = new Button(buttons,SWT.PUSH);
+ /*final Button editBtn = new Button(buttons,SWT.PUSH);
editBtn.setText("Edit");
gd = new GridData(GridData.FILL_HORIZONTAL,GridData.CENTER,false,false);
gd.horizontalAlignment = GridData.FILL;
@@ -272,32 +265,6 @@
return 1;
}
- public static void main (String [] args) {
- Display display = new Display ();
- Shell shell = new Shell(display);
- shell.setLayout(new GridLayout());
- SeamRuntime rt = new SeamRuntime();
- rt.setName("rtName1");
- rt.setDefault(true);
- rt.setHomeDir("/home");
- rt.setVersion(SeamVersion.SEAM_1_2);
- SeamRuntime rt2 = new SeamRuntime();
- rt2.setName("rtName2");
- rt2.setDefault(false);
- rt2.setHomeDir("/home1");
- rt2.setVersion(SeamVersion.SEAM_2_0);
- List<SeamRuntime> rts = Arrays.asList(new SeamRuntime[]{rt,rt2});
-
-
- new SeamRuntimeListFieldEditor("name","label",rts).doFillIntoGrid(shell);
-
- shell.open ();
- while (!shell.isDisposed ()) {
- if (!display.readAndDispatch ()) display.sleep ();
- }
- display.dispose ();
- }
-
/**
*
* @param parent
@@ -448,4 +415,40 @@
return true;
}
}
+
+ /**
+ * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
+ */
+ public void selectionChanged(SelectionChangedEvent event) {
+ IStructuredSelection selection = (IStructuredSelection)event.getSelection();
+ selectionChanged((SeamRuntime)selection.getFirstElement());
+ }
+
+ /**
+ * @param firstElement
+ */
+ public void selectionChanged(SeamRuntime selection) {
+ if(selection==null
+ || selection == SeamRuntimeManager.getInstance().getDefaultRuntime()) {
+ } else {
+ }
+ }
+
+ /**
+ * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ public void widgetDefaultSelected(SelectionEvent e) {}
+
+ /**
+ * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ public void widgetSelected(SelectionEvent e) {
+ if(e.widget==addBtn) {
+ Wizard wiz = new SeamRuntimeNewWizard((List<SeamRuntime>)getValue(), added);
+ WizardDialog dialog = new WizardDialog(Display.getCurrent().getActiveShell(), wiz);
+ dialog.open();
+ tableView.refresh();
+// } else if(e.widget==rmBtn) {
+ }
+ }
}
17 years, 3 months
JBoss Tools SVN: r3702 - in trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam: internal/core and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2007-09-19 03:26:13 -0400 (Wed, 19 Sep 2007)
New Revision: 3702
Added:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/DataSourceXmlDeployer.java
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreBuilder.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegete.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/LibraryScanner.java
Log:
http://jira.jboss.org/jira/browse/JBIDE-848
fix errors under linux.
I found that for some reasons project.localRefresh doesen't works well for Linux, so after creating projects the natures are not loaded, that's why ejb,ear and test projects look like General projects.
Now Import operation is used and it works even during workspace is locked by running new wizard.
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreBuilder.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreBuilder.java 2007-09-19 02:32:12 UTC (rev 3701)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreBuilder.java 2007-09-19 07:26:13 UTC (rev 3702)
@@ -106,7 +106,7 @@
protected void fullBuild(final IProgressMonitor monitor)
throws CoreException {
- try {
+ try {
getProject().accept(getResourceVisitor().getVisitor());
} catch (CoreException e) {
SeamCorePlugin.getPluginLog().logError(e);
@@ -115,7 +115,7 @@
protected void incrementalBuild(IResourceDelta delta,
IProgressMonitor monitor) throws CoreException {
- // the visitor does the work.
+ // the visitor does the work.
delta.accept(new SampleDeltaVisitor());
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2007-09-19 02:32:12 UTC (rev 3701)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2007-09-19 07:26:13 UTC (rev 3702)
@@ -357,8 +357,6 @@
}
long e = System.currentTimeMillis();
-
- System.out.println("loaded in " + (e - begin));
}
/**
Added: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/DataSourceXmlDeployer.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/DataSourceXmlDeployer.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/DataSourceXmlDeployer.java 2007-09-19 07:26:13 UTC (rev 3702)
@@ -0,0 +1,102 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.internal.core.project.facet;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.wst.common.componentcore.ComponentCore;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
+import org.eclipse.wst.common.project.facet.core.IFacetedProject;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IRuntime;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.ServerCore;
+import org.eclipse.wst.server.core.model.ServerBehaviourDelegate;
+import org.jboss.ide.eclipse.as.core.modules.SingleDeployableFactory;
+import org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior;
+import org.jboss.tools.seam.core.SeamCorePlugin;
+
+/**
+ * @author eskimo
+ *
+ */
+public class DataSourceXmlDeployer extends Job {
+ IProject project = null;
+ public DataSourceXmlDeployer(IProject project) {
+ super("Deploying datasource to server");
+ this.project = project;
+ }
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+
+ IFacetedProject facetedProject;
+ try {
+ facetedProject = ProjectFacetsManager.create(project);
+ } catch (CoreException e) {
+ return new Status(Status.WARNING, SeamCorePlugin.PLUGIN_ID, "No server selected to deploy datasource to");
+ }
+ org.eclipse.wst.common.project.facet.core.runtime.IRuntime primaryRuntime = facetedProject.getPrimaryRuntime();
+ IServer s = null;
+ IServer[] servers = ServerCore.getServers();
+ for (IServer server : servers) {
+ String primaryName = primaryRuntime.getName();
+ IRuntime runtime = server.getRuntime();
+ if(runtime!=null) {
+ String serverName = runtime.getName();
+ if(primaryName.equals(serverName)) {
+ s = server;
+ }
+ }
+ }
+
+ if(s==null) {
+ return new Status(Status.WARNING, SeamCorePlugin.PLUGIN_ID, "No server selected to deploy datasource to");
+ }
+
+ // convert it to a DeployableServer instance
+ DeployableServerBehavior deployer = (DeployableServerBehavior) s.loadAdapter(DeployableServerBehavior.class, null);
+
+ // if its not null, the adaptation worked.
+ if( deployer == null ) {
+ return new Status(Status.WARNING, SeamCorePlugin.PLUGIN_ID, "Server did not support deploy of datasource.");
+ }
+
+ IVirtualComponent com = ComponentCore.createComponent(project);
+ final IVirtualFolder srcRootFolder = com.getRootFolder().getFolder(new Path("/WEB-INF/classes"));
+ IContainer underlyingFolder = srcRootFolder.getUnderlyingFolder();
+
+ IPath projectPath = new Path("/"+underlyingFolder.getProject().getName());
+ IPath projectRelativePath = underlyingFolder.getProjectRelativePath();
+
+ IPath append = projectPath.append(projectRelativePath).append(project.getName()+"-ds.xml");
+
+ if(SingleDeployableFactory.makeDeployable(append)) {
+
+ IModule module = SingleDeployableFactory.findModule(append);
+
+ // custom API to deploy / publish only one module.
+ IStatus t = deployer.publishOneModule(IServer.PUBLISH_FULL, new IModule[] { module}, ServerBehaviourDelegate.ADDED, monitor);
+ SingleDeployableFactory.unmakeDeployable(append);
+ return t;
+ } else {
+ return new Status(Status.WARNING, SeamCorePlugin.PLUGIN_ID, "Could not deploy datasource " + append);
+ }
+ }
+}
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/DataSourceXmlDeployer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegete.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegete.java 2007-09-19 02:32:12 UTC (rev 3701)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegete.java 2007-09-19 07:26:13 UTC (rev 3702)
@@ -315,6 +315,7 @@
// WtpUtils.createSourceFolder(project, new Path("src/action"),new Path("src"));
// WtpUtils.createSourceFolder(project, new Path("src/model"),new Path("src"));
// Copy sources to src
+
AntCopyUtils.copyFileToFile(
new File(seamGenHomeFolder,"src/Authenticator.java"),
new File(project.getLocation().toFile(),"src/" + model.getProperty(ISeamFacetDataModelProperties.SESION_BEAN_PACKAGE_NAME).toString().replace('.', '/')+"/"+"Authenticator.java"),
@@ -344,62 +345,7 @@
if(model.getProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH)!=null)
AntCopyUtils.copyFiles((String[])model.getProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH), webLibFolder);
- Job create = new Job("Deploying datasource to server") {
- @Override
- protected IStatus run(IProgressMonitor monitor) {
-
- IFacetedProject facetedProject;
- try {
- facetedProject = ProjectFacetsManager.create(project);
- } catch (CoreException e) {
- return new Status(Status.WARNING, SeamCorePlugin.PLUGIN_ID, "No server selected to deploy datasource to");
- }
- org.eclipse.wst.common.project.facet.core.runtime.IRuntime primaryRuntime = facetedProject.getPrimaryRuntime();
- IServer s = null;
- IServer[] servers = ServerCore.getServers();
- for (IServer server : servers) {
- String primaryName = primaryRuntime.getName();
- IRuntime runtime = server.getRuntime();
- if(runtime!=null) {
- String serverName = runtime.getName();
- if(primaryName.equals(serverName)) {
- s = server;
- }
- }
- }
-
- if(s==null) {
- return new Status(Status.WARNING, SeamCorePlugin.PLUGIN_ID, "No server selected to deploy datasource to");
- }
-
- // convert it to a DeployableServer instance
- DeployableServerBehavior deployer = (DeployableServerBehavior) s.loadAdapter(DeployableServerBehavior.class, null);
-
- // if its not null, the adaptation worked.
- if( deployer == null ) {
- return new Status(Status.WARNING, SeamCorePlugin.PLUGIN_ID, "Server did not support deploy of datasource.");
- }
-
- IContainer underlyingFolder = srcRootFolder.getUnderlyingFolder();
-
- IPath projectPath = new Path("/"+underlyingFolder.getProject().getName());
- IPath projectRelativePath = underlyingFolder.getProjectRelativePath();
-
- IPath append = projectPath.append(projectRelativePath).append(project.getName()+"-ds.xml");
-
- if(SingleDeployableFactory.makeDeployable(append)) {
-
- IModule module = SingleDeployableFactory.findModule(append);
-
- // custom API to deploy / publish only one module.
- IStatus t = deployer.publishOneModule(IServer.PUBLISH_FULL, new IModule[] { module}, ServerBehaviourDelegate.ADDED, monitor);
- SingleDeployableFactory.unmakeDeployable(append);
- return t;
- } else {
- return new Status(Status.WARNING, SeamCorePlugin.PLUGIN_ID, "Could not deploy datasource " + append);
- }
- }
- };
+ Job create = new DataSourceXmlDeployer(project);
create.setRule(ResourcesPlugin.getWorkspace().getRoot());
create.schedule();
@@ -416,112 +362,141 @@
} catch (IOException e) {
SeamCorePlugin.getPluginLog().logError(e);
}
-// Job create = new Job("Creating EAR and EJB modules") {
-// @Override
-// protected IStatus run(IProgressMonitor monitor) {
-//
-// IProject ear = WtpUtils.createEclipseProject(model.getProperty(ISeamFacetDataModelProperties.SEAM_PROJECT_NAME)+"-ear", monitor);
-// IProject ejb = WtpUtils.createEclipseProject(model.getProperty(ISeamFacetDataModelProperties.SEAM_PROJECT_NAME)+"-ejb", monitor);
- File ear = new File(project.getLocation().removeLastSegments(1).toFile(),model.getProperty(ISeamFacetDataModelProperties.SEAM_PROJECT_NAME)+"-ear");
- File ejb = new File(project.getLocation().removeLastSegments(1).toFile(),model.getProperty(ISeamFacetDataModelProperties.SEAM_PROJECT_NAME)+"-ejb");
- ear.mkdir();
- ejb.mkdir();
- try {
- FilterSet filterSet = new FilterSet();
- filterSet.addFilter("projectName", project.getName());
- filterSet.addFilter("runtimeName", WtpUtils.getServerRuntimeName(project));
- if(model.getProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH)!=null) {
- File driver = new File(((String[])model.getProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH))[0]);
- filterSet.addFilter("driverJar"," " + driver.getName() + "\n");
- } else {
- filterSet.addFilter("driverJar","");
- }
- AntCopyUtils.FileSet excludeCvsSvn = new AntCopyUtils.FileSet(CVS_SVN).dir(seamGenResFolder);
-
- AntCopyUtils.copyFilesAndFolders(
- new File(SeamFacetInstallDataModelProvider.getTemplatesFolder(),"ejb"),
- ejb, new AntCopyUtils.FileSetFileFilter(excludeCvsSvn),
- new FilterSetCollection(filterSet), true);
-
- // *******************************************************************************************
- // Copy sources to ejb project in case of EAR configuration
- // *******************************************************************************************
- AntCopyUtils.copyFileToFile(
- new File(seamGenHomeFolder,"src/Authenticator.java"),
- new File(ejb,"ejbModule/" + model.getProperty(ISeamFacetDataModelProperties.SESION_BEAN_PACKAGE_NAME).toString().replace('.', '/')+"/"+"Authenticator.java"),
- new FilterSetCollection(filtersFilterSet), true);
- AntCopyUtils.copyFileToFile(
- persistenceFile,
- new File(ejb,"ejbModule/META-INF/persistence.xml"),
- viewFilterSetCollection, true);
- // ********************************************************************************************
- // Copy seam project indicator
- // ********************************************************************************************
- AntCopyUtils.copyFileToFolder(new File(seamGenResFolder,"seam.properties"), new File(ejb,"ejbModule/"), true);
-
- AntCopyUtils.copyFileToFile(
- dataSourceDsFile,
- new File(ejb,"ejbModule/"+project.getName()+"-ds.xml"),
- viewFilterSetCollection, true);
-
- AntCopyUtils.copyFileToFolder(
- new File(seamGenResFolder,"META-INF/ejb-jar.xml"),
- new File(ejb,"ejbModule/META-INF/"),
- viewFilterSetCollection, true);
-
- AntCopyUtils.copyFileToFolder(
- hibernateConsolePref,
- new File(ejb,".settings"),
- new FilterSetCollection(projectFilterSet), true);
-
- FilterSet ejbFilterSet = new FilterSet();
- ejbFilterSet.addFilter("projectName",ejb.getName());
-
- AntCopyUtils.copyFileToFile(
- hibernateConsoleLaunchFile,
- new File(ejb,ejb.getName()+".launch"),
- new FilterSetCollection(ejbFilterSet), true);
-
- AntCopyUtils.copyFileToFolder(
- hibernateConsolePropsFile,
- ejb,
- hibernateDialectFilterSet, true);
-
- File earContentsFolder = new File(ear,"EarContent");
- File earContentsMetaInfFolder = new File(earContentsFolder,"META-INF");
+ File ear = new File(project.getLocation().removeLastSegments(1).toFile(),model.getProperty(ISeamFacetDataModelProperties.SEAM_PROJECT_NAME)+"-ear");
+ File ejb = new File(project.getLocation().removeLastSegments(1).toFile(),model.getProperty(ISeamFacetDataModelProperties.SEAM_PROJECT_NAME)+"-ejb");
+ ear.mkdir();
+ ejb.mkdir();
- AntCopyUtils.copyFilesAndFolders(
- seamGenResFolder,
- earContentsFolder,
- new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(JBOSS_EAR_META_INF_SET).dir(seamGenResFolder)),
- viewFilterSetCollection,true);
+ try {
+ FilterSet filterSet = new FilterSet();
+ filterSet.addFilter("projectName", project.getName());
+ filterSet.addFilter("runtimeName", WtpUtils.getServerRuntimeName(project));
+ if(model.getProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH)!=null) {
+ File driver = new File(((String[])model.getProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH))[0]);
+ filterSet.addFilter("driverJar"," " + driver.getName() + "\n");
+ } else {
+ filterSet.addFilter("driverJar","");
+ }
+ AntCopyUtils.FileSet excludeCvsSvn = new AntCopyUtils.FileSet(CVS_SVN).dir(seamGenResFolder);
+
+ AntCopyUtils.copyFilesAndFolders(
+ new File(SeamFacetInstallDataModelProvider.getTemplatesFolder(),"ejb"),
+ ejb, new AntCopyUtils.FileSetFileFilter(excludeCvsSvn),
+ new FilterSetCollection(filterSet), true);
+
+ // *******************************************************************************************
+ // Copy sources to ejb project in case of EAR configuration
+ // *******************************************************************************************
+ AntCopyUtils.copyFileToFile(
+ new File(seamGenHomeFolder,"src/Authenticator.java"),
+ new File(ejb,"ejbModule/" + model.getProperty(ISeamFacetDataModelProperties.SESION_BEAN_PACKAGE_NAME).toString().replace('.', '/')+"/"+"Authenticator.java"),
+ new FilterSetCollection(filtersFilterSet), true);
+ AntCopyUtils.copyFileToFile(
+ persistenceFile,
+ new File(ejb,"ejbModule/META-INF/persistence.xml"),
+ viewFilterSetCollection, true);
+ // ********************************************************************************************
+ // Copy seam project indicator
+ // ********************************************************************************************
+ AntCopyUtils.copyFileToFolder(new File(seamGenResFolder,"seam.properties"), new File(ejb,"ejbModule/"), true);
+
+ AntCopyUtils.copyFileToFile(
+ dataSourceDsFile,
+ new File(ejb,"ejbModule/"+project.getName()+"-ds.xml"),
+ viewFilterSetCollection, true);
+
+ AntCopyUtils.copyFileToFolder(
+ new File(seamGenResFolder,"META-INF/ejb-jar.xml"),
+ new File(ejb,"ejbModule/META-INF/"),
+ viewFilterSetCollection, true);
+
+ AntCopyUtils.copyFileToFolder(
+ hibernateConsolePref,
+ new File(ejb,".settings"),
+ new FilterSetCollection(projectFilterSet), true);
+
+ FilterSet ejbFilterSet = new FilterSet();
+ ejbFilterSet.addFilter("projectName",ejb.getName());
+
+ AntCopyUtils.copyFileToFile(
+ hibernateConsoleLaunchFile,
+ new File(ejb,ejb.getName()+".launch"),
+ new FilterSetCollection(ejbFilterSet), true);
+
+ AntCopyUtils.copyFileToFolder(
+ hibernateConsolePropsFile,
+ ejb,
+ hibernateDialectFilterSet, true);
+
+ File earContentsFolder = new File(ear,"EarContent");
+
+ AntCopyUtils.copyFilesAndFolders(
+ seamGenResFolder,
+ earContentsFolder,
+ new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(JBOSS_EAR_META_INF_SET).dir(seamGenResFolder)),
+ viewFilterSetCollection,true);
- // Copy configuration files from template
- AntCopyUtils.copyFilesAndFolders(
- new File(SeamFacetInstallDataModelProvider.getTemplatesFolder(),"ear"),
- ear, new AntCopyUtils.FileSetFileFilter(excludeCvsSvn),
- new FilterSetCollection(filterSet), true);
-
- // Fill ear contents
- AntCopyUtils.copyFiles(seamHomeFolder,earContentsFolder,new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(JBOSS_EAR_CONTENT).dir(seamHomeFolder)));
- AntCopyUtils.copyFiles(seamLibFolder,earContentsFolder,new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(JBOSS_EAR_CONTENT).dir(seamLibFolder)));
- AntCopyUtils.copyFiles(droolsLibFolder,earContentsFolder,new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(JBOSS_EAR_CONTENT).dir(droolsLibFolder)));
- AntCopyUtils.copyFiles(seamLibFolder,earContentsFolder,new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(JBOSS_EAR_CONTENT).dir(seamLibFolder)));
- AntCopyUtils.copyFiles(seamGenResFolder,earContentsFolder,new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(JBOSS_EAR_CONTENT).dir(seamGenResFolder)));
-
- // Copy JDBC driver if there is any
- if(model.getProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH)!=null)
- AntCopyUtils.copyFiles((String[])model.getProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH), earContentsFolder);
- } catch (IOException e) {
- SeamCorePlugin.getPluginLog().logError(e);
- }
+ // Copy configuration files from template
+ AntCopyUtils.copyFilesAndFolders(
+ new File(SeamFacetInstallDataModelProvider.getTemplatesFolder(),"ear"),
+ ear, new AntCopyUtils.FileSetFileFilter(excludeCvsSvn),
+ new FilterSetCollection(filterSet), true);
+
+ // Fill ear contents
+ AntCopyUtils.copyFiles(seamHomeFolder,earContentsFolder,new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(JBOSS_EAR_CONTENT).dir(seamHomeFolder)));
+ AntCopyUtils.copyFiles(seamLibFolder,earContentsFolder,new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(JBOSS_EAR_CONTENT).dir(seamLibFolder)));
+ AntCopyUtils.copyFiles(droolsLibFolder,earContentsFolder,new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(JBOSS_EAR_CONTENT).dir(droolsLibFolder)));
+ AntCopyUtils.copyFiles(seamLibFolder,earContentsFolder,new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(JBOSS_EAR_CONTENT).dir(seamLibFolder)));
+ AntCopyUtils.copyFiles(seamGenResFolder,earContentsFolder,new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(JBOSS_EAR_CONTENT).dir(seamGenResFolder)));
+
+ // Copy JDBC driver if there is any
+ if(model.getProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH)!=null)
+ AntCopyUtils.copyFiles((String[])model.getProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH), earContentsFolder);
+ } catch (IOException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ }
}
ClasspathHelper.addClasspathEntries(project, fv);
-
+
+ createSeamProjectPreferenes(project, model);
+
+ try {
+ EclipseResourceUtil.addNatureToProject(project, ISeamProject.NATURE_ID);
+ project.refreshLocal(IResource.DEPTH_INFINITE, monitor);
+ String wsPath = project.getLocation().removeLastSegments(1)
+ .toFile().getAbsoluteFile().getPath();
+ if(!isWarConfiguration(model)) {
+ ResourcesUtils.importProject(
+ wsPath+"/"+project.getName()+"-ejb", monitor);
+ ResourcesUtils.importProject(
+ wsPath+"/"+project.getName()+"-ear", monitor);
+ }
+ ResourcesUtils.importProject(
+ wsPath+"/"+project.getName()+"-test", monitor);
+ } catch (IOException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ } catch (InvocationTargetException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ } catch (InterruptedException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ }
+ }
+
+ public static boolean isWarConfiguration(IDataModel model) {
+ return "war".equals(model.getProperty(ISeamFacetDataModelProperties.JBOSS_AS_DEPLOY_AS));
+ }
+
+
+ /**
+ * @param project
+ * @param model
+ */
+ private void createSeamProjectPreferenes(final IProject project,
+ final IDataModel model) {
IScopeContext projectScope = new ProjectScope(project);
IEclipsePreferences prefs = projectScope.getNode(SeamCorePlugin.PLUGIN_ID);
@@ -556,34 +531,12 @@
} catch (BackingStoreException e) {
SeamCorePlugin.getPluginLog().logError(e);
}
- try {
- EclipseResourceUtil.addNatureToProject(project, ISeamProject.NATURE_ID);
- project.refreshLocal(IResource.DEPTH_INFINITE, monitor);
- if(!isWarConfiguration(model)) {
- ResourcesUtils.importProject(project.getLocation().removeLastSegments(1).toFile().getAbsoluteFile()+"/"+project.getName()+"-ejb", monitor);
- ResourcesUtils.importProject(project.getLocation().removeLastSegments(1).toFile().getAbsoluteFile()+"/"+project.getName()+"-ear", monitor);
- }
- ResourcesUtils.importProject(project.getLocation().removeLastSegments(1).toFile().getAbsoluteFile()+"/"+project.getName()+"-test", monitor);
-
- } catch (IOException e) {
- SeamCorePlugin.getPluginLog().logError(e);
- } catch (InvocationTargetException e) {
- SeamCorePlugin.getPluginLog().logError(e);
- } catch (InterruptedException e) {
- SeamCorePlugin.getPluginLog().logError(e);
- }
-
}
- public static boolean isWarConfiguration(IDataModel model) {
- return "war".equals(model.getProperty(ISeamFacetDataModelProperties.JBOSS_AS_DEPLOY_AS));
- }
-
- void createTestProject(IDataModel model, IProject seamWebProject, SeamRuntime seamRuntime) {
+ private void createTestProject(IDataModel model, IProject seamWebProject, SeamRuntime seamRuntime) {
String projectName = model.getProperty(ISeamFacetDataModelProperties.SEAM_PROJECT_NAME).toString();
File testProjectDir = new File(seamWebProject.getLocation().removeLastSegments(1).toFile(),projectName+"-test");
testProjectDir.mkdir();
- File seamProjectDir = seamWebProject.getLocation().toFile();
File testLibDir = new File(testProjectDir,"lib");
File embededEjbDir = new File(testProjectDir,"embedded-ejb");
FilterSet filterSet = new FilterSet();
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/LibraryScanner.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/LibraryScanner.java 2007-09-19 02:32:12 UTC (rev 3701)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/LibraryScanner.java 2007-09-19 07:26:13 UTC (rev 3702)
@@ -210,7 +210,6 @@
if(ds1 != null) {
ds.add(ds1);
}
-// System.out.println(className);
}
17 years, 3 months