Author: scabanovich
Date: 2009-10-01 10:57:01 -0400 (Thu, 01 Oct 2009)
New Revision: 17843
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/schema/propertiesFileContentAssist.exsd
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter/PropertiesContentAssistProvider.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter/PropertiesContentProposalProvider.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4916
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/schema/propertiesFileContentAssist.exsd
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/schema/propertiesFileContentAssist.exsd 2009-10-01
14:54:06 UTC (rev 17842)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/schema/propertiesFileContentAssist.exsd 2009-10-01
14:57:01 UTC (rev 17843)
@@ -59,6 +59,16 @@
</appInfo>
</annotation>
</attribute>
+ <attribute name="attributeProcessor" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java"/>
+ </appInfo>
+ </annotation>
+ </attribute>
<attribute name="fileName" type="string">
<annotation>
<documentation>
@@ -66,14 +76,11 @@
</documentation>
</annotation>
</attribute>
- <attribute name="attributeProcessor" type="string">
+ <attribute name="entity" type="string">
<annotation>
<documentation>
</documentation>
- <appInfo>
- <meta.attribute kind="java"/>
- </appInfo>
</annotation>
</attribute>
</complexType>
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter/PropertiesContentAssistProvider.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter/PropertiesContentAssistProvider.java 2009-10-01
14:54:06 UTC (rev 17842)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter/PropertiesContentAssistProvider.java 2009-10-01
14:57:01 UTC (rev 17843)
@@ -23,7 +23,6 @@
import org.jboss.tools.common.model.filesystems.impl.FileAnyImpl;
import org.jboss.tools.common.model.ui.ModelUIPlugin;
import org.jboss.tools.common.model.ui.attribute.IAttributeContentProposalProvider;
-import
org.jboss.tools.common.model.ui.texteditors.propertyeditor.AbstractPropertiesContentAssistProcessor;
public class PropertiesContentAssistProvider implements
IAttributeContentProposalProvider {
@@ -32,12 +31,14 @@
XAttribute attribute;
String fileName = null;
+ String entity = null;
public PropertiesContentAssistProvider() {}
public boolean isRelevant(XModelObject object, XAttribute attribute) {
if(object == null || attribute == null) return false;
if("Property".equals(attribute.getModelEntity().getName())) return true;
+ if("HibConfig3Property".equals(attribute.getModelEntity().getName())) return
true;
return false;
}
@@ -45,6 +46,7 @@
this.object = object;
this.data = data;
this.attribute = attribute;
+ entity = attribute.getModelEntity().getName();
fileName = null;
XModelObject f = object;
@@ -56,7 +58,7 @@
public IContentProposalProvider getContentProposalProvider() {
if(fileName == null) return null;
- PropertiesContentProposalProvider provider = createProcessorByFileName(fileName);
+ PropertiesContentProposalProvider provider = createProcessorByFileName(fileName,
entity);
return provider;
}
@@ -74,7 +76,7 @@
static String EXTENSION_POINT =
"org.jboss.tools.common.model.ui.propertiesFileContentAssist";
- private PropertiesContentProposalProvider createProcessorByFileName(String fileName) {
+ private PropertiesContentProposalProvider createProcessorByFileName(String fileName,
String entity) {
IExtensionPoint point =
Platform.getExtensionRegistry().getExtensionPoint(EXTENSION_POINT);
if(point == null) return null;
IConfigurationElement[] cs = point.getConfigurationElements();
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter/PropertiesContentProposalProvider.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter/PropertiesContentProposalProvider.java 2009-10-01
14:54:06 UTC (rev 17842)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter/PropertiesContentProposalProvider.java 2009-10-01
14:57:01 UTC (rev 17843)
@@ -10,7 +10,6 @@
******************************************************************************/
package org.jboss.tools.common.model.ui.attribute.adapter;
-import org.eclipse.jface.fieldassist.IContentProposal;
import org.eclipse.jface.fieldassist.IContentProposalProvider;
import org.jboss.tools.common.meta.XAttribute;
import org.jboss.tools.common.meta.action.XEntityData;
@@ -21,15 +20,11 @@
* @author Viacheslav Kabanovich
*
*/
-public class PropertiesContentProposalProvider implements IContentProposalProvider {
+public abstract class PropertiesContentProposalProvider implements
IContentProposalProvider {
protected XModelObject object;
protected XEntityData data;
protected XAttribute attribute;
public PropertiesContentProposalProvider() {}
- public IContentProposal[] getProposals(String contents, int position) {
- return null;
- }
-
}