JBuilder Open Tool Question...
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   dog_lin
Posted On:   Wednesday, January 26, 2005 07:05 AM

Hi: I am building an open tool plug in, so when the user right click on the "JPX" file on the project pane, it would unlock all the XML files and Manifest files in the project directory automatically... Here is a portion of my code... public static void initOpenTool(byte major, byte minor) { UnlockMenu menu = new UnlockMenu(); // Register the global class as the provider ProjectView.registerContextActionProvider(menu); } public static final Action UNLOCK_FILE = new BrowserAction("Unlock Files") { public void actionPerformed(Browser browser) { // Get the node currently selected in the Project View    More>>

Hi:
I am building an open tool plug in, so when the user right click on the "JPX" file on the project pane, it would unlock all the XML files and Manifest files in the project directory automatically...
Here is a portion of my code...




			

public static void initOpenTool(byte major, byte minor) {
UnlockMenu menu = new UnlockMenu();



// Register the global class as the provider
ProjectView.registerContextActionProvider(menu);
}


public static final Action UNLOCK_FILE = new BrowserAction("Unlock Files") {
public void actionPerformed(Browser browser) {
// Get the node currently selected in the Project View
Node node = browser.getProjectView().getSelectedNode();

// if the node is a JBProject node, then we would like to peform the unlock function.
if (node instanceof TextFileNode &&
((TextFileNode) node).getUrl().getFileObject().getAbsolutePath().endsWith("jpx")) {
Unlocker.unLock( (TextFileNode) node);
node.check();

}
}

public int getPriority() {
return 4;
}

};



My Question is, is the JPX file a type of TextFileNode as well? I think it is, so , to play it safe, I also check the the absolute path to make sure it ends with "jpx", but i didn't seem to add the "unlock project files" to the menu..when I right click...

Anybody care to let me know what is wrong? many thanks...    <<Less

Re: JBuilder Open Tool Question...

Posted By:   Anonymous  
Posted On:   Wednesday, February 23, 2005 11:31 AM

JPX file is instance of JBProject.
JBProject -> Project -> RootNode -> UrlNode -> Node
There no TextFileNode among JBProject's ancestors
About | Sitemap | Contact