<!ATTLIST extension
point CDATA #REQUIRED
id CDATA #IMPLIED
name CDATA #IMPLIED
><!ELEMENT query EMPTY>
<!ATTLIST query
impl CDATA #REQUIRED
>Following is an example of a query declaration:
<extension point="org.eclipse.mat.report.query"> <query impl="org.eclipse.mat.demo.DemoQuery"/> </extension>
This is the Java code.
@CommandName("DemoQuery")
public class org.eclipse.mat.demo.DemoQuery implements IQuery
{
@Argument
public ISnapshot snapshot;
@Argument
public boolean myflag;
public IResult execute(IProgressListener listener) throws Exception
{
...
}
}
This is the translatable text in annotations.properties
in the same package.
DemoQuery.name = Demonstration Query
DemoQuery.help = A sample query.
DemoQuery.myflag.help = A boolean flag to control the query.
@Argument
annotation so they can be filled in by the query wizard. Argument types include
@Argument(advice = Advice.HEAP_OBJECT)
@Argument(advice = Advice.HEAP_OBJECT)
Copyright (c) 2008, 2010 SAP AG and IBM Corporation.
All rights reserved. This program and the accompanying materials are made
available under the terms of the Eclipse Public License 2.0 which
accompanies this distribution, and is available at
https://www.eclipse.org/legal/epl-2.0/