JBoss Tools SVN: r15568 - trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-05-27 14:02:25 -0400 (Wed, 27 May 2009)
New Revision: 15568
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractTagLib.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2808
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractTagLib.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractTagLib.java 2009-05-27 17:08:06 UTC (rev 15567)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractTagLib.java 2009-05-27 18:02:25 UTC (rev 15568)
@@ -81,20 +81,70 @@
* @see org.jboss.tools.jst.web.kb.taglib.TagLibrary#getComponents(org.jboss.tools.jst.web.kb.KbQuery, org.jboss.tools.jst.web.kb.PageContext)
*/
public IComponent[] getComponents(KbQuery query, IPageContext context) {
- String tagName = null;
+ String prefix = getPrefix(query, context);
+ return getComponents(query, prefix, context);
+ }
+
+ private String getPrefix(KbQuery query, IPageContext context) {
+ String prefix = null;
+ Map<String, INameSpace> nameSpaces = context.getNameSpaces(query.getOffset());
+ if(nameSpaces!=null) {
+ INameSpace nameSpace = nameSpaces.get(getURI());
+ if(nameSpace!=null) {
+ prefix = nameSpace.getPrefix();
+ }
+ }
+ return prefix;
+ }
+
+ private static final IComponent[] EMPTY_ARRAY = new IComponent[0];
+
+ private IComponent[] getComponents(KbQuery query, String prefix, IPageContext context) {
+ String fullTagName = null;
boolean mask = false;
if(query.getType()==KbQuery.Type.TAG_NAME) {
- tagName = query.getValue();
+ fullTagName = query.getValue();
mask = query.isMask();
} else {
- tagName = query.getLastParentTag();
+ fullTagName = query.getLastParentTag();
}
- if(tagName == null) {
+ if(fullTagName == null) {
return null;
}
if(mask) {
- return getComponents(tagName);
+ if(fullTagName.length()==0) {
+ return getComponents();
+ }
+ if(prefix==null) {
+ return getComponents(fullTagName);
+ }
}
+ String tagName = fullTagName;
+ int prefixIndex = fullTagName.indexOf(':');
+ String queryPrefix = null;
+ if(prefix!=null && prefixIndex>-1) {
+ queryPrefix = fullTagName.substring(0, prefixIndex);
+ if(prefixIndex<fullTagName.length()-1) {
+ tagName = fullTagName.substring(prefixIndex+1);
+ } else {
+ tagName = null;
+ }
+ }
+ if(mask) {
+ if(prefixIndex<0) {
+ if(prefix.startsWith(tagName)) {
+ return getComponents();
+ }
+ return EMPTY_ARRAY;
+ }
+ if(prefix.equals(queryPrefix)) {
+ if(tagName == null) {
+ return getComponents();
+ }
+ return getComponents(tagName);
+ }
+ return EMPTY_ARRAY;
+ }
return new IComponent[]{getComponent(tagName)};
}
@@ -173,21 +223,13 @@
attributesInfo.put(URI, s);
}
-
/* (non-Javadoc)
* @see org.jboss.tools.jst.web.kb.ProposalProcessor#getProposals(org.jboss.tools.jst.web.kb.KbQuery, org.jboss.tools.jst.web.kb.PageContext)
*/
public TextProposal[] getProposals(KbQuery query, IPageContext context) {
- String prefix = null;
- Map<String, INameSpace> nameSpaces = context.getNameSpaces(query.getOffset());
- if(nameSpaces!=null) {
- INameSpace nameSpace = nameSpaces.get(getURI());
- if(nameSpace!=null) {
- prefix = nameSpace.getPrefix();
- }
- }
+ String prefix = getPrefix(query, context);
List<TextProposal> proposals = new ArrayList<TextProposal>();
- IComponent[] components = getComponents(query, context);
+ IComponent[] components = getComponents(query, prefix, context);
if(query.getType() == KbQuery.Type.TAG_NAME) {
for (int i = 0; i < components.length; i++) {
TextProposal proposal = new TextProposal();
@@ -296,5 +338,4 @@
protected void loadAttributeValues(Element element) {
setURI(attributesInfo.get(URI));
}
-
}
\ No newline at end of file
15 years, 7 months
JBoss Tools SVN: r15567 - in trunk/seam/plugins/org.jboss.tools.seam.ui: src/org/jboss/tools/seam/ui/refactoring and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2009-05-27 13:08:06 -0400 (Wed, 27 May 2009)
New Revision: 15567
Added:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamAbstractHandler.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamContextVariableRenameHandler.java
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamComponentRenameHandler.java
Log:
Seam Context Variable Refactoring https://jira.jboss.org/jira/browse/JBIDE-1077
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2009-05-27 15:57:47 UTC (rev 15566)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2009-05-27 17:08:06 UTC (rev 15567)
@@ -553,6 +553,13 @@
style="push"
tooltip="Rename Seam Component">
</command>
+ <command
+ commandId="org.jboss.tools.seam.ui.refactoring.variable"
+ id="org.jboss.tools.seam.ui.open.component.submenu2"
+ label="Rename Seam Context Variable"
+ style="push"
+ tooltip="Rename Seam Context Variable">
+ </command>
</menu>
</menuContribution>
</extension>
@@ -564,6 +571,11 @@
description="Seam Component Renaming"
name="Seam Component Renaming">
</command>
+ <command
+ id="org.jboss.tools.seam.ui.refactoring.variable"
+ description="Seam Context Variable Renaming"
+ name="Seam Context Variable Renaming">
+ </command>
</extension>
<extension
@@ -571,6 +583,9 @@
<handler
commandId="org.jboss.tools.seam.ui.refactoring.component"
class="org.jboss.tools.seam.ui.refactoring.SeamComponentRenameHandler"/>
+ <handler
+ commandId="org.jboss.tools.seam.ui.refactoring.variable"
+ class="org.jboss.tools.seam.ui.refactoring.SeamContextVariableRenameHandler"/>
</extension>
<extension
Added: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamAbstractHandler.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamAbstractHandler.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamAbstractHandler.java 2009-05-27 17:08:06 UTC (rev 15567)
@@ -0,0 +1,19 @@
+package org.jboss.tools.seam.ui.refactoring;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.jobs.Job;
+import org.jboss.tools.seam.ui.SeamGuiPlugin;
+
+public abstract class SeamAbstractHandler extends AbstractHandler {
+ protected static void saveAndBuild(){
+ if(!SeamGuiPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().saveAllEditors(true))
+ return;
+
+ try {
+ Job.getJobManager().join(ResourcesPlugin.FAMILY_AUTO_BUILD, null);
+ } catch (InterruptedException e) {
+ // do nothing
+ }
+ }
+}
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamAbstractHandler.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamComponentRenameHandler.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamComponentRenameHandler.java 2009-05-27 15:57:47 UTC (rev 15566)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamComponentRenameHandler.java 2009-05-27 17:08:06 UTC (rev 15567)
@@ -12,14 +12,11 @@
import java.util.Set;
-import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IEditorInput;
@@ -32,14 +29,13 @@
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.internal.core.refactoring.RenameComponentProcessor;
import org.jboss.tools.seam.internal.core.refactoring.RenameComponentRefactoring;
-import org.jboss.tools.seam.ui.SeamGuiPlugin;
import org.jboss.tools.seam.ui.SeamUIMessages;
import org.jboss.tools.seam.ui.wizard.RenameComponentWizard;
/**
* @author Alexey Kazakov
*/
-public class SeamComponentRenameHandler extends AbstractHandler {
+public class SeamComponentRenameHandler extends SeamAbstractHandler {
/*
* (non-Javadoc)
@@ -94,15 +90,4 @@
// operation was canceled
}
}
-
- private static void saveAndBuild(){
- if(!SeamGuiPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().saveAllEditors(true))
- return;
-
- try {
- Job.getJobManager().join(ResourcesPlugin.FAMILY_AUTO_BUILD, null);
- } catch (InterruptedException e) {
- // do nothing
- }
- }
}
Added: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamContextVariableRenameHandler.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamContextVariableRenameHandler.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamContextVariableRenameHandler.java 2009-05-27 17:08:06 UTC (rev 15567)
@@ -0,0 +1,169 @@
+/*******************************************************************************
+ * Copyright (c) 2009 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.refactoring;
+
+import java.io.IOException;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.internal.ui.text.FastJavaPartitionScanner;
+import org.eclipse.jdt.ui.text.IJavaPartitions;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.Document;
+import org.eclipse.jface.text.TextSelection;
+import org.eclipse.jface.text.rules.IToken;
+import org.eclipse.jface.text.rules.Token;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.jboss.tools.common.util.FileUtil;
+import org.jboss.tools.seam.core.ISeamComponent;
+import org.jboss.tools.seam.core.SeamCorePlugin;
+import org.jboss.tools.seam.internal.core.refactoring.RenameComponentProcessor;
+import org.jboss.tools.seam.internal.core.refactoring.RenameComponentRefactoring;
+import org.jboss.tools.seam.ui.SeamUIMessages;
+import org.jboss.tools.seam.ui.wizard.RenameComponentWizard;
+
+/**
+ * @author Daniel Azarov
+ */
+public class SeamContextVariableRenameHandler extends SeamAbstractHandler {
+ private static final String JAVA_EXT = "java"; //$NON-NLS-1$
+ private static final String XML_EXT = "xml"; //$NON-NLS-1$
+ private static final String XHTML_EXT = "xhtml"; //$NON-NLS-1$
+ private static final String JSP_EXT = "jsp"; //$NON-NLS-1$
+ private static final String PROPERTIES_EXT = "properties"; //$NON-NLS-1$
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.
+ * ExecutionEvent)
+ */
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ IEditorPart editor = HandlerUtil.getActiveEditor(event);
+ Shell activeShell = HandlerUtil.getActiveShell(event);
+
+ saveAndBuild();
+
+ ISelection sel = editor.getEditorSite().getSelectionProvider().getSelection();
+
+ if(sel == null || sel.isEmpty())
+ invokeRenameWizard(null, activeShell);
+
+ if(sel instanceof TextSelection && editor.getEditorInput() instanceof FileEditorInput){
+ TextSelection selection = (TextSelection)sel;
+
+ String text = selection.getText();
+
+ System.out.println("Selection text - "+text);
+
+ FileEditorInput input = (FileEditorInput)editor.getEditorInput();
+
+ IFile file = input.getFile();
+
+ String ext = file.getFileExtension();
+ String content = null;
+ try {
+ content = FileUtil.readStream(file.getContents());
+ } catch (CoreException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ return null;
+ }
+ if(ext.equalsIgnoreCase(JAVA_EXT)){
+ findContextVariableInJava(file, content, selection);
+ } else if(ext.equalsIgnoreCase(XML_EXT) || ext.equalsIgnoreCase(XHTML_EXT) || ext.equalsIgnoreCase(JSP_EXT))
+ findContextVariableInDOM(file, content, selection);
+ else if(ext.equalsIgnoreCase(PROPERTIES_EXT))
+ findContextVariableInProperties(file, content, selection);
+ }
+ return null;
+ }
+
+ private void findContextVariableInJava(IFile file, String content, TextSelection selection){
+ try {
+ FastJavaPartitionScanner scaner = new FastJavaPartitionScanner();
+ Document document = new Document(content);
+ scaner.setRange(document, 0, document.getLength());
+ IToken token = scaner.nextToken();
+ while(token!=null && token!=Token.EOF) {
+ if(IJavaPartitions.JAVA_STRING.equals(token.getData())) {
+ int length = scaner.getTokenLength();
+ int offset = scaner.getTokenOffset();
+ String value = document.get(offset, length);
+ if(value.indexOf('{')>-1) {
+ //scanString(file, value, offset);
+ }
+ }
+ token = scaner.nextToken();
+ }
+ } catch (BadLocationException e) {
+ SeamCorePlugin.getDefault().logError(e);
+ }
+ }
+
+ private void findContextVariableInDOM(IFile file, String content, TextSelection selection){
+ IModelManager manager = StructuredModelManager.getModelManager();
+ if(manager == null) {
+ return;
+ }
+ IStructuredModel model = null;
+ try {
+ model = manager.getModelForRead(file);
+ if (model instanceof IDOMModel) {
+ IDOMModel domModel = (IDOMModel) model;
+ IDOMDocument document = domModel.getDocument();
+ //scanChildNodes(file, document);
+ }
+ } catch (CoreException e) {
+ SeamCorePlugin.getDefault().logError(e);
+ } catch (IOException e) {
+ SeamCorePlugin.getDefault().logError(e);
+ } finally {
+ if (model != null) {
+ model.releaseFromRead();
+ }
+ }
+ }
+
+ private void findContextVariableInProperties(IFile file, String content, TextSelection selection){
+
+ }
+
+
+
+ public static void invokeRenameWizard(ISeamComponent component, Shell activeShell) {
+ saveAndBuild();
+
+ RenameComponentProcessor processor = new RenameComponentProcessor(component);
+ RenameComponentRefactoring refactoring = new RenameComponentRefactoring(processor);
+ RenameComponentWizard wizard = new RenameComponentWizard(refactoring, component);
+ RefactoringWizardOpenOperation op = new RefactoringWizardOpenOperation(wizard);
+ try {
+ String titleForFailedChecks = SeamUIMessages.SEAM_COMPONENT_RENAME_HANDLER_ERROR;
+ op.run(activeShell, titleForFailedChecks);
+ } catch (final InterruptedException irex) {
+ // operation was canceled
+ }
+ }
+
+
+}
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamContextVariableRenameHandler.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 7 months
JBoss Tools SVN: r15566 - in trunk/hibernatetools: plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2009-05-27 11:57:47 -0400 (Wed, 27 May 2009)
New Revision: 15566
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/VisualEditor.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmDiagram.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/Shape.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/SpecialOrmShape.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ExpandeableShapeTreeEditPart.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ShapeEditPart.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ShapeTreeEditPart.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/ObjectEditorInput.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OpenDiagramActionDelegate.java
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.veditor.test/src/org/jboss/tools/hibernate/ui/veditor/editors/model/test/OrmDiagramTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4361 - refactoring -> javaProject should not be a member of OrmDiagram.
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/VisualEditor.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/VisualEditor.java 2009-05-27 15:51:53 UTC (rev 15565)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/VisualEditor.java 2009-05-27 15:57:47 UTC (rev 15566)
@@ -146,7 +146,7 @@
if (obj instanceof RootClass) {
RootClass rootClass = (RootClass)obj;
setPartName(UIVEditorMessages.VisualEditor_diagram_for + rootClass.getEntityName());
- ormDiagram = new OrmDiagram(configuration, rootClass, objectEditorInput.getJavaProject());
+ ormDiagram = new OrmDiagram(configuration, rootClass);
}
else if (obj instanceof RootClass[]) {
RootClass[] rootClasses = (RootClass[])obj;
@@ -155,7 +155,7 @@
name += " & " + rootClasses[i].getEntityName(); //$NON-NLS-1$
}
setPartName(UIVEditorMessages.VisualEditor_diagram_for + name);
- ormDiagram = new OrmDiagram(configuration, rootClasses, objectEditorInput.getJavaProject());
+ ormDiagram = new OrmDiagram(configuration, rootClasses);
}
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmDiagram.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmDiagram.java 2009-05-27 15:51:53 UTC (rev 15565)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmDiagram.java 2009-05-27 15:57:47 UTC (rev 15566)
@@ -30,6 +30,7 @@
import org.eclipse.jdt.core.IJavaProject;
import org.hibernate.cfg.Configuration;
import org.hibernate.console.ConsoleConfiguration;
+import org.hibernate.eclipse.console.utils.ProjectUtils;
import org.hibernate.mapping.Collection;
import org.hibernate.mapping.Column;
import org.hibernate.mapping.Component;
@@ -56,20 +57,16 @@
private String childrenLocations[];
private HashMap<String,OrmShape> elements = new HashMap<String,OrmShape>();
private RootClass[] ormElements;
- private Configuration configuration;
- private ConsoleConfiguration consoleConfiguration;
- private IJavaProject javaProject;
+ private ConsoleConfiguration consoleConfig;
private String[] entityNames;
public static final String HIBERNATE_MAPPING_LAYOUT_FOLDER_NAME = "hibernateMapping"; //$NON-NLS-1$
- public OrmDiagram(ConsoleConfiguration configuration, RootClass ioe, IJavaProject javaProject) {
- consoleConfiguration = configuration;
- this.configuration = configuration.getConfiguration();
+ public OrmDiagram(ConsoleConfiguration consoleConfig, RootClass ioe) {
+ this.consoleConfig = consoleConfig;
ormElements = new RootClass[1];
ormElements[0] = ioe;
entityNames = new String[1];
entityNames[0] = ioe.getEntityName();
- this.javaProject = javaProject;
childrenLocations = new String[]{new String("")}; //$NON-NLS-1$
@@ -79,16 +76,14 @@
setDirty(false);
}
- public OrmDiagram(ConsoleConfiguration configuration, RootClass[] ioe, IJavaProject javaProject) {
- consoleConfiguration = configuration;
- this.configuration = configuration.getConfiguration();
+ public OrmDiagram(ConsoleConfiguration consoleConfig, RootClass[] ioe) {
+ this.consoleConfig = consoleConfig;
ormElements = new RootClass[ioe.length];
System.arraycopy(ioe, 0, ormElements, 0, ioe.length);
entityNames = new String[ioe.length];
for (int i = 0; i < ormElements.length; i++) {
entityNames[i] = ormElements[i].getEntityName();
}
- this.javaProject = javaProject;
childrenLocations = new String[]{new String("")}; //$NON-NLS-1$
for (int i = 0; i < ormElements.length; i++) {
getOrCreatePersistentClass(ormElements[i], null);
@@ -100,6 +95,7 @@
public IPath getStoreFolderPath() {
IPath storePath = null;
+ IJavaProject javaProject = ProjectUtils.findJavaProject(consoleConfig);
if (javaProject != null && javaProject.getProject() != null) {
storePath = javaProject.getProject().getLocation();
}
@@ -118,7 +114,7 @@
for (int i = 1; i < ormElements.length; i++) {
name += "_" + ormElements[i].getClassName(); //$NON-NLS-1$
}
- return consoleConfiguration.getName() + "_" + name; //$NON-NLS-1$
+ return consoleConfig.getName() + "_" + name; //$NON-NLS-1$
}
@SuppressWarnings("unchecked")
@@ -139,9 +135,9 @@
public void refresh() {
boolean bRefresh = false;
+ final Configuration config = consoleConfig.getConfiguration();
for (int i = 0; i < ormElements.length; i++) {
- RootClass newOrmElement = (RootClass) consoleConfiguration
- .getConfiguration().getClassMapping(entityNames[i]);
+ RootClass newOrmElement = (RootClass)config.getClassMapping(entityNames[i]);
if (ormElements[i].equals(newOrmElement)) {
continue;
}
@@ -352,7 +348,8 @@
tableShape = elements.get(tableName);
if(tableShape == null) {
tableShape = createShape(databaseTable);
- Iterator iterator = getConfiguration().getClassMappings();
+ final Configuration config = consoleConfig.getConfiguration();
+ Iterator iterator = config.getClassMappings();
while (iterator.hasNext()) {
Object clazz = iterator.next();
if (clazz instanceof RootClass) {
@@ -440,7 +437,8 @@
Type type = ((Property)element).getType();
if (type.isEntityType()) {
EntityType et = (EntityType) type;
- Object clazz = getConfiguration().getClassMapping(et.getAssociatedEntityName());
+ final Configuration config = consoleConfig.getConfiguration();
+ Object clazz = config.getClassMapping(et.getAssociatedEntityName());
if (clazz instanceof RootClass) {
RootClass rootClass = (RootClass)clazz;
s = getOrCreatePersistentClass(rootClass, null);
@@ -469,11 +467,6 @@
public void update(){
firePropertyChange(REFRESH, null, null);
}
-
- protected Configuration getConfiguration() {
- return configuration;
- }
-
@SuppressWarnings("unchecked")
protected void refreshComponentReferences(ComponentShape componentShape) {
@@ -811,11 +804,7 @@
return getState(properties, getKey(shape)+".state"); //$NON-NLS-1$
}
- public IJavaProject getJavaProject() {
- return javaProject;
+ public ConsoleConfiguration getConsoleConfig() {
+ return consoleConfig;
}
-
- public ConsoleConfiguration getConsoleConfiguration() {
- return consoleConfiguration;
- }
}
\ No newline at end of file
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/Shape.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/Shape.java 2009-05-27 15:51:53 UTC (rev 15565)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/Shape.java 2009-05-27 15:57:47 UTC (rev 15566)
@@ -186,7 +186,7 @@
return ((Property) getOrmElement()).getType().getReturnedClass().getName();
}
else if (getOrmElement() instanceof Column) {
- String type = ormModelNameVisitor.getColumnSqlType((Column) getOrmElement(), getOrmDiagram().getConsoleConfiguration());
+ String type = ormModelNameVisitor.getColumnSqlType((Column) getOrmElement(), getOrmDiagram().getConsoleConfig());
Column column = (Column) getOrmElement();
StringBuffer name = new StringBuffer();
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/SpecialOrmShape.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/SpecialOrmShape.java 2009-05-27 15:51:53 UTC (rev 15565)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/SpecialOrmShape.java 2009-05-27 15:57:47 UTC (rev 15566)
@@ -16,7 +16,6 @@
import org.hibernate.console.execution.ExecutionContext.Command;
import org.hibernate.mapping.Property;
import org.hibernate.mapping.RootClass;
-import org.hibernate.mapping.SimpleValue;
import org.hibernate.type.Type;
import org.jboss.tools.hibernate.ui.veditor.VisualEditorPlugin;
@@ -47,7 +46,7 @@
try {
Type type = null;
if (getOrmDiagram() != null){
- ConsoleConfiguration cfg = getOrmDiagram().getConsoleConfiguration();
+ ConsoleConfiguration cfg = getOrmDiagram().getConsoleConfig();
final Property fField = field;
type = (Type) cfg.execute(new Command(){
public Object execute() {
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ExpandeableShapeTreeEditPart.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ExpandeableShapeTreeEditPart.java 2009-05-27 15:51:53 UTC (rev 15565)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ExpandeableShapeTreeEditPart.java 2009-05-27 15:57:47 UTC (rev 15566)
@@ -62,7 +62,7 @@
Shape model = (Shape) getModel();
Object element = model.getOrmElement();
- ConsoleConfiguration cfg = model.getOrmDiagram().getConsoleConfiguration();
+ ConsoleConfiguration cfg = model.getOrmDiagram().getConsoleConfig();
setWidgetImage(ormLabelProvider.getImage(element));
setWidgetText(ormLabelProvider.getText(element, cfg));
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ShapeEditPart.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ShapeEditPart.java 2009-05-27 15:51:53 UTC (rev 15565)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ShapeEditPart.java 2009-05-27 15:57:47 UTC (rev 15566)
@@ -31,7 +31,6 @@
import org.eclipse.gef.editpolicies.SelectionEditPolicy;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.RGB;
-import org.hibernate.cfg.Configuration;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.mapping.Column;
import org.hibernate.mapping.Component;
@@ -39,7 +38,6 @@
import org.hibernate.mapping.OneToMany;
import org.hibernate.mapping.PersistentClass;
import org.hibernate.mapping.Property;
-import org.hibernate.mapping.RootClass;
import org.hibernate.mapping.SimpleValue;
import org.hibernate.mapping.Table;
import org.jboss.tools.hibernate.ui.veditor.editors.figures.TitleFigure;
@@ -48,7 +46,6 @@
import org.jboss.tools.hibernate.ui.veditor.editors.model.ModelElement;
import org.jboss.tools.hibernate.ui.veditor.editors.model.OrmDiagram;
import org.jboss.tools.hibernate.ui.veditor.editors.model.Shape;
-import org.jboss.tools.hibernate.ui.veditor.editors.model.SpecialRootClass;
import org.jboss.tools.hibernate.ui.view.views.OrmLabelProvider;
import org.jboss.tools.hibernate.ui.view.views.OrmModelImageVisitor;
import org.jboss.tools.hibernate.ui.view.views.OrmModelNameVisitor;
@@ -74,7 +71,7 @@
}
ConsoleConfiguration cfg = null;
if (model instanceof OrmDiagram) {
- cfg = ((OrmDiagram) model).getConsoleConfiguration();
+ cfg = ((OrmDiagram) model).getConsoleConfig();
}
label.setText(ormLabelProvider.getText(getElement(), cfg));
label.setBackgroundColor(getColor());
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ShapeTreeEditPart.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ShapeTreeEditPart.java 2009-05-27 15:51:53 UTC (rev 15565)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ShapeTreeEditPart.java 2009-05-27 15:57:47 UTC (rev 15566)
@@ -62,7 +62,7 @@
Shape model = (Shape) getModel();
Object element = model.getOrmElement();
- ConsoleConfiguration cfg = model.getOrmDiagram().getConsoleConfiguration();
+ ConsoleConfiguration cfg = model.getOrmDiagram().getConsoleConfig();
setWidgetImage(ormLabelProvider.getImage(element));
setWidgetText(ormLabelProvider.getText(element, cfg));
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/ObjectEditorInput.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/ObjectEditorInput.java 2009-05-27 15:51:53 UTC (rev 15565)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/ObjectEditorInput.java 2009-05-27 15:57:47 UTC (rev 15566)
@@ -10,7 +10,6 @@
******************************************************************************/
package org.jboss.tools.hibernate.ui.view.views;
-import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IPersistableElement;
@@ -21,16 +20,14 @@
protected Object fObject;
protected ConsoleConfiguration configuration;
- protected IJavaProject javaProject;
public ObjectEditorInput(Object object) {
fObject = object;
}
- public ObjectEditorInput(ConsoleConfiguration configuration, Object object, IJavaProject proj) {
+ public ObjectEditorInput(ConsoleConfiguration configuration, Object object) {
fObject = object;
this.configuration = configuration;
- javaProject = proj;
}
public Object getObject() {
@@ -72,10 +69,6 @@
return configuration;
}
- public IJavaProject getJavaProject() {
- return javaProject;
- }
-
public boolean equals(Object obj) {
return (obj instanceof ObjectEditorInput && ((ObjectEditorInput)obj).fObject == fObject);
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OpenDiagramActionDelegate.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OpenDiagramActionDelegate.java 2009-05-27 15:51:53 UTC (rev 15565)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OpenDiagramActionDelegate.java 2009-05-27 15:57:47 UTC (rev 15566)
@@ -66,12 +66,8 @@
public IEditorPart openEditor(PersistentClass persClass,
ConsoleConfiguration consoleConfiguration) throws PartInitException {
ObjectEditorInput input = hashMap.get(persClass.getRootClass());
-
-
- IJavaProject proj = ProjectUtils.findJavaProject(consoleConfiguration);
-
if(input == null) {
- input = new ObjectEditorInput(consoleConfiguration, persClass.getRootClass(), proj);
+ input = new ObjectEditorInput(consoleConfiguration, persClass.getRootClass());
hashMap.put(persClass.getRootClass(), input);
}
@@ -93,12 +89,9 @@
id += "@" + persClass.toString(); //$NON-NLS-1$
rcArr[i++] = persClass.getRootClass();
}
-
ObjectEditorInput input = hashMap.get(id);
- IJavaProject proj = ProjectUtils.findJavaProject(consoleConfiguration);
-
if (null == input) {
- input = new ObjectEditorInput(consoleConfiguration, rcArr, proj);
+ input = new ObjectEditorInput(consoleConfiguration, rcArr);
hashMap.put(id, input);
}
Modified: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.veditor.test/src/org/jboss/tools/hibernate/ui/veditor/editors/model/test/OrmDiagramTest.java
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.veditor.test/src/org/jboss/tools/hibernate/ui/veditor/editors/model/test/OrmDiagramTest.java 2009-05-27 15:51:53 UTC (rev 15565)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.veditor.test/src/org/jboss/tools/hibernate/ui/veditor/editors/model/test/OrmDiagramTest.java 2009-05-27 15:57:47 UTC (rev 15566)
@@ -43,8 +43,7 @@
public void testLoadAndSave() {
- final ConsoleConfiguration consoleConfiguration = context.mock(ConsoleConfiguration.class);
- final Configuration configuration = context.mock(Configuration.class);
+ final ConsoleConfiguration consoleConfig = context.mock(ConsoleConfiguration.class);
final RootClass ioe = context.mock(RootClass.class);
final IJavaProject javaProject = context.mock(IJavaProject.class);
final List<Object> emptyList = new ArrayList<Object>();
@@ -53,9 +52,6 @@
context.checking(new Expectations() {
{
- oneOf(consoleConfiguration).getConfiguration();
- will(returnValue(configuration));
-
oneOf(ioe).getEntityName();
will(returnValue("testEntityName")); //$NON-NLS-1$
@@ -95,14 +91,14 @@
allowing(ioe).getClassName();
will(returnValue("ClassName")); //$NON-NLS-1$
- allowing(consoleConfiguration).getName();
+ allowing(consoleConfig).getName();
will(returnValue("CCName")); //$NON-NLS-1$
allowing(ioe).getEntityName();
will(returnValue("")); //$NON-NLS-1$
}
});
- final OrmDiagram ormDiagram = new OrmDiagram(consoleConfiguration, ioe, javaProject);
+ final OrmDiagram ormDiagram = new OrmDiagram(consoleConfig, ioe);
ormDiagram.save();
// test is the folder created
File folder = new File(ormDiagram.getStoreFolderPath().toOSString());
15 years, 7 months
JBoss Tools SVN: r15565 - trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-05-27 11:51:53 -0400 (Wed, 27 May 2009)
New Revision: 15565
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageProcessor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2808
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageProcessor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageProcessor.java 2009-05-27 15:44:49 UTC (rev 15564)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageProcessor.java 2009-05-27 15:51:53 UTC (rev 15565)
@@ -48,7 +48,7 @@
proposals.add(libProposals[j]);
}
}
- if(query.getType() == KbQuery.Type.ATTRIBUTE_VALUE || query.getType() == KbQuery.Type.TEXT) {
+ if(query.getType() == KbQuery.Type.ATTRIBUTE_VALUE || ((query.getType() == KbQuery.Type.TEXT )&& context instanceof IFaceletPageContext)) {
String value = query.getValue();
//TODO convert value to EL string.
String elString = value;
15 years, 7 months
JBoss Tools SVN: r15564 - in trunk/struts/docs/struts_tools_tutorial/en: modules and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: chukhutsina
Date: 2009-05-27 11:44:49 -0400 (Wed, 27 May 2009)
New Revision: 15564
Modified:
trunk/struts/docs/struts_tools_tutorial/en/images/struts_validation/struts_validation_1.png
trunk/struts/docs/struts_tools_tutorial/en/modules/struts_application.xml
trunk/struts/docs/struts_tools_tutorial/en/modules/struts_validation.xml
Log:
<html><head><meta name="qrichtext" content="1" /></head><body style="font-size:9pt;font-family:Sans Serif">
<p>https://jira.jboss.org/jira/browse/JBDS-725 -Removed seam runtime warning. Seam guide, 9.1. General Preferences section was updated with the new info about the warnings shown while deleting a runtime that is in use.</p>
</body></html>
Modified: trunk/struts/docs/struts_tools_tutorial/en/images/struts_validation/struts_validation_1.png
===================================================================
(Binary files differ)
Modified: trunk/struts/docs/struts_tools_tutorial/en/modules/struts_application.xml
===================================================================
--- trunk/struts/docs/struts_tools_tutorial/en/modules/struts_application.xml 2009-05-27 15:43:26 UTC (rev 15563)
+++ trunk/struts/docs/struts_tools_tutorial/en/modules/struts_application.xml 2009-05-27 15:44:49 UTC (rev 15564)
@@ -255,19 +255,15 @@
<property>inputname.jsp</property></emphasis> page to the action.</para>
<itemizedlist>
<listitem>
- <para>On the left-hand side of the diagram in the column of icons, click on this
- icon:</para>
+ <para>On the left-hand side of the diagram in the column of icons, click on the Create New Connection
+ icon( <inlinemediaobject>
+ <imageobject>
+ <imagedata fileref="images/struts_application/struts_application_1.png"/>
+ </imageobject>
+ </inlinemediaobject>).</para>
</listitem>
</itemizedlist>
- <figure>
- <title>Create New Connection Icon</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/struts_application/struts_application_1.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <itemizedlist>
+ <itemizedlist>
<listitem>
<para>In the connect-the-components mode you are in now, click on the <emphasis>
<property>/pages/inputname.jsp</property>
@@ -283,18 +279,16 @@
<para>Next, we are going to create a forward for the action.</para>
<itemizedlist>
<listitem>
- <para>On the left-hand side of the diagram in the column of icons, click on this
- icon, again:</para>
+ <para>On the left-hand side of the diagram in the column of icons, click on
+ the Create New Connection
+ icon( <inlinemediaobject>
+ <imageobject>
+ <imagedata fileref="images/struts_application/struts_application_1.png"/>
+ </imageobject>
+ </inlinemediaobject>), again.</para>
</listitem>
</itemizedlist>
- <figure>
- <title>Create New Connection Icon</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/struts_application/struts_application_1.png"/>
- </imageobject>
- </mediaobject>
- </figure>
+
<itemizedlist>
<listitem>
<para>Click on the <emphasis>
Modified: trunk/struts/docs/struts_tools_tutorial/en/modules/struts_validation.xml
===================================================================
--- trunk/struts/docs/struts_tools_tutorial/en/modules/struts_validation.xml 2009-05-27 15:43:26 UTC (rev 15563)
+++ trunk/struts/docs/struts_tools_tutorial/en/modules/struts_validation.xml 2009-05-27 15:44:49 UTC (rev 15564)
@@ -116,16 +116,11 @@
<itemizedlist>
<listitem><para>Select<emphasis><property> File > Save </property></emphasis>from the menu bar</para></listitem>
<listitem><para>Start JBoss Application Server by clicking on its icon (a right-pointing arrow) in the toolbar</para></listitem>
-<listitem><para>Click the Run icon or right click your project folder and select <emphasis><property>Run As > Run on Server</property></emphasis></para></listitem>
+ <listitem><para>Click the Run icon(<inlinemediaobject> <imageobject>
+ <imagedata fileref="images/struts_validation/struts_validation_1.png"/>
+ </imageobject></inlinemediaobject>) or right click your project folder and select <emphasis><property>Run As > Run on Server</property></emphasis></para></listitem>
</itemizedlist>
-<figure>
- <title>Run Icon</title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/struts_validation/struts_validation_1.png"/>
- </imageobject>
-</mediaobject>
-</figure>
+
<itemizedlist><listitem><para>In the browser window, click on the "Say Hello!" button without having entered any name in the form</para></listitem></itemizedlist>
<para>A JavaScript error message should be displayed in an alert box.</para>
</section>
15 years, 7 months
JBoss Tools SVN: r15563 - trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2009-05-27 11:43:26 -0400 (Wed, 27 May 2009)
New Revision: 15563
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageProcessor.java
Log:
JBIDE-2808: Improve/refactor org.jboss.tools.common.kb plugin.
getProposals() method is fixed: Wrong indexing in adding proposals
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageProcessor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageProcessor.java 2009-05-27 15:18:22 UTC (rev 15562)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageProcessor.java 2009-05-27 15:43:26 UTC (rev 15563)
@@ -45,7 +45,7 @@
for (int i = 0; libs != null && i < libs.length; i++) {
TextProposal[] libProposals = libs[i].getProposals(query, context);
for (int j = 0; libProposals != null && j < libProposals.length; j++) {
- proposals.add(libProposals[i]);
+ proposals.add(libProposals[j]);
}
}
if(query.getType() == KbQuery.Type.ATTRIBUTE_VALUE || query.getType() == KbQuery.Type.TEXT) {
15 years, 7 months
JBoss Tools SVN: r15562 - trunk/jmx/releng.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2009-05-27 11:18:22 -0400 (Wed, 27 May 2009)
New Revision: 15562
Modified:
trunk/jmx/releng/testing.properties
Log:
comment out core test due to failure
Modified: trunk/jmx/releng/testing.properties
===================================================================
--- trunk/jmx/releng/testing.properties 2009-05-27 15:01:16 UTC (rev 15561)
+++ trunk/jmx/releng/testing.properties 2009-05-27 15:18:22 UTC (rev 15562)
@@ -2,10 +2,10 @@
#csv list of test plugins to run
testPluginsToRun=\
-org.jboss.tools.jmx.core.test,\
org.jboss.tools.jmx.ui.test
+#org.jboss.tools.jmx.core.test
# define which suite to run within each test plugin; or, include a test.xml script in
# the test plugin to deviate from default one-suite-per-plugin operation
-org.jboss.tools.jmx.core.test.suite=org.jboss.tools.jmx.core.JMXCoreAllTests
-org.jboss.tools.jmx.ui.test.suite=org.jboss.tools.jmx.ui.JMXUIAllTests
\ No newline at end of file
+org.jboss.tools.jmx.ui.test.suite=org.jboss.tools.jmx.ui.JMXUIAllTests
+#org.jboss.tools.jmx.core.test.suite=org.jboss.tools.jmx.core.JMXCoreAllTests
15 years, 7 months
JBoss Tools SVN: r15561 - trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2009-05-27 11:01:16 -0400 (Wed, 27 May 2009)
New Revision: 15561
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/JavaCompletionProcessor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4384 - enhance "Hibernate Criteria Editor" context assist, when there is no project associated with a console configuration
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/JavaCompletionProcessor.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/JavaCompletionProcessor.java 2009-05-27 14:29:59 UTC (rev 15560)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/JavaCompletionProcessor.java 2009-05-27 15:01:16 UTC (rev 15561)
@@ -92,26 +92,27 @@
return new ICompletionProposal[0];
}
String prefix = HibernateConsoleMessages.JavaCompletionProcessor_session_session; // has to do this because of https://bugs.eclipse.org/bugs/show_bug.cgi?id=141518
-
- try {
- IJavaProject javaProject = ProjectUtils.findJavaProject( editor.getConsoleConfiguration() );
+
+ IJavaCompletionProposal[] results = new IJavaCompletionProposal[0];
+ IJavaProject[] projects = ProjectUtils.findJavaProjects(editor.getConsoleConfiguration());
+ for (int i = 0; i < projects.length && results.length <= 0; i++) {
+ IJavaProject javaProject = projects[i];
collector = new CompletionProposalCollector( javaProject );
collector.acceptContext( new CompletionContext() );
-
- editor.codeComplete( prefix, collector, position, javaProject );
+ try {
+ editor.codeComplete( prefix, collector, position, javaProject );
+ }
+ catch (JavaModelException x) {
+ Shell shell = viewer.getTextWidget().getShell();
+ ErrorDialog
+ .openError(
+ shell,
+ HibernateConsoleMessages.JavaCompletionProcessor_error, HibernateConsoleMessages.JavaCompletionProcessor_error_while_performing_code_completion, x.getStatus() );
+ HibernateConsolePlugin.getDefault().log( x );
+ }
+ results = collector.getJavaCompletionProposals();
}
- catch (JavaModelException x) {
- Shell shell = viewer.getTextWidget().getShell();
- ErrorDialog
- .openError(
- shell,
- HibernateConsoleMessages.JavaCompletionProcessor_error, HibernateConsoleMessages.JavaCompletionProcessor_error_while_performing_code_completion, x.getStatus() );
- HibernateConsolePlugin.getDefault().log( x );
- }
-
- IJavaCompletionProposal[] results = collector
- .getJavaCompletionProposals();
-
+
Arrays.sort( results, comparator );
CompletionHelper.transpose( null, -prefix.length(), results );
return results;
15 years, 7 months
JBoss Tools SVN: r15560 - in trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context: java and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2009-05-27 10:29:59 -0400 (Wed, 27 May 2009)
New Revision: 15560
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernatePersistenceUnit.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/Messages.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/Messages.properties
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaEntity.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaIdMapping.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/JavaGenericGeneratorImpl.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-3507
Check @GenericGenerator strategy.
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernatePersistenceUnit.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernatePersistenceUnit.java 2009-05-27 13:57:48 UTC (rev 15559)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernatePersistenceUnit.java 2009-05-27 14:29:59 UTC (rev 15560)
@@ -92,9 +92,9 @@
*/
static public class LocalMessage extends Message {
- public LocalMessage(String name, int highSeverity, String notAFile,
+ public LocalMessage(String name, int severity, String message,
String[] strings, IResource resource) {
- super(name, highSeverity, notAFile, strings, resource);
+ super(name, severity, message, strings, resource);
}
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/Messages.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/Messages.java 2009-05-27 13:57:48 UTC (rev 15559)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/Messages.java 2009-05-27 14:29:59 UTC (rev 15560)
@@ -19,5 +19,9 @@
String NOT_A_FILE = "NOT_A_FILE"; //$NON-NLS-1$
String CONFIG_FILE_NOT_FOUND = "CONFIG_FILE_NOT_FOUND"; //$NON-NLS-1$
+
+ String STRATEGY_CLASS_NOT_FOUND = "STRATEGY_CLASS_NOT_FOUND"; //$NON-NLS-1$
+
+ String STRATEGY_CANT_BE_EMPTY = "STRATEGY_CANT_BE_EMPTY"; //$NON-NLS-1$
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/Messages.properties
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/Messages.properties 2009-05-27 13:57:48 UTC (rev 15559)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/Messages.properties 2009-05-27 14:29:59 UTC (rev 15560)
@@ -1,2 +1,4 @@
NOT_A_FILE= Resource \"{0}\" is not a file.
-CONFIG_FILE_NOT_FOUND = Configuration file named \"{0}\" could not be found.
\ No newline at end of file
+CONFIG_FILE_NOT_FOUND = Configuration file named \"{0}\" could not be found.
+STRATEGY_CLASS_NOT_FOUND = Strategy class \"{0}\" could not be found.
+STRATEGY_CANT_BE_EMPTY = Strategy could not be empty.
\ No newline at end of file
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaEntity.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaEntity.java 2009-05-27 13:57:48 UTC (rev 15559)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaEntity.java 2009-05-27 14:29:59 UTC (rev 15560)
@@ -12,6 +12,7 @@
import java.util.ArrayList;
import java.util.Iterator;
+import java.util.List;
import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.core.context.java.JavaGenerator;
@@ -20,6 +21,8 @@
import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
import org.eclipse.jpt.utility.Filter;
import org.eclipse.jpt.utility.internal.iterators.CompositeIterator;
+import org.eclipse.wst.validation.internal.provisional.core.IMessage;
+import org.eclipse.wst.validation.internal.provisional.core.IReporter;
import org.jboss.tools.hibernate.jpt.core.internal.HibernateJpaFactory;
import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
@@ -126,7 +129,22 @@
}
}
+ /* (non-Javadoc)
+ * @see org.eclipse.jpt.core.internal.context.java.AbstractJavaEntity#validate(java.util.List, org.eclipse.wst.validation.internal.provisional.core.IReporter, org.eclipse.jdt.core.dom.CompilationUnit)
+ */
@Override
+ public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
+ super.validate(messages, reporter, astRoot);
+ validateGenericGenerator(messages, reporter, astRoot);
+ }
+
+ protected void validateGenericGenerator(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
+ if (genericGenerator != null){
+ genericGenerator.validate(messages, reporter, astRoot);
+ }
+ }
+
+ @Override
public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter,
CompilationUnit astRoot) {
Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaIdMapping.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaIdMapping.java 2009-05-27 13:57:48 UTC (rev 15559)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaIdMapping.java 2009-05-27 14:29:59 UTC (rev 15560)
@@ -11,14 +11,19 @@
package org.jboss.tools.hibernate.jpt.core.internal.context.java;
import java.util.Iterator;
+import java.util.List;
+import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.core.context.java.JavaGenerator;
import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
import org.eclipse.jpt.core.internal.context.java.GenericJavaIdMapping;
import org.eclipse.jpt.utility.internal.iterators.CompositeIterator;
import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
import org.eclipse.jpt.utility.internal.iterators.SingleElementIterator;
+import org.eclipse.wst.validation.internal.provisional.core.IMessage;
+import org.eclipse.wst.validation.internal.provisional.core.IReporter;
import org.jboss.tools.hibernate.jpt.core.internal.HibernateJpaFactory;
+import org.logicalcobwebs.cglib.reflect.FastClass.Generator;
/**
* @author Dmitry Geraskov
@@ -123,5 +128,20 @@
}
}
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jpt.core.internal.context.java.GenericJavaIdMapping#validate(java.util.List, org.eclipse.wst.validation.internal.provisional.core.IReporter, org.eclipse.jdt.core.dom.CompilationUnit)
+ */
+ @Override
+ public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
+ super.validate(messages, reporter, astRoot);
+ validateGenericGenerator(messages, reporter, astRoot);
+ }
+
+ protected void validateGenericGenerator(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
+ if (genericGenerator != null){
+ genericGenerator.validate(messages, reporter, astRoot);
+ }
+ }
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/JavaGenericGeneratorImpl.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/JavaGenericGeneratorImpl.java 2009-05-27 13:57:48 UTC (rev 15559)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/JavaGenericGeneratorImpl.java 2009-05-27 14:29:59 UTC (rev 15560)
@@ -10,23 +10,61 @@
******************************************************************************/
package org.jboss.tools.hibernate.jpt.core.internal.context.java;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.core.context.Generator;
import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
import org.eclipse.jpt.core.internal.context.java.AbstractJavaGenerator;
import org.eclipse.jpt.core.resource.java.GeneratorAnnotation;
import org.eclipse.jpt.core.utility.TextRange;
+import org.eclipse.wst.validation.internal.provisional.core.IMessage;
+import org.eclipse.wst.validation.internal.provisional.core.IReporter;
+import org.hibernate.id.Assigned;
+import org.hibernate.id.ForeignGenerator;
+import org.hibernate.id.GUIDGenerator;
+import org.hibernate.id.IdentityGenerator;
+import org.hibernate.id.IncrementGenerator;
+import org.hibernate.id.SelectGenerator;
+import org.hibernate.id.SequenceGenerator;
+import org.hibernate.id.SequenceHiLoGenerator;
+import org.hibernate.id.SequenceIdentityGenerator;
+import org.hibernate.id.TableHiLoGenerator;
+import org.hibernate.id.UUIDHexGenerator;
+import org.jboss.tools.hibernate.jpt.core.internal.context.Messages;
+import org.jboss.tools.hibernate.jpt.core.internal.context.HibernatePersistenceUnit.LocalMessage;
/**
* @author Dmitry Geraskov
*
*/
public class JavaGenericGeneratorImpl extends AbstractJavaGenerator
- implements JavaGenericGenerator {
+ implements JavaGenericGenerator, Messages {
private String strategy;
protected GeneratorAnnotation generatorResource;
+
+ private static List<String> generatorClasses = new ArrayList<String>();
+
+ //see org.hibernate.id.IdentifierGeneratorFactory.GENERATORS
+ static{
+ generatorClasses.add( "uuid");
+ generatorClasses.add( "hilo");
+ generatorClasses.add( "assigned");
+ generatorClasses.add( "identity");
+ generatorClasses.add( "select");
+ generatorClasses.add( "sequence");
+ generatorClasses.add( "seqhilo");
+ generatorClasses.add( "increment");
+ generatorClasses.add( "foreign");
+ generatorClasses.add( "guid");
+ generatorClasses.add( "uuid.hex");
+ generatorClasses.add( "sequence-identity");
+ }
/**
* @param parent
@@ -117,5 +155,48 @@
protected String getSchema() {
return null;
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jpt.core.internal.context.java.AbstractJavaJpaContextNode#validate(java.util.List, org.eclipse.wst.validation.internal.provisional.core.IReporter, org.eclipse.jdt.core.dom.CompilationUnit)
+ */
+ @Override
+ public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
+ super.validate(messages, reporter, astRoot);
+ validateStrategy(messages, reporter, astRoot);
+ }
+
+ protected void validateStrategy(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot){
+ if (strategy != null){
+ if (strategy.trim().length() == 0){
+ IMessage message = new LocalMessage(Messages.class.getName(), IMessage.HIGH_SEVERITY,
+ STRATEGY_CANT_BE_EMPTY, new String[]{}, getResource());
+ if (getValidationTextRange(astRoot) != null){
+ message.setLineNo(getValidationTextRange(astRoot).getLineNumber());
+ }
+ messages.add(message);
+ } else if (!generatorClasses.contains(strategy)){
+ IType lwType = null;
+ try {
+ lwType = getJpaProject().getJavaProject().findType(strategy);
+ if (lwType == null && strategy.indexOf('.') < 0
+ && astRoot.getPackage() != null){
+ String pack = astRoot.getPackage().getName().getFullyQualifiedName();
+ if (pack != null && pack.length() > 0)
+ lwType = getJpaProject().getJavaProject().findType(pack+'.'+strategy);
+ }
+ } catch (JavaModelException e) {
+ // just ignore it!
+ }
+ if (lwType == null){
+ IMessage message = new LocalMessage(Messages.class.getName(), IMessage.HIGH_SEVERITY,
+ STRATEGY_CLASS_NOT_FOUND, new String[]{strategy}, getResource());
+ if (getValidationTextRange(astRoot) != null){
+ message.setLineNo(getValidationTextRange(astRoot).getLineNumber());
+ }
+ messages.add(message);
+ }
+ }
+ }
+ }
}
15 years, 7 months
JBoss Tools SVN: r15559 - trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2009-05-27 09:57:48 -0400 (Wed, 27 May 2009)
New Revision: 15559
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/FaceletPageContectAssistProcessor.java
Log:
JBIDE-2808: Improve/refactor org.jboss.tools.common.kb plugin.
NameSpaces calculation is corrected for xmlns-attributes
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/FaceletPageContectAssistProcessor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/FaceletPageContectAssistProcessor.java 2009-05-27 13:55:17 UTC (rev 15558)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/FaceletPageContectAssistProcessor.java 2009-05-27 13:57:48 UTC (rev 15559)
@@ -17,6 +17,7 @@
import org.eclipse.wst.sse.core.StructuredModelManager;
import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
import org.jboss.tools.jst.web.kb.IFaceletPageContext;
@@ -100,18 +101,24 @@
final String uri = a.getValue();
if (prefix != null && prefix.trim().length() > 0 &&
uri != null && uri.trim().length() > 0) {
+
+ int start = ((IndexedRegion)n).getStartOffset();
+ int length = ((IndexedRegion)n).getLength();
+
+ IDOMElement domElement = (n instanceof IDOMElement ? (IDOMElement)n : null);
+ if (domElement != null) {
+ start = domElement.getStartOffset();
+ length = (domElement.hasEndTag() ?
+ domElement.getEndStructuredDocumentRegion().getEnd() :
+ domElement.getLength());
- // TODO: Check the IRegion instance creation
- IRegion region = new Region(
- ((IndexedRegion)n).getStartOffset(),
- ((IndexedRegion)n).getLength());
-
+ }
+
+ Region region = new Region(start, length);
INameSpace nameSpace = new INameSpace(){
-
public String getURI() {
return uri.trim();
}
-
public String getPrefix() {
return prefix.trim();
}
15 years, 7 months