Skip to main content



      Home
Home » Archived » Visual Editor (VE) » Why am not able to see my customlayout in the properties list???
Why am not able to see my customlayout in the properties list??? [message #115334] Mon, 16 January 2006 08:01 Go to next message
Eclipse UserFriend
Originally posted by: dancersstar.hotmail.com

Hi,
I am trying to add my custom layout in eclipse using VE but I am not able
to see my Custom Manager in the layout properties list.

The structure of the project is:
package: com.layout contains the following code
1) CustomLayout.java
2) CustomLayoutBeanInfo.java

package: com.layout.helper contains the following code
1) CustomLayoutEditPolicy.java
2) CustomLayoutPolicyFactory.java

Folder: overrides.com.layout
1) LayoutManager.override
2) CustomLayout.override

Is it necessary to write the PolicyFactory class and EditPolicy class to
view the CustomLayout manager class in the properties list???

Code is as follows:

LayoutManager.override
-----------------------
<?xml version="1.0" encoding="UTF-8"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xmlns:org.eclipse.ve.internal.jcm="http:///org/eclipse/ve/internal/jcm.ecore"

xmlns:org.eclipse.ve.internal.cde.decorators="http:///org/eclipse/ve/internal/cde/decorators.ecore"
xmlns:org.eclipse.jem.java="java.xmi"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
xmlns:event="event.xmi">
<event:Add featureName="eAnnotations">
<addedEObjects xsi:type="ecore:EAnnotation"
source="org.eclipse.ve.LayoutInfo">
<details
key="com.layout.CustomLayout"
value="com.layout.CustomLayout"/>
<details
key="org.eclipse.ve.internal.jfc.core.layoutManagerDisplayName "
value="CustomLayout"/>
</addedEObjects>

</event:Add>
</xmi:XMI>

----------

CustomLayout.override
<?xml version="1.0" encoding="UTF-8"?>
<event:AddMany xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xmlns:org.eclipse.ve.internal.jcm="http:///org/eclipse/ve/internal/jcm.ecore"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"

xmlns:codeGenHelpers=" platform:/plugin/org.eclipse.ve.java.core/overrides/codegenH elpers.ecore "
xmlns:event="event.xmi"
featureName="eAnnotations">
<addedEObjects xsi:type="org.eclipse.ve.internal.jcm:BeanDecorator">
<keyedValues xsi:type="ecore:EStringToStringMapEntry"
key=" org.eclipse.ve.internal.jfc.core.layoutpolicyfactoryclassnam ekey "

value=" com.layout.helper/com.layout.helper.CustomLayoutPolicyFactor y "/>
</addedEObjects>
<addedEObjects xsi:type="codeGenHelpers:CodeGenHelperClass"
source="codegen.CodeGenHelperClass"
modelled="true"/>
</event:AddMany>
-----------------------------------
CustomLayoutEditPolicy.java
public class CustomLayoutEditPolicy extends FlowLayoutEditPolicy
implements IActionFilter
{

public final static String LAYOUT_ID = "com.layout.CustomLayout";
//$NON-NLS-1$

public CustomLayoutEditPolicy(VisualContainerPolicy containerPolicy) {
super(containerPolicy);
}

public void activate() {
super.activate();
CustomizeLayoutWindowAction.addLayoutCustomizationPage(getHo st().getViewer(),
GridLayoutLayoutPage.class);
}
/* (non-Javadoc)
* @see org.eclipse.ui.IActionFilter#testAttribute(java.lang.Object,
java.lang.String, java.lang.String)
*/
public boolean testAttribute(Object target, String name, String value) {

/*if (name.startsWith(CustomizeLayoutPage.LAYOUT_POLICY_KEY) &&
value.equals(LAYOUT_ID))
return true;
*/
return true;
}

}

-----------------------
CustomLayoutPolicyFactory.java
public class CustomLayoutPolicyFactory
{
public CustomLayoutPolicyFactory() {
super();
}

public EditPolicy getLayoutEditPolicy(VisualContainerPolicy
containerPolicy) {
return new CustomLayoutEditPolicy(containerPolicy);
}

public ILayoutPolicyHelper getLayoutPolicyHelper(VisualContainerPolicy
ep) {
return new FlowLayoutPolicyHelper(ep);
}
public ILayoutSwitcher getLayoutSwitcher(VisualContainerPolicy cp) {
return null;
}

public IPropertyDescriptor
getConstraintPropertyDescriptor(EStructuralFeature sfConstraint) {
return null; // No constraint, so no property descriptor.
}

public IJavaInstance getLayoutManagerInstance(IJavaObjectInstance
container, JavaHelpers javaClass, ResourceSet rset)
{
return BeanUtilities.createJavaObject(javaClass, rset, (String)null);
}

public JavaClass getConstraintClass(ResourceSet rSet) {
return null;
}
}


Thanks
Re: Why am not able to see my customlayout in the properties list??? [message #115361 is a reply to message #115334] Mon, 16 January 2006 09:28 Go to previous messageGo to next message
Eclipse UserFriend
Sahil,

Have you cleared out the cached bean info for your project by going to
Project->Clean->Clean All? You'll need to do this every time you make
changes to your override files.

- Jeff
Re: Why am not able to see my customlayout in the properties list??? [message #115398 is a reply to message #115361] Tue, 17 January 2006 00:08 Go to previous message
Eclipse UserFriend
Originally posted by: dancersstar.hotmail.com

Yes i did the cleaup also but still its not working

Thanks
Re: Why am not able to see my customlayout in the properties list??? [message #611788 is a reply to message #115334] Mon, 16 January 2006 09:28 Go to previous message
Eclipse UserFriend
Sahil,

Have you cleared out the cached bean info for your project by going to
Project->Clean->Clean All? You'll need to do this every time you make
changes to your override files.

- Jeff
Re: Why am not able to see my customlayout in the properties list??? [message #611791 is a reply to message #115361] Tue, 17 January 2006 00:08 Go to previous message
Eclipse UserFriend
Originally posted by: dancersstar.hotmail.com

Yes i did the cleaup also but still its not working

Thanks
Previous Topic:How begins
Next Topic:properties that are not defined in BeanInfo
Goto Forum:
  


Current Time: Fri Jun 06 19:29:16 EDT 2025

Powered by FUDForum. Page generated in 0.02524 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top