}
public void showOrganizer(final XScriptContext ctxt)
{
try {
XBrowseNode root = getRootNode(ctxt);
final XScriptProvider msp =
(XScriptProvider)UnoRuntime.queryInterface(
XScriptProvider.class, root);
final JFrame client = new JFrame("Script");
selectorPanel = new ScriptSelectorPanel(root);
final JButton runButton, closeButton, createButton,
editButton, deleteButton;
runButton = new JButton("Run");
runButton.setEnabled(false);
closeButton = new JButton("Close");
editButton = new JButton("Edit");
editButton.setEnabled(false);
JPanel northButtons =
new JPanel(new GridLayout(2, 1, MED_GAP, MED_GAP));
northButtons.add(runButton);
northButtons.add(closeButton);
createButton = new JButton("Create");
createButton.setEnabled(false);
deleteButton = new JButton("Delete");
deleteButton.setEnabled(false);
JPanel southButtons =
new JPanel(new GridLayout(3, 1, MED_GAP, MED_GAP));
southButtons.add(editButton);
southButtons.add(createButton);
southButtons.add(deleteButton);
selectorPanel.tree.addTreeSelectionListener(
new TreeSelectionListener() {
public void valueChanged(TreeSelectionEvent e) {
XBrowseNode xbn = selectorPanel.getSelection();
XPropertySet props = (XPropertySet)
UnoRuntime.queryInterface(XPropertySet.class, xbn);
checkEnabled(props, "Creatable", createButton);
checkEnabled(props, "Deletable", deleteButton);
checkEnabled(props, "Editable", editButton);
if (xbn != null &&
xbn.getType() == BrowseNodeTypes.SCRIPT)
{
runButton.setEnabled(true);
}
else
{