JBoss Tools SVN: r7431 - in trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui: wizard and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2008-04-08 14:15:11 -0400 (Tue, 08 Apr 2008)
New Revision: 7431
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIMessages.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/OpenSeamComponentDialog.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1993
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIMessages.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIMessages.java 2008-04-08 17:24:50 UTC (rev 7430)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIMessages.java 2008-04-08 18:15:11 UTC (rev 7431)
@@ -56,6 +56,8 @@
public static String OPEN_SEAM_COMPONENT_DIALOG_LOADING;
public static String OPEN_SEAM_COMPONENT_DIALOG_NAME;
+
+ public static String OPEN_SEAM_COMPONENT_DIALOG_WAIT;
public static String SEAM_ACTION_WIZARD_ACTION_CREATING_OPERATION;
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties 2008-04-08 17:24:50 UTC (rev 7430)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties 2008-04-08 18:15:11 UTC (rev 7431)
@@ -204,6 +204,7 @@
OPEN_SEAM_COMPONENT_ACTION_MESSAGE=Enter seam component name prefix or pattern (? = any character, * = any string):
OPEN_SEAM_COMPONENT_DIALOG_LOADING=Seam components loading
OPEN_SEAM_COMPONENT_DIALOG_NAME=OpenSeamComponentDialog
+OPEN_SEAM_COMPONENT_DIALOG_WAIT=Wait for Build...
FIND_DECLARATIONS_ACTION_ACTION_NAME=Find Seam Declarations
FIND_DECLARATIONS_ACTION_DESCRIPTION=Find Seam Declarations
FIND_DECLARATIONS_ACTION_TOOL_TIP=Find Seam Declarations
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/OpenSeamComponentDialog.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/OpenSeamComponentDialog.java 2008-04-08 17:24:50 UTC (rev 7430)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/OpenSeamComponentDialog.java 2008-04-08 18:15:11 UTC (rev 7431)
@@ -24,6 +24,7 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.dialogs.DialogSettings;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.viewers.ILabelProvider;
@@ -93,6 +94,18 @@
protected void fillContentProvider(AbstractContentProvider contentProvider,
ItemsFilter itemsFilter, IProgressMonitor progressMonitor)
throws CoreException {
+
+ progressMonitor.subTask(SeamUIMessages.OPEN_SEAM_COMPONENT_DIALOG_WAIT);
+
+ boolean interrupted= true;
+ while (interrupted) {
+ try {
+ Platform.getJobManager().join(ResourcesPlugin.FAMILY_AUTO_BUILD, null);
+ interrupted= false;
+ } catch (InterruptedException e) {
+ interrupted= true;
+ }
+ }
IProject[] projects = ResourcesPlugin.getWorkspace().getRoot()
.getProjects();
17 years, 9 months
JBoss Tools SVN: r7430 - in trunk: seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2008-04-08 13:24:50 -0400 (Tue, 08 Apr 2008)
New Revision: 7430
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamSettingsPreferencePage.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/SeamUiAllTests.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/preferences/SeamSettingsPreferencesPageTest.java
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/WorkbenchUtils.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1992 Fixed
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamSettingsPreferencePage.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamSettingsPreferencePage.java 2008-04-08 17:20:44 UTC (rev 7429)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamSettingsPreferencePage.java 2008-04-08 17:24:50 UTC (rev 7430)
@@ -217,7 +217,7 @@
IFieldEditorFactory.INSTANCE.createBrowsePackageEditor(
ISeamFacetDataModelProperties.ENTITY_BEAN_PACKAGE_NAME,
SeamPreferencesMessages.SEAM_SETTINGS_PREFERENCES_PAGE_PACKAGE, sourceFolder!=null?sourceFolder:"",
- getPrefValue(ISeamFacetDataModelProperties.ENTITY_BEAN_PACKAGE_NAME, ""));
+ getModelPackageName());
modelSourceFolderEditor.addPropertyChangeListener(new PropertyChangeListener(){
public void propertyChange(PropertyChangeEvent evt) {
@@ -243,7 +243,7 @@
IFieldEditorFactory.INSTANCE.createBrowsePackageEditor(
ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_NAME,
SeamPreferencesMessages.SEAM_SETTINGS_PREFERENCES_PAGE_PACKAGE, sourceFolder!=null?sourceFolder:"",
- getPrefValue(ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_NAME, ""));
+ getActionPackageName());
actionSourceFolderEditor.addPropertyChangeListener(new PropertyChangeListener(){
public void propertyChange(PropertyChangeEvent evt) {
@@ -285,7 +285,7 @@
IFieldEditorFactory.INSTANCE.createBrowsePackageEditor(
ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_NAME,
SeamPreferencesMessages.SEAM_SETTINGS_PREFERENCES_PAGE_PACKAGE, sourceFolder!=null?sourceFolder:"",
- getPrefValue(ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_NAME, ""));
+ getTestPackageName());
testSourceFolderEditor.addPropertyChangeListener(new PropertyChangeListener(){
public void propertyChange(PropertyChangeEvent evt) {
@@ -351,6 +351,39 @@
return folder;
}
+ private String getModelPackageName() {
+ String name = null;
+ if(preferences!=null) {
+ name = preferences.get(ISeamFacetDataModelProperties.ENTITY_BEAN_PACKAGE_NAME, null);
+ }
+ if(name==null) {
+ name = "org.domain." + getSeamProjectName() + ".entity";
+ }
+ return name;
+ }
+
+ private String getActionPackageName() {
+ String name = null;
+ if(preferences!=null) {
+ name = preferences.get(ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_NAME, null);
+ }
+ if(name==null) {
+ name = "org.domain." + getSeamProjectName() + ".session";
+ }
+ return name;
+ }
+
+ private String getTestPackageName() {
+ String name = null;
+ if(preferences!=null) {
+ name = preferences.get(ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_NAME, null);
+ }
+ if(name==null) {
+ name = "org.domain." + getSeamProjectName() + ".test";
+ }
+ return name;
+ }
+
private String getActionSourceFolder() {
String folder = null;
if(preferences!=null) {
@@ -503,6 +536,9 @@
private boolean validateJavaPackageName(String errorMessageKey, String warningMessageKey, String editorName) {
if(editorRegistry.get(editorName).isEnabled()) {
String packageName = getValue(editorName).trim();
+ if(packageName.length()==0) {
+ return true;
+ }
IStatus status = JavaConventions.validatePackageName(packageName, CompilerOptions.VERSION_1_5, CompilerOptions.VERSION_1_5);
if(status.getSeverity()==IStatus.ERROR) {
if(!error) {
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/SeamUiAllTests.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/SeamUiAllTests.java 2008-04-08 17:20:44 UTC (rev 7429)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/SeamUiAllTests.java 2008-04-08 17:24:50 UTC (rev 7430)
@@ -43,7 +43,6 @@
suite.addTestSuite(SeamELContentAssistTest.class);
suite.addTestSuite(SeamELContentAssistJbide1676Test.class);
suite.addTestSuite(SeamELContentAssistJbide1645Test.class);
- suite.addTestSuite(SeamSettingsPreferencesPageTest.class);
suite.addTest(new ProjectImportTestSetup(new TestSuite(SeamSettingsPreferencesPageTest.class), "org.jboss.tools.seam.ui.test", "projects/TestSeamSettingsPreferencesPage", "TestSeamSettingsPreferencesPage"));
return suite;
}
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/preferences/SeamSettingsPreferencesPageTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/preferences/SeamSettingsPreferencesPageTest.java 2008-04-08 17:20:44 UTC (rev 7429)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/preferences/SeamSettingsPreferencesPageTest.java 2008-04-08 17:24:50 UTC (rev 7430)
@@ -44,9 +44,9 @@
IProject project = null;
static String PROJECT_NAME = "TestSeamSettingsPreferencesPage";
- static String MODEL_PACKAGE_NAME = "org.jboss.model";
- static String ACTION_PACKAGE_NAME = "org.jboss.action";
- static String TEST_PACKAGE_NAME = "org.jboss.test";
+ static String MODEL_PACKAGE_NAME = "org.domain." + PROJECT_NAME + ".entity";
+ static String ACTION_PACKAGE_NAME = "org.domain." + PROJECT_NAME + ".session";
+ static String TEST_PACKAGE_NAME = "org.domain." + PROJECT_NAME + ".test";
static String RUNTIME_NAME = "Seam 1.2.0 Seam Settings Page Test";
public SeamSettingsPreferencesPageTest() {
@@ -90,18 +90,9 @@
IFieldEditor viewFolder = page.getEditor(ISeamFacetDataModelProperties.WEB_CONTENTS_FOLDER);
viewFolder.setValue("/" + PROJECT_NAME);
- IFieldEditor modelPackageName = page.getEditor(ISeamFacetDataModelProperties.ENTITY_BEAN_PACKAGE_NAME);
- modelPackageName.setValue(MODEL_PACKAGE_NAME);
-
- IFieldEditor sessionPackageName = page.getEditor(ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_NAME);
- sessionPackageName.setValue(ACTION_PACKAGE_NAME);
-
IFieldEditor createTest = page.getEditor(ISeamFacetDataModelProperties.TEST_CREATING);
createTest.setValue(Boolean.TRUE);
- IFieldEditor testPackageName = page.getEditor(ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_NAME);
- testPackageName.setValue(TEST_PACKAGE_NAME);
-
assertTrue("Settings page is not valid: " + page.getErrorMessage(), page.okToLeave());
page.performOk();
} finally {
Modified: trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/WorkbenchUtils.java
===================================================================
--- trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/WorkbenchUtils.java 2008-04-08 17:20:44 UTC (rev 7429)
+++ trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/WorkbenchUtils.java 2008-04-08 17:24:50 UTC (rev 7430)
@@ -54,7 +54,6 @@
* @return
*/
public static IWorkbenchPage getWorkbenchActivePage() {
- // TODO Auto-generated method stub
return getWorkbench().getActiveWorkbenchWindow().getActivePage();
}
@@ -73,16 +72,13 @@
}
public static PreferenceDialog createPreferenceDialog(String pageId) {
-
return PreferencesUtil.createPreferenceDialogOn(WorkbenchUtils
.getActiveShell(), pageId, new String[] {pageId}, null);
}
public static PreferenceDialog createPropertyDialog(String pageId,
IProject project) {
-
- return PreferencesUtil.createPreferenceDialogOn(WorkbenchUtils
- .getActiveShell(), pageId, new String[] {pageId}, project);
+ return PreferencesUtil.createPropertyDialogOn(WorkbenchUtils
+ .getActiveShell(), project, pageId, new String[] {pageId}, null);
}
-
-}
+}
\ No newline at end of file
17 years, 9 months
JBoss Tools SVN: r7429 - trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2008-04-08 13:20:44 -0400 (Tue, 08 Apr 2008)
New Revision: 7429
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamQueryParticipant.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-2000 License header is incorrect for new seam search features
Unused methods are removed
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamQueryParticipant.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamQueryParticipant.java 2008-04-08 16:48:04 UTC (rev 7428)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamQueryParticipant.java 2008-04-08 17:20:44 UTC (rev 7429)
@@ -97,37 +97,4 @@
seamRequestor);
}
}
-
-
- private IProject getProject(IJavaElement javaElement) {
- try {
- return javaElement.getPrimaryElement().getResource().getProject();
- } catch (Throwable ex) {
- return null;
- }
- }
-
-
- private String getPropertyName (IJavaElement element) {
- if (element == null || IJavaElement.METHOD != element.getElementType())
- return null;
-
- String name = element.getElementName();
- IMethod method = (IMethod)element;
-
- if (!name.startsWith("get") && !name.startsWith("set") && !name.startsWith("is"))
- return null;
-
-
- if (name.startsWith("get") || name.startsWith("is") ) {
- // the method is getter only if it has no parameters
- if (method.getNumberOfParameters() > 0)
- return null;
- }
-
- int nameOffset = (name.startsWith("set") || name.startsWith("get") ? 3 : 2);
- name = name.substring(nameOffset, nameOffset + 1).toLowerCase() +
- name.substring(nameOffset + 1);
- return name;
- }
}
17 years, 9 months
JBoss Tools SVN: r7428 - trunk/seam/plugins/org.jboss.tools.seam.xml/resources/help.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-04-08 12:48:04 -0400 (Tue, 08 Apr 2008)
New Revision: 7428
Modified:
trunk/seam/plugins/org.jboss.tools.seam.xml/resources/help/keys-seam.properties
Log:
JBIDE-2031
Modified: trunk/seam/plugins/org.jboss.tools.seam.xml/resources/help/keys-seam.properties
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.xml/resources/help/keys-seam.properties 2008-04-08 16:46:39 UTC (rev 7427)
+++ trunk/seam/plugins/org.jboss.tools.seam.xml/resources/help/keys-seam.properties 2008-04-08 16:48:04 UTC (rev 7428)
@@ -189,9 +189,13 @@
SeamPropertyMap_Properties.WindowTitle=Properties
SeamPropertyMap_Properties.Title=Seam Property Map
+FileFolder_CreateFileSeamComponents.WindowTitle=New Seam Components
+FileFolder_CreateFileSeamComponents.Title=Seam Components File
FileFolder_CreateFileSeamComponents_0.WindowTitle=New Seam Components
FileFolder_CreateFileSeamComponents_0.Title=Seam Components File
+FileSystemFolder_CreateFileSeamComponents.WindowTitle=New Seam Components
+FileSystemFolder_CreateFileSeamComponents.Title=Seam Components File
FileSystemFolder_CreateFileSeamComponents_0.WindowTitle=New Seam Components
FileSystemFolder_CreateFileSeamComponents_0.Title=Seam Components File
17 years, 9 months
JBoss Tools SVN: r7427 - trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2008-04-08 12:46:39 -0400 (Tue, 08 Apr 2008)
New Revision: 7427
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/FindSeamAction.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1989 New seam find ref/decl buttons are all enabled even though they don't do anything
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/FindSeamAction.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/FindSeamAction.java 2008-04-08 16:31:39 UTC (rev 7426)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/FindSeamAction.java 2008-04-08 16:46:39 UTC (rev 7427)
@@ -29,14 +29,24 @@
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.ITextSelection;
+import org.eclipse.jface.text.ITextViewer;
import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IActionDelegate2;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.IPageListener;
+import org.eclipse.ui.ISelectionListener;
+import org.eclipse.ui.IWindowListener;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchListener;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkbenchWindowActionDelegate;
import org.eclipse.ui.PlatformUI;
@@ -64,8 +74,12 @@
*
* @author Jeremy
*/
-abstract public class FindSeamAction extends Action implements IWorkbenchWindowActionDelegate, IActionDelegate2 {
+abstract public class FindSeamAction extends Action implements IWorkbenchWindowActionDelegate, IActionDelegate2, ISelectionListener
+{
+ /**
+ * Constructs the Action object
+ */
protected FindSeamAction() {
}
@@ -75,18 +89,27 @@
public void run() {
runWithEvent(null);
}
+
+ /*
+ * Returns editor from a given workbench window
+ *
+ * @param window
+ * @return
+ */
+ private IEditorPart getCurrentEditor(IWorkbenchWindow window) {
+ if (window == null || window.getActivePage() == null)
+ return null;
+
+ return window.getActivePage().getActiveEditor();
+ }
- /**
- * @Override
+ /*
+ * Returns viewer for a given editor
+ *
+ * @param editor
+ * @return
*/
- public void runWithEvent(Event e) {
- IEditorPart editor = ModelUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- if (editor == null)
- return;
-
- IEditorInput input = editor.getEditorInput();
- IDocument document = null;
-
+ private ISourceViewer getEditorViewer(IWorkbenchPart editor) {
ISourceViewer viewer = null;
if (editor instanceof EditorPartWrapper) {
@@ -104,24 +127,60 @@
} else if (editor instanceof CompilationUnitEditor) {
viewer = ((CompilationUnitEditor)editor).getViewer();
}
+ return viewer;
+ }
+
+ /*
+ * Returns {@link ITextSelection} for a given viewer
+ *
+ * @param viewer
+ * @return
+ */
+ private ITextSelection getTextSelection(ITextViewer viewer) {
+ if (viewer == null || viewer.getSelectionProvider() == null)
+ return null;
- if (viewer == null)
- return;
+ return getTextSelection(viewer.getSelectionProvider().getSelection());
+ }
+
+ /*
+ * Returns {@link ITextSelection} for a given {@link ISelection}
+ *
+ * @param selection
+ * @return
+ */
+ private ITextSelection getTextSelection(ISelection selection) {
+ if (selection == null || selection.isEmpty())
+ return null;
- document = viewer.getDocument();
-
- ISelection selection = viewer.getSelectionProvider().getSelection();
- if (selection.isEmpty())
+ if (selection instanceof ITextSelection) {
+ return (ITextSelection)selection;
+ }
+ return null;
+ }
+
+ /**
+ * @Override
+ */
+ public void runWithEvent(Event e) {
+ IWorkbenchPart activeWorkbenchPart = getCurrentEditor(getActiveWorkbenchWindow());
+ if (activeWorkbenchPart == null)
return;
- int selectionOffset = 0;
- if (selection instanceof ITextSelection) {
- ITextSelection tSel = (ITextSelection)selection;
- selectionOffset = tSel.getOffset();
- } else {
+ IEditorInput input = (activeWorkbenchPart instanceof IEditorPart ?
+ ((IEditorPart)activeWorkbenchPart).getEditorInput() : null);
+ ISourceViewer viewer = getEditorViewer(activeWorkbenchPart);
+ if (viewer == null)
return;
- }
+
+ ITextSelection selection = getTextSelection(viewer);
+ if (selection == null)
+ return;
+
+ int selectionOffset = selection.getOffset();
+ IDocument document = viewer.getDocument();
+
IFile file = null;
if (input instanceof IFileEditorInput) {
@@ -147,57 +206,6 @@
SeamGuiPlugin.getPluginLog().logError(ie);
}
return;
-
- /*
- String[] varNamesToSearch = findVariableNames(seamProject, document, tokens);
-
- if (varNamesToSearch != null) {
- try {
- performNewSearch(varNamesToSearch, file);
- } catch (JavaModelException jme) {
- SeamGuiPlugin.getPluginLog().logError(jme);
- } catch (InterruptedException ie) {
- SeamGuiPlugin.getPluginLog().logError(ie);
- }
- return;
- }
-
- // Try to look into "var"/"variable" attributes (if we're in the XML-like document)
-
- if ("java".equalsIgnoreCase(file.getFileExtension())) { //$NON-NLS-1$
- return;
- }
-
- ElVarSearcher varSearcher = new ElVarSearcher(seamProject, file, new SeamELCompletionEngine());
- List<Var> allVars = ElVarSearcher.findAllVars(viewer, selectionOffset);
- if (allVars == null || allVars.size() == 0)
- return;
-
- int start = tokens.get(0).getStart();
- int end = tokens.get(tokens.size() - 1).getStart() +
- tokens.get(tokens.size() - 1).getLength();
-
- String elText;
- try {
- elText = document.get(start, end - start);
- } catch (BadLocationException ble) {
- SeamGuiPlugin.getPluginLog().logError(ble);
- return;
- }
- if (elText == null || elText.length() == 0)
- return;
-
- Var var = varSearcher.findVarForEl(elText, allVars, false);
- if (var == null)
- return;
- try {
- performNewLocalSearch(var, file);
- } catch (JavaModelException jme) {
- SeamGuiPlugin.getPluginLog().logError(jme);
- } catch (InterruptedException ie) {
- SeamGuiPlugin.getPluginLog().logError(ie);
- }
- */
}
/**
@@ -304,16 +312,16 @@
* @Override
*/
public void init(IWorkbenchWindow window) {
- // do nothing.
}
/**
* @Override
*/
public void selectionChanged(IAction action, ISelection selection) {
- // do nothing. Action doesn't depend on selection.
+ selectionChanged(getCurrentEditor(getActiveWorkbenchWindow()), selection);
}
+
// IActionDelegate2
/**
@@ -323,11 +331,12 @@
runWithEvent(event);
}
+ IAction fDelegatorAction =null;
/**
* @Override
*/
public void init(IAction action) {
- // do nothing.
+ fDelegatorAction = action;
}
/*
@@ -407,34 +416,6 @@
}
}
-
- @Deprecated
- private void performNewLocalSearch(Var var, IFile root) throws JavaModelException, InterruptedException {
- SeamSearchQuery query= createQuery(var, root);
- if (query.canRunInBackground()) {
- /*
- * This indirection with Object as parameter is needed to prevent the loading
- * of the Search plug-in: the VM verifies the method call and hence loads the
- * types used in the method signature, eventually triggering the loading of
- * a plug-in (in this case ISearchQuery results in Search plug-in being loaded).
- */
- SearchUtil.runQueryInBackground(query);
- } else {
- IProgressService progressService= PlatformUI.getWorkbench().getProgressService();
- /*
- * This indirection with Object as parameter is needed to prevent the loading
- * of the Search plug-in: the VM verifies the method call and hence loads the
- * types used in the method signature, eventually triggering the loading of
- * a plug-in (in this case it would be ISearchQuery).
- */
- IStatus status= SearchUtil.runQueryInForeground(progressService, query);
- if (status.matches(IStatus.ERROR | IStatus.INFO | IStatus.WARNING)) {
- ErrorDialog.openError(getShell(), SearchMessages.Search_Error_search_title, SearchMessages.Search_Error_search_message, status);
- }
- }
- }
-
-
/**
* Returns the active editor from active MultipageEditor
*
@@ -488,7 +469,9 @@
}
/*
- * returns current Shell
+ * Returns current Shell
+ *
+ * @return
*/
private Shell getShell() {
try {
@@ -497,4 +480,78 @@
return null;
}
}
+
+// IWorkbenchPart fActiveWorkbenchPart = null;
+
+ /*
+ * Returns the workbench
+ *
+ * @return
+ */
+ private IWorkbench getWorkbench() {
+ return PlatformUI.getWorkbench();
+ }
+
+ /*
+ * Returns active workbench window
+ * @return
+ */
+ private IWorkbenchWindow getActiveWorkbenchWindow() {
+ return (getWorkbench() == null ? null : getWorkbench().getActiveWorkbenchWindow());
+ }
+
+ /*
+ * Updates availability on the action delegate
+ *
+ * @param selection
+ */
+ private void update(ISelection selection) {
+ boolean enabled = false;
+ try {
+ IWorkbenchPart activeWorkbenchPart = getCurrentEditor(getActiveWorkbenchWindow());
+ if (!(activeWorkbenchPart instanceof IEditorPart))
+ return;
+
+ ISourceViewer viewer = getEditorViewer((IEditorPart)activeWorkbenchPart);
+ if (viewer == null)
+ return;
+
+ enabled = (getTextSelection(selection) != null);
+ } finally {
+ setEnabled(enabled);
+ if (fDelegatorAction != null) {
+ fDelegatorAction.setEnabled(enabled);
+ }
+ }
+ }
+
+ /*
+ * Updates availability on the action delegate
+ *
+ * @param part
+ * @param selection
+ */
+ private void update(IWorkbenchPart part, ISelection selection) {
+ boolean enabled = false;
+ try {
+ if (!(part instanceof IEditorPart))
+ return;
+
+ ISourceViewer viewer = getEditorViewer((IEditorPart)part);
+ if (viewer == null)
+ return;
+
+ enabled = (getTextSelection(selection) != null);
+ } finally {
+ setEnabled(enabled);
+ if (fDelegatorAction != null) {
+ fDelegatorAction.setEnabled(enabled);
+ }
+ }
+ }
+
+ // ISelectionListener
+ public void selectionChanged(IWorkbenchPart part, ISelection selection) {
+ update(selection);
+ }
}
17 years, 9 months
JBoss Tools SVN: r7426 - trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/tests.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2008-04-08 12:31:39 -0400 (Tue, 08 Apr 2008)
New Revision: 7426
Modified:
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/tests/AbstractResourceMarkerTest.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1950
Modified: trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/tests/AbstractResourceMarkerTest.java
===================================================================
--- trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/tests/AbstractResourceMarkerTest.java 2008-04-08 16:30:33 UTC (rev 7425)
+++ trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/tests/AbstractResourceMarkerTest.java 2008-04-08 16:31:39 UTC (rev 7426)
@@ -10,6 +10,9 @@
******************************************************************************/
package org.jboss.tools.tests;
+import java.util.ArrayList;
+import java.util.List;
+
import junit.framework.TestCase;
import org.eclipse.core.resources.IMarker;
@@ -36,21 +39,27 @@
super(name);
}
- protected int findMarkerfLine(IResource resource, String type, String pattern)
+ protected int findMarkerLine(IResource resource, String type, String pattern)
throws CoreException {
int number = -1;
- IMarker[] markers = new IMarker[0];
+ IMarker[] markers = findMarkers(resource, type, pattern);
+ for (int i = 0; i < markers.length; i++) {
+ number = markers[i].getAttribute(IMarker.LINE_NUMBER, -1);
+ }
- markers = resource.findMarkers(type, false, IResource.DEPTH_INFINITE);
+ return number;
+ }
+ protected IMarker[] findMarkers(IResource resource, String type, String pattern) throws CoreException {
+ List<IMarker> result = new ArrayList<IMarker>();
+ IMarker[] markers = resource.findMarkers(type, false, IResource.DEPTH_INFINITE);
for (int i = 0; i < markers.length; i++) {
String message = markers[i].getAttribute(IMarker.MESSAGE, "");
if (message.matches(pattern)) {
- number = markers[i].getAttribute(IMarker.LINE_NUMBER, -1);
+ result.add(markers[i]);
}
}
-
- return number;
+ return result.toArray(new IMarker[0]);
}
protected void assertMarkerIsCreated(IResource resource, MarkerData markerData) throws CoreException {
@@ -60,7 +69,7 @@
protected void assertMarkerIsCreated(IResource resource, String type, String pattern, int expectedLine)
throws CoreException {
- int line = findMarkerfLine(
+ int line = findMarkerLine(
resource, type, pattern);
assertTrue("Marker matches the '" + pattern + "' pattern wasn't found",
@@ -70,6 +79,13 @@
expectedLine,line);
}
+ protected void assertMarkerIsCreated(IResource resource, String type, String pattern) throws CoreException {
+ IMarker[] markers = findMarkers(resource, type, pattern);
+
+ assertTrue("Marker matches the '" + pattern + "' pattern wasn't found",
+ markers.length>0);
+ }
+
protected void assertMarkersIsCreated(IResource resource, MarkerData[] markersData) throws CoreException {
for (MarkerData markerData : markersData) {
assertMarkerIsCreated(resource, markerData);
17 years, 9 months
JBoss Tools SVN: r7425 - in trunk/seam: plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core and 6 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2008-04-08 12:30:33 -0400 (Tue, 08 Apr 2008)
New Revision: 7425
Removed:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamRuntimeValidation.java
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml
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/project/facet/SeamRuntimeManager.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/ISeamValidator.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/IValidationErrorManager.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamProjectPropertyValidator.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidator.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/ValidationErrorManager.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/messages.properties
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/RefactoringTestProject-ejb/.project
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/RefactoringTestProject-test/.project
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/RefactoringTestProject-war/.project
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamProjectPropertyValidatorTest.java
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1950
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml 2008-04-08 16:21:00 UTC (rev 7424)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml 2008-04-08 16:30:33 UTC (rev 7425)
@@ -280,6 +280,7 @@
<validator>
<filter objectClass="org.eclipse.core.resources.IFolder" nameFilter="*"/>
<filter objectClass="org.eclipse.core.resources.IProject" nameFilter="*"/>
+ <filter objectClass="org.eclipse.core.resources.IFile" nameFilter="org.jboss.tools.seam.core.prefs"/>
<helper class="org.jboss.tools.seam.internal.core.validation.SeamValidationHelper"/>
<markerId markerIdValue="seamProjectProblem"/>
<run
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 2008-04-08 16:21:00 UTC (rev 7424)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreBuilder.java 2008-04-08 16:30:33 UTC (rev 7425)
@@ -11,26 +11,23 @@
package org.jboss.tools.seam.core;
import java.io.IOException;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.IResourceDeltaVisitor;
-import org.eclipse.core.resources.IncrementalProjectBuilder;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
+import java.util.Map;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.resources.IResourceDeltaVisitor;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.osgi.util.NLS;
import org.jboss.tools.common.model.util.TypeInfoCollector;
-import org.jboss.tools.seam.internal.core.SeamMessages;
-import org.jboss.tools.seam.internal.core.SeamProject;
+import org.jboss.tools.seam.internal.core.SeamProject;
import org.jboss.tools.seam.internal.core.SeamResourceVisitor;
-import org.jboss.tools.seam.internal.core.scanner.IFileScanner;
-import org.jboss.tools.seam.internal.core.scanner.java.JavaScanner;
-import org.jboss.tools.seam.internal.core.scanner.lib.LibraryScanner;
-import org.jboss.tools.seam.internal.core.scanner.xml.XMLScanner;
-import org.jboss.tools.seam.internal.core.validation.SeamRuntimeValidation;
+import org.jboss.tools.seam.internal.core.scanner.IFileScanner;
+import org.jboss.tools.seam.internal.core.scanner.java.JavaScanner;
+import org.jboss.tools.seam.internal.core.scanner.lib.LibraryScanner;
+import org.jboss.tools.seam.internal.core.scanner.xml.XMLScanner;
public class SeamCoreBuilder extends IncrementalProjectBuilder {
public static String BUILDER_ID = "org.jboss.tools.seam.core.seambuilder"; //$NON-NLS-1$
@@ -97,8 +94,6 @@
sp.getClassPath().process();
}
- new SeamRuntimeValidation().validate(sp);
-
TypeInfoCollector.cleanCache();
if (kind == FULL_BUILD) {
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamRuntimeManager.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamRuntimeManager.java 2008-04-08 16:21:00 UTC (rev 7424)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamRuntimeManager.java 2008-04-08 16:30:33 UTC (rev 7425)
@@ -30,7 +30,6 @@
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.internal.core.project.facet.ISeamCoreConstants;
import org.jboss.tools.seam.internal.core.project.facet.SeamFacetPreferenceInitializer;
-import org.jboss.tools.seam.internal.core.validation.SeamRuntimeValidation;
/**
* This class is responsible for managing available SeamRuntime list.
@@ -45,8 +44,6 @@
private SeamRuntime defaultRt = null;
- private SeamRuntimeValidation validator = new SeamRuntimeValidation();
-
/**
* Private constructor
*/
@@ -126,7 +123,6 @@
}
runtimes.put(runtime.getName(), runtime);
save();
- validateProjects();
}
/**
@@ -175,7 +171,6 @@
*/
public void removeRuntime(SeamRuntime rt) {
runtimes.remove(rt.getName());
- validateProjects();
}
/**
@@ -322,21 +317,6 @@
return result;
}
- private void validateProjects() {
- IProject[] ps = ResourcesPlugin.getWorkspace().getRoot().getProjects();
- for (int i = 0; i < ps.length; i++) {
- ISeamProject sp = SeamCorePlugin.getSeamProject(ps[i], false);
- if (sp == null) {
- continue;
- }
- try {
- validator.validate(sp);
- } catch (CoreException e) {
- SeamCorePlugin.getPluginLog().logError(e);
- }
- }
- }
-
/**
* TBD
*
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/ISeamValidator.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/ISeamValidator.java 2008-04-08 16:21:00 UTC (rev 7424)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/ISeamValidator.java 2008-04-08 16:30:33 UTC (rev 7425)
@@ -23,6 +23,9 @@
public interface ISeamValidator {
public static final String MARKED_SEAM_RESOURCE_MESSAGE_GROUP = "markedSeamResource"; //$NON-NLS-1$
+ public static final String MARKED_SEAM_PROJECT_MESSAGE_GROUP = "markedSeamProject"; //$NON-NLS-1$
+ public static final String SEAM_RESOURCE_MESSAGE_ID = "org.jboss.tools.seam.core.seamProblem"; //$NON-NLS-1$
+ public static final String SEAM_PROJECT_MESSAGE_ID = "org.jboss.tools.seam.core.seamProjectProblem"; //$NON-NLS-1$
/**
* @return true if validator is enabled.
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/IValidationErrorManager.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/IValidationErrorManager.java 2008-04-08 16:21:00 UTC (rev 7424)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/IValidationErrorManager.java 2008-04-08 16:30:33 UTC (rev 7425)
@@ -83,13 +83,18 @@
/**
* Removes all markers for the resources
* @param resources
- * @param messageGroup
*/
- void removeMessagesFromResources(Set<IResource> resources, String messageGroup);
+ void removeMessagesFromResources(Set<IResource> resources);
/**
* Sets seam project
* @param project
*/
void setProject(ISeamProject project);
+
+ /**
+ * Remove all validation messages for the resource.
+ * @param resource
+ */
+ void removeAllMessagesFromResource(IResource resource);
}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamProjectPropertyValidator.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamProjectPropertyValidator.java 2008-04-08 16:21:00 UTC (rev 7424)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamProjectPropertyValidator.java 2008-04-08 16:30:33 UTC (rev 7425)
@@ -42,7 +42,6 @@
*/
public class SeamProjectPropertyValidator implements IValidatorJob {
- private static final String markerId = "seamProjectProblem";
protected static final String VALIDATING_PROJECT = "VALIDATING_PROJECT";
protected static final String INVALID_RUNTIME = "INVALID_RUNTIME";
protected static final String INVALID_WEBFOLDER = "INVALID_WEBFOLDER";
@@ -59,6 +58,7 @@
private IValidationErrorManager errorManager;
private Set<String> validatedProjects = new HashSet<String>();
+ private static Set<String> beingValidatedProjects = new HashSet<String>();
/* (non-Javadoc)
* @see org.eclipse.wst.validation.internal.provisional.core.IValidatorJob#getSchedulingRule(org.eclipse.wst.validation.internal.provisional.core.IValidationContext)
@@ -70,7 +70,7 @@
/* (non-Javadoc)
* @see org.eclipse.wst.validation.internal.provisional.core.IValidatorJob#validateInJob(org.eclipse.wst.validation.internal.provisional.core.IValidationContext, org.eclipse.wst.validation.internal.provisional.core.IReporter)
*/
- public IStatus validateInJob(IValidationContext helper, IReporter reporter) throws ValidationException {
+ public IStatus validateInJob(IValidationContext helper, IReporter reporter) throws ValidationException {
validatedProjects.clear();
SeamValidationHelper seamHelper = (SeamValidationHelper)helper;
IProject project = seamHelper.getProject();
@@ -78,7 +78,7 @@
return OK_STATUS;
}
ISeamProject seamProject = SeamCorePlugin.getSeamProject(project, false);
- errorManager = new ValidationErrorManager(this, null, reporter, null);
+ errorManager = new ValidationErrorManager(this, null, reporter, null, ISeamValidator.MARKED_SEAM_PROJECT_MESSAGE_GROUP);
if(seamProject!=null) {
validateSeamProject(seamProject);
}
@@ -94,6 +94,20 @@
return OK_STATUS;
}
+ synchronized private void finishValidating() {
+ beingValidatedProjects.removeAll(validatedProjects);
+ }
+
+ synchronized private boolean canStartValidating(IProject project) {
+ String name = project.getName();
+ if(validatedProjects.contains(name) || beingValidatedProjects.contains(name)) {
+ return false;
+ }
+ validatedProjects.add(name);
+ beingValidatedProjects.add(name);
+ return true;
+ }
+
private void validateProject(String nameOfChangedProject, IProject checkingProject) {
ISeamProject seamProject = SeamCorePlugin.getSeamProject(checkingProject, false);
if(seamProject==null) {
@@ -191,20 +205,19 @@
private void validateProjectName(IProject targetProject, String projectName, boolean canBeEmpty, String messageId) {
if(!isProjectNameValid(projectName, canBeEmpty)) {
// Mark invalid project name
- errorManager.addError(messageId, SeamPreferences.INVALID_PROJECT_SETTINGS, new String[]{targetProject.getName()}, targetProject);
+ errorManager.addError(messageId, SeamPreferences.INVALID_PROJECT_SETTINGS, new String[]{projectName!=null?projectName:"", targetProject.getName()}, targetProject);
}
}
private void validateSorceFolder(IProject targetProject, String folderPath, String packageName, String srcFolderMessageID, String packageMessageId) {
- if(isFolderPathValid(folderPath, true)) {
- if(!isPackageNameValid(packageName, true)) {
- // Mark invalid source folder path
- errorManager.addError(packageMessageId, SeamPreferences.INVALID_PROJECT_SETTINGS, new String[]{targetProject.getName()}, targetProject);
- }
- return;
+ if(!isFolderPathValid(folderPath, true)) {
+ // Mark invalid source folder path
+ errorManager.addError(srcFolderMessageID, SeamPreferences.INVALID_PROJECT_SETTINGS, new String[]{folderPath!=null?folderPath:"", targetProject.getName()}, targetProject);
}
- // Mark invalid source folder path
- errorManager.addError(srcFolderMessageID, SeamPreferences.INVALID_PROJECT_SETTINGS, new String[]{targetProject.getName()}, targetProject);
+ if(!isPackageNameValid(packageName, true)) {
+ // Mark invalid source folder path
+ errorManager.addError(packageMessageId, SeamPreferences.INVALID_PROJECT_SETTINGS, new String[]{packageName!=null?packageName:"", targetProject.getName()}, targetProject);
+ }
}
private void validateSeamProject(ISeamProject seamProject) {
@@ -213,13 +226,10 @@
if(!project.isAccessible()) {
return;
}
- if(validatedProjects.contains(project.getName())) {
+ if(!canStartValidating(project)) {
return;
}
- validatedProjects.add(project.getName());
- Set<IResource> set = new HashSet<IResource>();
- set.add(project);
- errorManager.removeMessagesFromResources(set, markerId);
+ errorManager.removeAllMessagesFromResource(project);
if(!SeamPreferences.shouldValidateSettings(seamProject)) {
return;
}
@@ -236,7 +246,7 @@
String seamRuntimeName = pref.get(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME, null);
if(seamRuntimeName!=null && seamRuntimeName.length()>0 && (SeamRuntimeManager.getInstance().findRuntimeByName(seamRuntimeName) == null)) {
// Mark unknown runtime
- errorManager.addError(INVALID_RUNTIME, SeamPreferences.INVALID_PROJECT_SETTINGS, new String[]{project.getName()}, project);
+ errorManager.addError(INVALID_RUNTIME, SeamPreferences.INVALID_PROJECT_SETTINGS, new String[]{seamRuntimeName!=null?seamRuntimeName:"", project.getName()}, project);
}
if(ISeamFacetDataModelProperties.DEPLOY_AS_EAR.equals(pref.get(ISeamFacetDataModelProperties.JBOSS_AS_DEPLOY_AS, null))) {
@@ -245,7 +255,7 @@
String viewFolder = pref.get(ISeamFacetDataModelProperties.WEB_CONTENTS_FOLDER, null);
if(!isFolderPathValid(viewFolder, true)) {
// Mark unknown View folder
- errorManager.addError(INVALID_WEBFOLDER, SeamPreferences.INVALID_PROJECT_SETTINGS, new String[]{project.getName()}, project);
+ errorManager.addError(INVALID_WEBFOLDER, SeamPreferences.INVALID_PROJECT_SETTINGS, new String[]{viewFolder!=null?viewFolder:"", project.getName()}, project);
}
validateSorceFolder(project, pref.get(ISeamFacetDataModelProperties.ENTITY_BEAN_SOURCE_FOLDER, null),
pref.get(ISeamFacetDataModelProperties.ENTITY_BEAN_PACKAGE_NAME, null),
@@ -266,8 +276,9 @@
INVALID_TEST_SRC,
INVALID_TEST_PACKAGE_NAME);
}
- if(!isConnectionProfileValid(pref.get(ISeamFacetDataModelProperties.SEAM_CONNECTION_PROFILE, null), true)) {
- errorManager.addError(INVALID_CONNECTION_NAME, SeamPreferences.INVALID_PROJECT_SETTINGS, new String[]{project.getName()}, project);
+ String connectionProfile = pref.get(ISeamFacetDataModelProperties.SEAM_CONNECTION_PROFILE, null);
+ if(!isConnectionProfileValid(connectionProfile, true)) {
+ errorManager.addError(INVALID_CONNECTION_NAME, SeamPreferences.INVALID_PROJECT_SETTINGS, new String[]{connectionProfile!=null?connectionProfile:"", project.getName()}, project);
}
}
@@ -278,6 +289,7 @@
* @see org.eclipse.wst.validation.internal.provisional.core.IValidator#cleanup(org.eclipse.wst.validation.internal.provisional.core.IReporter)
*/
public void cleanup(IReporter reporter) {
+ finishValidating();
}
/* (non-Javadoc)
Deleted: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamRuntimeValidation.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamRuntimeValidation.java 2008-04-08 16:21:00 UTC (rev 7424)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamRuntimeValidation.java 2008-04-08 16:30:33 UTC (rev 7425)
@@ -1,103 +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.internal.core.validation;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.jboss.tools.seam.core.ISeamProject;
-import org.jboss.tools.seam.core.SeamCorePlugin;
-import org.jboss.tools.seam.core.project.facet.SeamRuntime;
-
-/**
- * @author Viacheslav Kabanovich
- */
-public class SeamRuntimeValidation {
-
- public static final String MARKER_TYPE = "org.jboss.tools.seam.core.seamProblem";
- static final String ATTR_KIND = "kind";
- static final String RUNTIME_KIND = "SeamRuntimeProblem";
-
- public SeamRuntimeValidation() {}
-
- public void validate(ISeamProject project) throws CoreException {
- IMarker marker = findErrorMarker(project);
- String runtimeName = project.getRuntimeName();
- SeamRuntime runtime = project.getRuntime();
- if(runtime != null || runtimeName == null || runtimeName.length() == 0) {
- if(marker == null) return;
- removeMarker(marker);
- return;
- }
- String message = "Seam runtime " + runtimeName + " does not exist.";
- if(marker != null) {
- if(message.equals(marker.getAttribute(IMarker.MESSAGE, null))) {
- return;
- }
- marker.setAttribute(IMarker.MESSAGE, message);
- } else {
- createMarker(project, message);
- }
- }
-
- private IMarker findErrorMarker(ISeamProject project) throws CoreException {
- IMarker[] ms = project.getProject().findMarkers(MARKER_TYPE, true, IResource.DEPTH_ZERO);
- if(ms == null) return null;
- for (int i = 0; i < ms.length; i++) {
- int s = ms[i].getAttribute(IMarker.SEVERITY, IMarker.SEVERITY_ERROR);
- if(s != IMarker.SEVERITY_WARNING) continue;
- String kind = ms[i].getAttribute(ATTR_KIND, null);
- if(kind == null) continue;
- if(kind.equals(RUNTIME_KIND)) {
- return ms[i];
- }
- }
- return null;
- }
-
- private void removeMarker(final IMarker marker) {
- IWorkspaceRunnable r = new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- marker.delete();
- }
- };
- run(r);
- }
-
- private void createMarker(final ISeamProject project, final String message) throws CoreException {
- IWorkspaceRunnable r = new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- doCreateMarker(project, message);
- }
- };
- run(r);
- }
-
- private void doCreateMarker(ISeamProject project, String message) throws CoreException {
- IMarker marker = project.getProject().createMarker(MARKER_TYPE);
- marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_WARNING);
- marker.setAttribute(IMarker.MESSAGE, message);
- marker.setAttribute(ATTR_KIND, RUNTIME_KIND);
- }
-
- private void run(IWorkspaceRunnable r) {
- try {
- ResourcesPlugin.getWorkspace().run(r, null,IWorkspace.AVOID_UPDATE, null);
- } catch (CoreException e) {
- SeamCorePlugin.getPluginLog().logError(e);
- }
- }
-
-}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidator.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidator.java 2008-04-08 16:21:00 UTC (rev 7424)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidator.java 2008-04-08 16:30:33 UTC (rev 7425)
@@ -35,7 +35,7 @@
public SeamValidator(IValidator validatorManager,
SeamContextValidationHelper coreHelper, IReporter reporter,
SeamValidationContext validationContext, ISeamProject project) {
- super(validatorManager, coreHelper, reporter, project);
+ super(validatorManager, coreHelper, reporter, project, ISeamValidator.MARKED_SEAM_RESOURCE_MESSAGE_GROUP);
this.validationContext = validationContext;
this.projectName = project.getProject().getName();
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/ValidationErrorManager.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/ValidationErrorManager.java 2008-04-08 16:21:00 UTC (rev 7424)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/ValidationErrorManager.java 2008-04-08 16:30:33 UTC (rev 7425)
@@ -28,7 +28,6 @@
/**
* @author Alexey Kazakov
- *
*/
public class ValidationErrorManager implements IValidationErrorManager {
@@ -41,6 +40,7 @@
protected SeamContextValidationHelper coreHelper;
protected IReporter reporter;
protected ISeamProject project;
+ protected String markerId;
/**
* Constructor
@@ -51,11 +51,12 @@
*/
public ValidationErrorManager(IValidator validatorManager,
SeamContextValidationHelper coreHelper, IReporter reporter,
- ISeamProject project) {
+ ISeamProject project, String markerId) {
this.validationManager = validatorManager;
this.coreHelper = coreHelper;
this.project = project;
this.reporter = reporter;
+ this.markerId = markerId;
}
protected String getBaseName() {
@@ -99,6 +100,10 @@
addError(messageId, preferenceKey, messageArguments, 0, 0, target);
}
+ private String getMarkerId() {
+ return markerId;
+ }
+
/*
* (non-Javadoc)
*
@@ -120,7 +125,7 @@
IMessage message = new Message(getBaseName(), messageSeverity,
messageId, messageArguments, target,
- ISeamValidator.MARKED_SEAM_RESOURCE_MESSAGE_GROUP);
+ getMarkerId());
message.setLength(length);
message.setOffset(offset);
try {
@@ -169,17 +174,24 @@
/*
* (non-Javadoc)
*
- * @see org.jboss.tools.seam.internal.core.validation.IValidationErrorManager#removeMessagesFromResources(java.util.Set,
- * java.lang.String)
+ * @see org.jboss.tools.seam.internal.core.validation.IValidationErrorManager#removeMessagesFromResources(java.util.Set)
*/
- public void removeMessagesFromResources(Set<IResource> resources, String messageGroup) {
+ public void removeMessagesFromResources(Set<IResource> resources) {
for (IResource r : resources) {
- reporter.removeMessageSubset(validationManager, r, messageGroup);
+ reporter.removeMessageSubset(validationManager, r, getMarkerId());
}
}
/*
* (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.IValidationErrorManager#removeAllMessagesFromResource(org.eclipse.core.resources.IResource)
+ */
+ public void removeAllMessagesFromResource(IResource resource) {
+ reporter.removeAllMessages(validationManager, resource);
+ }
+
+ /*
+ * (non-Javadoc)
* @see org.jboss.tools.seam.internal.core.validation.IValidationErrorManager#setProject(org.jboss.tools.seam.core.ISeamProject)
*/
public void setProject(ISeamProject project) {
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/messages.properties
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/messages.properties 2008-04-08 16:21:00 UTC (rev 7424)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/messages.properties 2008-04-08 16:30:33 UTC (rev 7425)
@@ -46,18 +46,18 @@
UNPAIRED_GETTER_OR_SETTER=Property "{0}" has only {1}. {2} is missing.
#Invalid seam project settings
-INVALID_PARENT_PROJECT=Main Seam project specified for Seam project "{0}" does not exist.
-INVALID_RUNTIME=Seam Runtime specified for Seam project "{0}" does not exist. Please correct this property in "Seam settings" page (Project->Properties->Seam Settings).
-INVALID_WEBFOLDER=View Folder specified for Seam project "{0}" does not exist. Please correct this property in "Seam settings" page (Project->Properties->Seam Settings).
-INVALID_EJB_PROJECT=EJB project specified for Seam project "{0}" does not exist. Please correct this property in "Seam settings" page (Project->Properties->Seam Settings).
-INVALID_TEST_PROJECT=Test EJB project specified for Seam project "{0}" does not exist. Please correct this property in "Seam settings" page (Project->Properties->Seam Settings).
-INVALID_MODEL_SRC=Model source folder specified for Seam project "{0}" does not exist. Please correct this property in "Seam settings" page (Project->Properties->Seam Settings).
-INVALID_ACTION_SRC=Action / Form / Conversation source folder specified for Seam project "{0}" does not exist. Please correct this property in "Seam settings" page (Project->Properties->Seam Settings).
-INVALID_TEST_SRC=Test source folder specified for Seam project "{0}" does not exist. Please correct this property in "Seam settings" page (Project->Properties->Seam Settings).
-INVALID_MODEL_PACKAGE_NAME=Model package name specified for Seam project "{0}" is not valid. Please correct this property in "Seam settings" page (Project->Properties->Seam Settings).
-INVALID_ACTION_PACKAGE_NAME=Action / Form / Conversation package name specified for Seam project "{0}" is not valid. Please correct this property in "Seam settings" page (Project->Properties->Seam Settings).
-INVALID_TEST_PACKAGE_NAME=Test package name specified for Seam project "{0}" is not valid. Please correct this property in "Seam settings" page (Project->Properties->Seam Settings).
-INVALID_CONNECTION_NAME=Connection profiler specified for Seam project "{0}" does not exist. Please correct this property in "Seam settings" page (Project->Properties->Seam Settings).
+INVALID_PARENT_PROJECT=Main Seam project "{0}" specified for Seam project "{1}" does not exist.
+INVALID_RUNTIME=Seam Runtime "{0}" specified for Seam project "{1}" does not exist. Please correct this property in "Seam settings" page (Project->Properties->Seam Settings).
+INVALID_WEBFOLDER=View Folder "{0}" specified for Seam project "{1}" does not exist. Please correct this property in "Seam settings" page (Project->Properties->Seam Settings).
+INVALID_EJB_PROJECT=EJB project "{0}" specified for Seam project "{1}" does not exist. Please correct this property in "Seam settings" page (Project->Properties->Seam Settings).
+INVALID_TEST_PROJECT=Test project "{0}" specified for Seam project "{1}" does not exist. Please correct this property in "Seam settings" page (Project->Properties->Seam Settings).
+INVALID_MODEL_SRC=Model source folder "{0}" specified for Seam project "{1}" does not exist. Please correct this property in "Seam settings" page (Project->Properties->Seam Settings).
+INVALID_ACTION_SRC=Action / Form / Conversation source folder "{0}" specified for Seam project "{1}" does not exist. Please correct this property in "Seam settings" page (Project->Properties->Seam Settings).
+INVALID_TEST_SRC=Test source folder "{0}" specified for Seam project "{1}" does not exist. Please correct this property in "Seam settings" page (Project->Properties->Seam Settings).
+INVALID_MODEL_PACKAGE_NAME=Model package name "{0}" specified for Seam project "{1}" is not valid. Please correct this property in "Seam settings" page (Project->Properties->Seam Settings).
+INVALID_ACTION_PACKAGE_NAME=Action / Form / Conversation package name "{0}" specified for Seam project "{1}" is not valid. Please correct this property in "Seam settings" page (Project->Properties->Seam Settings).
+INVALID_TEST_PACKAGE_NAME=Test package name "{0}" specified for Seam project "{1}" is not valid. Please correct this property in "Seam settings" page (Project->Properties->Seam Settings).
+INVALID_CONNECTION_NAME=Connection profiler "{0}" specified for Seam project "{1}" does not exist. Please correct this property in "Seam settings" page (Project->Properties->Seam Settings).
#Messages for Progress Monitor
SEARCHING_RESOURCES=project "{0}"; searching resources for validation.
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/RefactoringTestProject-ejb/.project
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/projects/RefactoringTestProject-ejb/.project 2008-04-08 16:21:00 UTC (rev 7424)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/projects/RefactoringTestProject-ejb/.project 2008-04-08 16:30:33 UTC (rev 7425)
@@ -15,6 +15,11 @@
<arguments>
</arguments>
</buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.validation.validationbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/RefactoringTestProject-test/.project
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/projects/RefactoringTestProject-test/.project 2008-04-08 16:21:00 UTC (rev 7424)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/projects/RefactoringTestProject-test/.project 2008-04-08 16:30:33 UTC (rev 7425)
@@ -15,6 +15,11 @@
<arguments>
</arguments>
</buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.validation.validationbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/RefactoringTestProject-war/.project
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/projects/RefactoringTestProject-war/.project 2008-04-08 16:21:00 UTC (rev 7424)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/projects/RefactoringTestProject-war/.project 2008-04-08 16:30:33 UTC (rev 7425)
@@ -15,6 +15,11 @@
<arguments>
</arguments>
</buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.validation.validationbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamProjectPropertyValidatorTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamProjectPropertyValidatorTest.java 2008-04-08 16:21:00 UTC (rev 7424)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamProjectPropertyValidatorTest.java 2008-04-08 16:30:33 UTC (rev 7425)
@@ -59,21 +59,41 @@
pref.put(ISeamFacetDataModelProperties.SEAM_CONNECTION_PROFILE, "invalidConnectionName");
pref.flush();
- // Force validation.
- warProject.getFolder("newFolder").create(true, true, null);
- ejbProject.getFolder("newFolder").create(true, true, null);
- testProject.getFolder("newFolder").create(true, true, null);
-
EditorTestHelper.joinBackgroundActivities();
}
}
public void testProjectNameValidation() throws CoreException {
- IEclipsePreferences pref = SeamCorePlugin.getSeamPreferences(ejbProject);
- System.out.println(pref.get(ISeamFacetDataModelProperties.SEAM_PARENT_PROJECT, "---"));
- assertMarkerIsCreated(ejbProject, null, "invalidParentProjectName", -1);
- assertMarkerIsCreated(testProject, null, "invalidParentProjectName", -1);
- assertMarkerIsCreated(warProject, null, "invalidEjbProjectName", -1);
- assertMarkerIsCreated(warProject, null, "invalidTestProjectName", -1);
+ assertMarkerIsCreated(ejbProject, null, ".*invalidParentProjectName.*");
+ assertMarkerIsCreated(testProject, null, ".*invalidParentProjectName.*");
+ assertMarkerIsCreated(warProject, null, ".*invalidEjbProjectName.*");
+ assertMarkerIsCreated(warProject, null, ".*invalidTestProjectName.*");
}
+
+ public void testFolderNameValidation() throws CoreException {
+ assertMarkerIsCreated(warProject, null, ".*invalidWebFolderPath.*");
+ assertMarkerIsCreated(warProject, null, ".*invalidModelSrcFolderPath.*");
+ assertMarkerIsCreated(warProject, null, ".*invalidSessionBeanSrcFolderPath.*");
+ assertMarkerIsCreated(warProject, null, ".*invalidTestSrcFolderPath.*");
+ }
+
+ public void testPackageNameValidation() throws CoreException {
+ assertMarkerIsCreated(warProject, null, ".*invalid model package name.*");
+ assertMarkerIsCreated(warProject, null, ".*invalid session bean package name.*");
+ assertMarkerIsCreated(warProject, null, ".*invalid test package name.*");
+ }
+
+ public void testRuntimeNameValidation() throws CoreException {
+ assertMarkerIsCreated(warProject, null, ".*invalidRuntimeName.*");
+ }
+
+ public void testConnectionProfileNameValidation() throws CoreException {
+ assertMarkerIsCreated(warProject, null, ".*invalidConnectionName.*");
+ }
+
+ public static void main(String[] args) {
+ String errorMarker = "Model package name \"invalid model package name\" specified for Seam project \"RefactoringTestProject-war\" is not valid. Please correct this property in \"Seam settings\" page (Project->Properties->Seam Settings).";
+// String errorMarker = "Main Seam project \"invalidParentProjectName ";
+ System.out.println(errorMarker.matches(".*invalid model package name.*"));
+ }
}
\ No newline at end of file
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java 2008-04-08 16:21:00 UTC (rev 7424)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java 2008-04-08 16:30:33 UTC (rev 7425)
@@ -29,7 +29,7 @@
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.core.SeamPreferences;
import org.jboss.tools.seam.internal.core.SeamProject;
-import org.jboss.tools.seam.internal.core.validation.SeamRuntimeValidation;
+import org.jboss.tools.seam.internal.core.validation.ISeamValidator;
import org.jboss.tools.test.util.JUnitUtils;
import org.jboss.tools.test.util.ProjectImportTestSetup;
import org.jboss.tools.test.util.xpl.EditorTestHelper;
@@ -440,7 +440,7 @@
IFile targetFile = project.getFile(targetPath);
targetFile.setContents(newContentFile.getContents(), true, false, new NullProgressMonitor());
refreshProject(project);
- assertMarkerIsCreated(targetFile, SeamRuntimeValidation.MARKER_TYPE, pattern, line);
+ assertMarkerIsCreated(targetFile, ISeamValidator.SEAM_RESOURCE_MESSAGE_ID, pattern, line);
}
/**
@@ -453,7 +453,7 @@
String pattern, int line) throws CoreException {
IFile targetFile = project.getFile(targetPath);
- assertMarkerIsCreated(targetFile, SeamRuntimeValidation.MARKER_TYPE, pattern, line);
+ assertMarkerIsCreated(targetFile, ISeamValidator.SEAM_RESOURCE_MESSAGE_ID, pattern, line);
}
/**
17 years, 9 months
JBoss Tools SVN: r7424 - trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-04-08 12:21:00 -0400 (Tue, 08 Apr 2008)
New Revision: 7424
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EclipseResourceUtil.java
Log:
JBIDE-1828
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EclipseResourceUtil.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EclipseResourceUtil.java 2008-04-08 15:44:27 UTC (rev 7423)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EclipseResourceUtil.java 2008-04-08 16:21:00 UTC (rev 7424)
@@ -516,7 +516,7 @@
}
public static List<String> getJREClassPath(IProject project) throws CoreException {
- if(!project.hasNature(JavaCore.NATURE_ID)) return null;
+ if(project == null || !project.isAccessible() || !project.hasNature(JavaCore.NATURE_ID)) return null;
ArrayList<String> l = new ArrayList<String>();
IJavaProject javaProject = JavaCore.create(project);
IClasspathEntry[] es0 = javaProject.getRawClasspath();
17 years, 9 months
JBoss Tools SVN: r7423 - in trunk/jsf/docs: userguide/en/modules and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: smukhina
Date: 2008-04-08 11:44:27 -0400 (Tue, 08 Apr 2008)
New Revision: 7423
Modified:
trunk/jsf/docs/jsf_tools_tutorial/en/modules/jsf_application.xml
trunk/jsf/docs/userguide/en/modules/editors.xml
trunk/jsf/docs/userguide/en/modules/palette.xml
Log:
http://jira.jboss.com/jira/browse/JBQA-1524
tag "name" is corrected to avoid ()
Modified: trunk/jsf/docs/jsf_tools_tutorial/en/modules/jsf_application.xml
===================================================================
--- trunk/jsf/docs/jsf_tools_tutorial/en/modules/jsf_application.xml 2008-04-08 15:36:03 UTC (rev 7422)
+++ trunk/jsf/docs/jsf_tools_tutorial/en/modules/jsf_application.xml 2008-04-08 15:44:27 UTC (rev 7423)
@@ -113,8 +113,8 @@
two JSP presentation files and then the navigation rule to connect them as views. Later,
we will complete the coding for the JSP presentation files. With JBoss Developer Studio,
we can do all of this in the Diagram mode of the configuration file editor.</para>
- <section id="AddingTwoViews(JSPPages)">
- <?dbhtml filename="AddingTwoViews(JSPPages).html"?>
+ <section id="AddingTwoViewsJSPPages">
+ <?dbhtml filename="AddingTwoViewsJSPPages.html"?>
<title>Adding Two Views (JSP Pages)</title>
<itemizedlist continuation="continues">
<listitem>
@@ -159,8 +159,8 @@
</listitem>
</itemizedlist>
- <section id="CreatingTheTransition(NavigationRule)">
- <?dbhtml filename="CreatingTheTransition(NavigationRule).html"?>
+ <section id="CreatingTheTransitionNavigationRule">
+ <?dbhtml filename="CreatingTheTransitionNavigationRule.html"?>
<title>Creating the Transition (Navigation Rule)</title>
<itemizedlist continuation="continues">
<listitem>
Modified: trunk/jsf/docs/userguide/en/modules/editors.xml
===================================================================
--- trunk/jsf/docs/userguide/en/modules/editors.xml 2008-04-08 15:36:03 UTC (rev 7422)
+++ trunk/jsf/docs/userguide/en/modules/editors.xml 2008-04-08 15:44:27 UTC (rev 7423)
@@ -1194,7 +1194,7 @@
</section>
- <section id="GraphicalWebApplicationFile(web.xml)Editor">
+ <section id="GraphicalWebApplicationFileEditor">
<title>Graphical Web Application File (web.xml) Editor</title>
Modified: trunk/jsf/docs/userguide/en/modules/palette.xml
===================================================================
--- trunk/jsf/docs/userguide/en/modules/palette.xml 2008-04-08 15:36:03 UTC (rev 7422)
+++ trunk/jsf/docs/userguide/en/modules/palette.xml 2008-04-08 15:44:27 UTC (rev 7423)
@@ -392,8 +392,8 @@
<!--<link linkend="CreatingAndWorkingCustomCapability">Learn how to import</link>. --></para>
</section>
</section>
- <section id="UsingThePalette(IncludingOne-ClickTagInsertion)">
- <?dbhtml filename="UsingThePalette(IncludingOne-ClickTagInsertion).html"?>
+ <section id="UsingThePaletteIncludingOneClickTagInsertion">
+ <?dbhtml filename="UsingThePaletteIncludingOneClickTagInsertion.html"?>
<title>Using the Palette</title>
<section id="InsertingTagsIntoAJSPFile">
<?dbhtml filename="InsertingTagsIntoAJSPFile.html"?>
17 years, 9 months
JBoss Tools SVN: r7422 - in trunk/seam/docs/reference/en: modules and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: afedosik
Date: 2008-04-08 11:36:03 -0400 (Tue, 08 Apr 2008)
New Revision: 7422
Added:
trunk/seam/docs/reference/en/images/seam_preferences/seam_preferences2_1.png
Modified:
trunk/seam/docs/reference/en/images/seam_preferences/seam_preferences1.png
trunk/seam/docs/reference/en/modules/seam_preferences.xml
Log:
http://jira.jboss.com/jira/browse/JBDS-272 Project Preferences section updated.
Modified: trunk/seam/docs/reference/en/images/seam_preferences/seam_preferences1.png
===================================================================
(Binary files differ)
Added: trunk/seam/docs/reference/en/images/seam_preferences/seam_preferences2_1.png
===================================================================
(Binary files differ)
Property changes on: trunk/seam/docs/reference/en/images/seam_preferences/seam_preferences2_1.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/seam/docs/reference/en/modules/seam_preferences.xml
===================================================================
--- trunk/seam/docs/reference/en/modules/seam_preferences.xml 2008-04-08 15:03:01 UTC (rev 7421)
+++ trunk/seam/docs/reference/en/modules/seam_preferences.xml 2008-04-08 15:36:03 UTC (rev 7422)
@@ -98,8 +98,13 @@
<title>Project Preferences</title>
<para>Once Seam project is created you can modify its settings. Right click on Seam project in Project Explorer and select <emphasis><property>Properties > Seam Settings</property>.</emphasis></para>
+ <para>This project properties page allows you to have a flexible project layout. It means that you are not restricted with specific project structure. You can use the Seam wizards
+ (New Action, Form, Entity, etc.) on Maven, command line seam-gen or your own project structure. </para>
+ <para>Moreover you are not required to use the Seam New Project wizard to benefit from Seam artifact wizards. You can just enable Seam on your existing project and configure the folders as you want.</para>
- <figure>
+ <!-- <para>After <property>Seam support</property> is checked</para> -->
+
+ <figure>
<title>Properties for Seam Project</title>
<mediaobject>
<imageobject>
@@ -108,9 +113,19 @@
</mediaobject>
</figure>
- <para></para>
+ <para>In Seam Wizards (New Action, Form, Entity, Conversation, Generate Entities) you can get a quick access to project settings
+ using the <property>Settings</property> link in the upper right corner of each wizard.</para>
+ <figure>
+ <title>Settings Link</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/seam_preferences/seam_preferences2_1.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
</section>
</chapter>
17 years, 9 months