|
org.netbeans.modules.projectapi/1 1.36.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ProjectIconAnnotator
Permits third parties to alter a project's icon. You can use it for example to add a badge to the project's icon. Implementations should be registered in global lookup. Example:
@ServiceProvider(service=ProjectIconAnnotator.class)
public class SampleProjectIconAnnotator implements ProjectIconAnnotator {
private final ChangeSupport pcs = new ChangeSupport(this);
private boolean enabled;
public @Override Image annotateIcon(Project p, Image orig, boolean openedNode) {
return enabled ?
ImageUtilities.mergeImages(ImageUtilities.addToolTipToImage(orig, "Annotated!"),
ImageUtilities.loadImage(".../badge.png"), 16, 0) :
original;
}
public @Override void addChangeListener(ChangeListener listener) {
pcs.addChangeListener(listener);
}
public @Override void removeChangeListener(ChangeListener listener) {
pcs.removeChangeListener(listener);
}
void setEnabled(boolean enabled) {
this.enabled = enabled;
pcs.fireChange();
}
}
ProjectInformation.getIcon(),
LogicalViewProvider.createLogicalView| Method Summary | |
|---|---|
void |
addChangeListener(ChangeListener listener)
Adds a listener to changes in badging. |
Image |
annotateIcon(Project p,
Image original,
boolean openedNode)
Makes any changes to a project's icon. |
void |
removeChangeListener(ChangeListener listener)
Removes a listener to changes in badging. |
| Method Detail |
|---|
Image annotateIcon(Project p,
Image original,
boolean openedNode)
original if you do not intend to change the original icon at this time.
p - project whose icon is to be annotatedoriginal - the original icon (might have been processed by an earlier annotator)openedNode - true for an expanded node; false for a collapsed node or icon used in another way
void addChangeListener(ChangeListener listener)
listener - a listener to addvoid removeChangeListener(ChangeListener listener)
listener - a listener to remove
|
org.netbeans.modules.projectapi/1 1.36.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||