Quantcast
Channel: PTC Community : All Content - Windchill
Viewing all articles
Browse latest Browse all 6049

How can I dynamically control display of menu items in Windchill?

$
0
0

Hello,

 

I am developing a custom application for Windchill 10.

My code is started by clicking a custom menu item that is defined using the custom-actions.xml file.

The menu item belongs to the context menu for objects of type EPMDocument.

 

Now, I need to show this menu item only for assemblies (docType = CADASSEMBLY), but not for

other types of EPM documents (i. e. drawings, CAD parts, etc.).

 

I found out that it was possible to define an "includeFilter" (a special Java class) that can be used

to dynamically show or hide a menu item.

 

My testing filter class looks as follows:

import com.ptc.cat.ui.client.action.ActionFilter;

 

public class MyActionFilter implements ActionFilter {

 

     @Override

    public boolean test(List<StructureModel> structureModels, View view) {

        // Decide whether the menu item shall be displayed and return true or false.

        return false;

    }

}

The filter must be registered as a Windchill service, so that it can be called.

My problem is, that I do not know how to register it. My filter never gets called.

 

Has anyone got any experience in this area?

 

Thanks in advance

 

mp.


Viewing all articles
Browse latest Browse all 6049

Trending Articles