You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by ar...@apache.org on 2012/01/27 02:29:58 UTC
svn commit: r1236486 [18/43] - in
/incubator/ooo/devtools/netbeansintegration: ./ build/
build/public-package-jars/ javahelp/ javahelp/org/ javahelp/org/openoffice/
javahelp/org/openoffice/extensions/
javahelp/org/openoffice/extensions/docs/ javahelp/o...
Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/addon/AddOnPanelVisual1Project.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/addon/AddOnPanelVisual1Project.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/addon/AddOnPanelVisual1Project.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/addon/AddOnPanelVisual1Project.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,512 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: AddOnPanelVisual1Project.java,v $
+ *
+ * $Revision: 1.13 $
+ *
+ * last change: $Author: sg $ $Date: 2009/10/22 08:00:38 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+package org.openoffice.extensions.projecttemplates.addon;
+
+import java.io.File;
+import java.io.FilenameFilter;
+import java.io.IOException;
+import javax.swing.JFileChooser;
+import javax.swing.JPanel;
+import javax.swing.event.DocumentEvent;
+import javax.swing.event.DocumentListener;
+import javax.swing.filechooser.FileSystemView;
+import javax.swing.text.Document;
+import org.netbeans.spi.project.ui.support.ProjectChooser;
+import org.openide.WizardDescriptor;
+import org.openide.WizardValidationException;
+import org.openide.filesystems.FileUtil;
+import org.openide.util.NbBundle;
+import org.openoffice.extensions.config.ConfigurationSettings;
+
+public class AddOnPanelVisual1Project extends JPanel implements DocumentListener {
+
+ public static final String PROP_PROJECT_NAME = "AddOn"; // NOI18N
+
+ private AddOnWizardPanel1Project panel;
+ private boolean addonNameModified = false;
+
+ private String[] generatedFiles = new String[]{ "",
+ "src/uno-extension-manifest.xml\n",
+ "registry/data/org/openoffice/Office/ProtocolHandler.xcu\n",
+ "registry/data/org/openoffice/Office/Addons.xcu\n" }; // NOI18N
+
+ /** Creates new form PanelProjectLocationVisual */
+ public AddOnPanelVisual1Project(AddOnWizardPanel1Project panel) {
+ initComponents();
+ this.panel = panel;
+ // Register listener on the textFields to make the automatic updates
+ projectNameTextField.getDocument().addDocumentListener(this);
+ projectLocationTextField.getDocument().addDocumentListener(this);
+ addonNameTextField.getDocument().addDocumentListener(this);
+ }
+
+
+ public String getProjectName() {
+ return this.projectNameTextField.getText();
+ }
+
+ /** This method is called from within the constructor to
+ * initialize the form.
+ * WARNING: Do NOT modify this code. The content of this method is
+ * always regenerated by the Form Editor.
+ */
+ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ projectNameLabel = new javax.swing.JLabel();
+ projectNameTextField = new javax.swing.JTextField();
+ projectLocationLabel = new javax.swing.JLabel();
+ projectLocationTextField = new javax.swing.JTextField();
+ browseButton = new javax.swing.JButton();
+ createdFolderLabel = new javax.swing.JLabel();
+ createdFolderTextField = new javax.swing.JTextField();
+ classNameLabel = new javax.swing.JLabel();
+ packageNameLabel = new javax.swing.JLabel();
+ addonNameTextField = new javax.swing.JTextField();
+ packageNameTextField = new javax.swing.JTextField();
+ jLabel3 = new javax.swing.JLabel();
+ jScrollPane1 = new javax.swing.JScrollPane();
+ createdFilesTextPane = new javax.swing.JTextPane();
+ createMenuCheckBox = new javax.swing.JCheckBox();
+ createToolbarCheckBox = new javax.swing.JCheckBox();
+
+ projectNameLabel.setLabelFor(projectNameTextField);
+ org.openide.awt.Mnemonics.setLocalizedText(projectNameLabel, NbBundle.getMessage(AddOnPanelVisual1Project.class, "LBL_ProjectName")); // NOI18N
+
+ projectNameTextField.setToolTipText(org.openide.util.NbBundle.getMessage(AddOnPanelVisual1Project.class, "TF_ProjectName_Tooltip")); // NOI18N
+
+ projectLocationLabel.setLabelFor(projectLocationTextField);
+ org.openide.awt.Mnemonics.setLocalizedText(projectLocationLabel, NbBundle.getMessage(AddOnPanelVisual1Project.class, "LBL_ProjectLoaction")); // NOI18N
+
+ projectLocationTextField.setToolTipText(org.openide.util.NbBundle.getMessage(AddOnPanelVisual1Project.class, "TF_ProjectLocation_Tooltip")); // NOI18N
+
+ org.openide.awt.Mnemonics.setLocalizedText(browseButton, NbBundle.getMessage(AddOnPanelVisual1Project.class, "LBL_Browse")); // NOI18N
+ browseButton.setToolTipText(org.openide.util.NbBundle.getMessage(AddOnPanelVisual1Project.class, "BUTTON_Browse_Tooltip")); // NOI18N
+ browseButton.setActionCommand("BROWSE");
+ browseButton.setName("browse"); // NOI18N
+ browseButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ browseButtonActionPerformed(evt);
+ }
+ });
+
+ createdFolderLabel.setLabelFor(createdFolderTextField);
+ org.openide.awt.Mnemonics.setLocalizedText(createdFolderLabel, NbBundle.getMessage(AddOnPanelVisual1Project.class, "LBL_ProjectFolder")); // NOI18N
+
+ createdFolderTextField.setEditable(false);
+ createdFolderTextField.setToolTipText(org.openide.util.NbBundle.getMessage(AddOnPanelVisual1Project.class, "TF_ProjectFolder_Tooltip")); // NOI18N
+
+ classNameLabel.setLabelFor(addonNameTextField);
+ org.openide.awt.Mnemonics.setLocalizedText(classNameLabel, NbBundle.getMessage(AddOnPanelVisual1Project.class, "LBL_MainClassName")); // NOI18N
+
+ packageNameLabel.setLabelFor(packageNameTextField);
+ org.openide.awt.Mnemonics.setLocalizedText(packageNameLabel, NbBundle.getMessage(AddOnPanelVisual1Project.class, "LBL_JavaPackage")); // NOI18N
+
+ addonNameTextField.setText("jTextField1");
+ addonNameTextField.setToolTipText(org.openide.util.NbBundle.getMessage(AddOnPanelVisual1Project.class, "TF_MainClassName_Tooltip")); // NOI18N
+
+ packageNameTextField.setText("jTextField2");
+ packageNameTextField.setToolTipText(org.openide.util.NbBundle.getMessage(AddOnPanelVisual1Project.class, "TF_PackageName_Tooltip")); // NOI18N
+
+ jLabel3.setLabelFor(createdFilesTextPane);
+ org.openide.awt.Mnemonics.setLocalizedText(jLabel3, NbBundle.getMessage(AddOnPanelVisual1Project.class, "LBL_CreatedFiles")); // NOI18N
+
+ jScrollPane1.setBorder(null);
+
+ createdFilesTextPane.setBorder(null);
+ createdFilesTextPane.setEditable(false);
+ createdFilesTextPane.setOpaque(false);
+ jScrollPane1.setViewportView(createdFilesTextPane);
+
+ createMenuCheckBox.setSelected(true);
+ org.openide.awt.Mnemonics.setLocalizedText(createMenuCheckBox, NbBundle.getMessage(AddOnPanelVisual1Project.class, "LBL_CreateMenu")); // NOI18N
+ createMenuCheckBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
+ createMenuCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
+ createMenuCheckBox.setName("createMenuStructure"); // NOI18N
+ createMenuCheckBox.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ createMenuCheckBoxActionPerformed(evt);
+ }
+ });
+
+ createToolbarCheckBox.setSelected(true);
+ org.openide.awt.Mnemonics.setLocalizedText(createToolbarCheckBox, NbBundle.getMessage(AddOnPanelVisual1Project.class, "LBL_CreateToolbar")); // NOI18N
+ createToolbarCheckBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
+ createToolbarCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
+ createToolbarCheckBox.setName("createToolbarStructure"); // NOI18N
+ createToolbarCheckBox.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ createToolbarCheckBoxActionPerformed(evt);
+ }
+ });
+
+ org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
+ this.setLayout(layout);
+ layout.setHorizontalGroup(
+ layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(layout.createSequentialGroup()
+ .addContainerGap()
+ .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(createdFolderLabel)
+ .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
+ .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
+ .add(org.jdesktop.layout.GroupLayout.LEADING, packageNameLabel)
+ .add(layout.createSequentialGroup()
+ .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
+ .add(org.jdesktop.layout.GroupLayout.LEADING, classNameLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .add(org.jdesktop.layout.GroupLayout.LEADING, projectNameLabel))
+ .add(2, 2, 2)))
+ .add(projectLocationLabel)
+ .add(jLabel3))
+ .add(22, 22, 22)
+ .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 344, Short.MAX_VALUE)
+ .add(packageNameTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 344, Short.MAX_VALUE)
+ .add(projectLocationTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 344, Short.MAX_VALUE)
+ .add(addonNameTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 344, Short.MAX_VALUE)
+ .add(projectNameTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 344, Short.MAX_VALUE)
+ .add(createdFolderTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 344, Short.MAX_VALUE)
+ .add(createMenuCheckBox, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 344, Short.MAX_VALUE)
+ .add(createToolbarCheckBox, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 344, Short.MAX_VALUE))
+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+ .add(browseButton)
+ .addContainerGap())))
+ );
+ layout.setVerticalGroup(
+ layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(layout.createSequentialGroup()
+ .addContainerGap()
+ .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
+ .add(projectNameLabel)
+ .add(projectNameTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+ .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
+ .add(classNameLabel)
+ .add(addonNameTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+ .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
+ .add(packageNameLabel)
+ .add(packageNameTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+ .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
+ .add(browseButton)
+ .add(projectLocationLabel)
+ .add(projectLocationTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
+ .add(8, 8, 8)
+ .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
+ .add(createdFolderLabel)
+ .add(createdFolderTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
+ .add(17, 17, 17)
+ .add(createMenuCheckBox)
+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+ .add(createToolbarCheckBox)
+ .add(25, 25, 25)
+ .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(jLabel3)
+ .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 117, Short.MAX_VALUE))
+ .addContainerGap())
+ );
+ }// </editor-fold>//GEN-END:initComponents
+
+ private void createMenuCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_createMenuCheckBoxActionPerformed
+
+ if (createMenuCheckBox.isSelected()) {
+ panel.updatePanelSteps(AddOnWizardIterator.ALL_PANELS);
+ }
+ else {
+ createToolbarCheckBox.setSelected(true);
+ panel.updatePanelSteps(AddOnWizardIterator.TOOLBAR_PANEL);
+ }
+
+ }//GEN-LAST:event_createMenuCheckBoxActionPerformed
+
+ private void createToolbarCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_createToolbarCheckBoxActionPerformed
+
+ if (createToolbarCheckBox.isSelected())
+ panel.updatePanelSteps(AddOnWizardIterator.ALL_PANELS);
+ else {
+ createMenuCheckBox.setSelected(true);
+ panel.updatePanelSteps(AddOnWizardIterator.MENU_PANEL);
+ }
+
+ }//GEN-LAST:event_createToolbarCheckBoxActionPerformed
+
+ private void browseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_browseButtonActionPerformed
+ String command = evt.getActionCommand();
+ if ("BROWSE".equals(command)) { // NOI18N
+ JFileChooser chooser = new JFileChooser(FileSystemView.getFileSystemView());
+ FileUtil.preventFileChooserSymlinkTraversal(chooser, ConfigurationSettings.getDefaultFileChooserStartingDir());
+ chooser.setDialogTitle(NbBundle.getMessage(AddOnWizardIterator.class, "LBL_FileChooserTitle"));
+ chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
+ String path = this.projectLocationTextField.getText();
+ if (path.length() > 0) {
+ File f = new File(path);
+ if (f.exists()) {
+ chooser.setSelectedFile(f);
+ }
+ }
+ if (JFileChooser.APPROVE_OPTION == chooser.showOpenDialog(this)) {
+ File projectDir = chooser.getSelectedFile();
+ ConfigurationSettings.storeDefaultFileChooserStartingDir(projectDir);
+ projectLocationTextField.setText(FileUtil.normalizeFile(projectDir).getAbsolutePath());
+ }
+ panel.fireChangeEvent();
+ }
+
+ }//GEN-LAST:event_browseButtonActionPerformed
+
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JTextField addonNameTextField;
+ private javax.swing.JButton browseButton;
+ private javax.swing.JLabel classNameLabel;
+ private javax.swing.JCheckBox createMenuCheckBox;
+ private javax.swing.JCheckBox createToolbarCheckBox;
+ private javax.swing.JTextPane createdFilesTextPane;
+ private javax.swing.JLabel createdFolderLabel;
+ private javax.swing.JTextField createdFolderTextField;
+ private javax.swing.JLabel jLabel3;
+ private javax.swing.JScrollPane jScrollPane1;
+ private javax.swing.JLabel packageNameLabel;
+ private javax.swing.JTextField packageNameTextField;
+ private javax.swing.JLabel projectLocationLabel;
+ private javax.swing.JTextField projectLocationTextField;
+ private javax.swing.JLabel projectNameLabel;
+ private javax.swing.JTextField projectNameTextField;
+ // End of variables declaration//GEN-END:variables
+
+ public void addNotify() {
+ super.addNotify();
+ //same problem as in 31086, initial focus on Cancel button
+ projectNameTextField.requestFocus();
+ }
+
+ boolean valid(WizardDescriptor wizardDescriptor) {
+
+ if (projectNameTextField.getText().length() == 0) {
+ String message = NbBundle.getMessage(AddOnWizardIterator.class, "LBL_ErrorMessageFolder");
+ wizardDescriptor.putProperty("WizardPanel_errorMessage", message); // NOI18N
+ return false; // Display name not specified
+ }
+ File f = FileUtil.normalizeFile(new File(projectLocationTextField.getText()).getAbsoluteFile());
+ if (!f.isDirectory()) {
+ String message = NbBundle.getMessage(AddOnWizardIterator.class, "LBL_ErrorMessagePath");
+ wizardDescriptor.putProperty("WizardPanel_errorMessage", message); // NOI18N
+ }
+ final File destFolder = FileUtil.normalizeFile(new File(createdFolderTextField.getText()).getAbsoluteFile());
+
+ File projLoc = destFolder;
+ while (projLoc != null && !projLoc.exists()) {
+ projLoc = projLoc.getParentFile();
+ }
+ if (projLoc == null || !projLoc.canWrite()) {
+ String message = NbBundle.getMessage(AddOnWizardIterator.class, "LBL_ErrorMessageCreateFolder");
+ wizardDescriptor.putProperty("WizardPanel_errorMessage", message); // NOI18N
+ return false;
+ }
+
+ if (FileUtil.toFileObject(projLoc) == null) {
+ String message = NbBundle.getMessage(AddOnWizardIterator.class, "LBL_ErrorMessagePath");
+ wizardDescriptor.putProperty("WizardPanel_errorMessage", message); // NOI18N
+ return false;
+ }
+
+ File[] kids = destFolder.listFiles();
+ if (destFolder.exists() && kids != null && kids.length > 0) {
+ // Folder exists and is not empty
+ String message = NbBundle.getMessage(AddOnWizardIterator.class, "LBL_ErrorMessageFolderNotEmpty");
+ wizardDescriptor.putProperty("WizardPanel_errorMessage", message); // NOI18N
+ return false;
+ }
+ wizardDescriptor.putProperty("WizardPanel_errorMessage", ""); // NOI18N
+ return true;
+ }
+
+ void store(WizardDescriptor d) {
+ String name = projectNameTextField.getText().trim();
+ String folder = createdFolderTextField.getText().trim();
+
+ try {
+ d.putProperty("projdir", new File(folder)); // NOI18N
+ d.putProperty("name", name); // NOI18N
+ d.putProperty("ProjectDir", new File(folder).getCanonicalPath()); // NOI18N
+ d.putProperty("ProjectName", name); // NOI18N
+ d.putProperty("ProjectDisplayName", name); // NOI18N
+ } catch (IOException e) {
+ // TODO
+ }
+
+ String mainClass = addonNameTextField.getText().trim();
+ String packageName = packageNameTextField.getText().trim();
+ d.putProperty("mainClassName", mainClass); // NOI18N
+ d.putProperty("mainClassNameSmall", mainClass.toLowerCase()); // NOI18N
+ d.putProperty("RegistrationClass", packageName + "." + mainClass); // NOI18N
+ d.putProperty("Protocol", packageName.concat(".").concat(mainClass.toLowerCase())); // NOI18N
+ d.putProperty("displayName", mainClass); // NOI18N
+ d.putProperty("packageName", packageName); // NOI18N
+ d.putProperty("UnoPackage", packageName); // NOI18N
+ d.putProperty("GotMenu", createMenuCheckBox.isSelected()); // NOI18N
+ d.putProperty("GotToolbar", createToolbarCheckBox.isSelected()); // NOI18N
+ }
+
+ private void updateCreatedFiles() {
+ createdFilesTextPane.setText(generatedFiles[0] + generatedFiles[1] +
+ generatedFiles[2] + generatedFiles[3]);
+ }
+
+ void read(WizardDescriptor settings) {
+ File projectLocation = (File) settings.getProperty("projdir"); // NOI18N
+ if (projectLocation == null || projectLocation.getParentFile() == null ||
+ !projectLocation.getParentFile().isDirectory()) {
+ projectLocation = ProjectChooser.getProjectsFolder();
+ } else {
+ projectLocation = projectLocation.getParentFile();
+ }
+ this.projectLocationTextField.setText(projectLocation.getAbsolutePath());
+
+
+ String projectName = (String) settings.getProperty("name"); // NOI18N
+ if(projectName == null) {
+ projectName = "AddOn"; // NOI18N
+ String[] fileList = projectLocation.list(new FilenameFilter() {
+ public boolean accept(File dir, String name) {
+ if (name.startsWith("AddOn")) return true; // NOI18N
+ return false;
+ }
+ });
+ boolean searchProjectName = true;
+ int length = projectName.length();
+ for (int i=0; searchProjectName && i<fileList.length + 1; i++) {
+ switch (i) {
+ case 0: // keep project name
+ break;
+ case 1: // append 1
+ projectName = new StringBuffer(projectName).append(1).toString();
+ break;
+ default: // remove number and append the next one
+ projectName = new StringBuffer(projectName.substring(0, length)).append(i).toString();
+ }
+ // test if the name is already used
+ searchProjectName = false;
+ for (int j=0; !searchProjectName && j<fileList.length; j++) {
+ // if the project name isn't found, searchProjectName stays false and the name is kept
+ searchProjectName |= fileList[j].equals(projectName);
+ }
+ }
+ }
+ this.projectNameTextField.setText(projectName);
+ this.projectNameTextField.selectAll();
+
+ String mainclass = (String)settings.getProperty("mainClassName"); // NOI18N
+ if (mainclass == null)
+ mainclass = projectName;
+ addonNameTextField.setText(mainclass);
+
+ String packagename = (String)settings.getProperty("packageName"); // NOI18N
+ if (packagename == null)
+ packagename = NbBundle.getMessage(ConfigurationSettings.class, "default.package"); // NOI18N
+ packageNameTextField.setText(packagename);
+
+ String packagePath = "src/" + packagename.replace('.', '/') + '/'; // NOI18N
+ generatedFiles[0] = packagePath + mainclass + ".java\n"; // NOI18N
+ updateCreatedFiles();
+ }
+
+ void validate(WizardDescriptor d) throws WizardValidationException {
+ // nothing to validate
+ }
+
+ // Implementation of DocumentListener --------------------------------------
+
+ public void changedUpdate(DocumentEvent e) {
+ updateTexts(e);
+ if (this.projectNameTextField.getDocument() == e.getDocument()) {
+ firePropertyChange(PROP_PROJECT_NAME,null,this.projectNameTextField.getText());
+ }
+ }
+
+ public void insertUpdate(DocumentEvent e) {
+ updateTexts(e);
+ if (this.projectNameTextField.getDocument() == e.getDocument()) {
+ firePropertyChange(PROP_PROJECT_NAME,null,this.projectNameTextField.getText());
+ }
+ }
+
+ public void removeUpdate(DocumentEvent e) {
+ updateTexts(e);
+ if (this.projectNameTextField.getDocument() == e.getDocument()) {
+ firePropertyChange(PROP_PROJECT_NAME,null,this.projectNameTextField.getText());
+ }
+ }
+
+ /** Handles changes in the Project name and project directory, */
+ private void updateTexts(DocumentEvent e) {
+
+ Document doc = e.getDocument();
+
+ if (doc == addonNameTextField.getDocument() && addonNameTextField.getText().length()>0) {
+ if (!projectNameTextField.getText().equals(addonNameTextField.getText()))
+ addonNameModified = true;
+ }
+
+ if (doc == projectNameTextField.getDocument() || doc == projectLocationTextField.getDocument() ||
+ doc == packageNameTextField.getDocument()) {
+ // Change in the project name
+
+ String projectName = projectNameTextField.getText();
+ String projectFolder = projectLocationTextField.getText();
+
+ if (!addonNameModified)
+ addonNameTextField.setText(projectName);
+
+ //if (projectFolder.trim().length() == 0 || projectFolder.equals(oldName)) {
+ createdFolderTextField.setText(projectFolder.concat(File.separator).concat(projectName));
+ //}
+
+ String packagePath = "src/" + packageNameTextField.getText().replace('.', '/') + '/'; // NOI18N
+ generatedFiles[0] = packagePath + addonNameTextField.getText() + ".java\n"; // NOI18N
+
+ updateCreatedFiles();
+ }
+ if(doc == addonNameTextField.getDocument()) {
+ String packagePath = "src/" + packageNameTextField.getText().replace('.', '/') + '/'; // NOI18N
+ generatedFiles[0] = packagePath + addonNameTextField.getText() + ".java\n"; // NOI18N
+ updateCreatedFiles();
+ }
+
+ panel.fireChangeEvent(); // Notify that the panel changed
+ }
+
+}
Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/addon/AddOnPanelVisual2Description.form
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/addon/AddOnPanelVisual2Description.form?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/addon/AddOnPanelVisual2Description.form (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/addon/AddOnPanelVisual2Description.form Fri Jan 27 01:29:33 2012
@@ -0,0 +1,177 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<Form version="1.3" maxVersion="1.3" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
+ <Properties>
+ <Property name="autoscrolls" type="boolean" value="true"/>
+ <Property name="requestFocusEnabled" type="boolean" value="false"/>
+ </Properties>
+ <AuxValues>
+ <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
+ <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
+ <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="2"/>
+ <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
+ <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
+ </AuxValues>
+
+ <Layout>
+ <DimensionLayout dim="0">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Group type="102" alignment="1" attributes="0">
+ <Component id="jSplitPane1" pref="405" max="32767" attributes="0"/>
+ <EmptySpace max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Group type="103" groupAlignment="1" attributes="0">
+ <Component id="addFunctionButton" alignment="1" min="-2" pref="152" max="-2" attributes="1"/>
+ <Component id="deleteButton" alignment="1" min="-2" pref="152" max="-2" attributes="1"/>
+ </Group>
+ <Component id="deleteLanguageButton" min="-2" pref="152" max="-2" attributes="1"/>
+ <Component id="addLanguageButton" min="-2" pref="152" max="-2" attributes="1"/>
+ </Group>
+ <EmptySpace max="-2" attributes="0"/>
+ </Group>
+ </Group>
+ </DimensionLayout>
+ <DimensionLayout dim="1">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Group type="102" alignment="0" attributes="0">
+ <Component id="addFunctionButton" min="-2" max="-2" attributes="0"/>
+ <EmptySpace max="-2" attributes="0"/>
+ <Component id="deleteButton" min="-2" max="-2" attributes="0"/>
+ <EmptySpace pref="372" max="32767" attributes="0"/>
+ <Component id="addLanguageButton" min="-2" max="-2" attributes="0"/>
+ <EmptySpace max="-2" attributes="0"/>
+ <Component id="deleteLanguageButton" min="-2" max="-2" attributes="0"/>
+ </Group>
+ <Component id="jSplitPane1" alignment="1" pref="500" max="32767" attributes="0"/>
+ </Group>
+ </DimensionLayout>
+ </Layout>
+ <SubComponents>
+ <Container class="javax.swing.JSplitPane" name="jSplitPane1">
+ <Properties>
+ <Property name="dividerLocation" type="int" value="200"/>
+ <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
+ <Color blue="ff" green="ff" id="white" palette="1" red="ff" type="palette"/>
+ </Property>
+ </Properties>
+
+ <Layout class="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout"/>
+ <SubComponents>
+ <Container class="javax.swing.JPanel" name="jPanel1">
+ <Properties>
+ <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
+ <Border info="org.netbeans.modules.form.compat2.border.EtchedBorderInfo">
+ <EtchetBorder/>
+ </Border>
+ </Property>
+ <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[5, 10]"/>
+ </Property>
+ <Property name="name" type="java.lang.String" value="properties" noResource="true"/>
+ <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[5, 10]"/>
+ </Property>
+ </Properties>
+ <AuxValues>
+ <AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="new PropertySheet();"/>
+ </AuxValues>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
+ <JSplitPaneConstraints position="right"/>
+ </Constraint>
+ </Constraints>
+
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout"/>
+ </Container>
+ <Container class="javax.swing.JScrollPane" name="jScrollPane1">
+ <Properties>
+ <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
+ <Border info="org.netbeans.modules.form.compat2.border.EtchedBorderInfo">
+ <EtchetBorder/>
+ </Border>
+ </Property>
+ <Property name="focusTraversalPolicy" type="java.awt.FocusTraversalPolicy" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
+ <Connection component="Form" name="focusTraversalPolicy" type="property"/>
+ </Property>
+ <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[5, 10]"/>
+ </Property>
+ <Property name="name" type="java.lang.String" value="commands" noResource="true"/>
+ <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[5, 10]"/>
+ </Property>
+ </Properties>
+ <AuxValues>
+ <AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="new TreeTableView();"/>
+ </AuxValues>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
+ <JSplitPaneConstraints position="left"/>
+ </Constraint>
+ </Constraints>
+
+ <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
+ </Container>
+ </SubComponents>
+ </Container>
+ <Component class="javax.swing.JButton" name="addFunctionButton">
+ <Properties>
+ <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/openoffice/extensions/projecttemplates/addon/Bundle.properties" key="LBL_BUTTON_AddCommand" replaceFormat="org.openide.util.NbBundle.getMessage(AddOnWizardIterator.class, "{key}")"/>
+ </Property>
+ <Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/openoffice/extensions/projecttemplates/calcaddin/Bundle.properties" key="BUTTON_AddFunction_Tooltip" replaceFormat="NbBundle.getMessage(AddOnPanelVisual2Description.class, "{key}")"/>
+ </Property>
+ <Property name="name" type="java.lang.String" value="addCommand" noResource="true"/>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="addFunctionButtonActionPerformed"/>
+ </Events>
+ </Component>
+ <Component class="javax.swing.JButton" name="deleteLanguageButton">
+ <Properties>
+ <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/openoffice/extensions/projecttemplates/calcaddin/Bundle.properties" key="LBL_BUTTON_DeleteLanguage" replaceFormat="org.openide.util.NbBundle.getMessage(AddOnWizardIterator.class, "LBL_BUTTON_DeleteLanguage")"/>
+ </Property>
+ <Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/openoffice/extensions/projecttemplates/calcaddin/Bundle.properties" key="BUTTON_DeleteLang_Tooltip" replaceFormat="NbBundle.getMessage(AddOnPanelVisual2Description.class, "{key}")"/>
+ </Property>
+ <Property name="name" type="java.lang.String" value="deleteLanguage" noResource="true"/>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="deleteLanguageButtonActionPerformed"/>
+ </Events>
+ </Component>
+ <Component class="javax.swing.JButton" name="deleteButton">
+ <Properties>
+ <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/openoffice/extensions/projecttemplates/addon/Bundle.properties" key="LBL_BUTTON_Delete" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "LBL_BUTTON_Delete")"/>
+ </Property>
+ <Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/openoffice/extensions/projecttemplates/calcaddin/Bundle.properties" key="BUTTON_Delete_Tooltip" replaceFormat="NbBundle.getMessage(AddOnPanelVisual2Description.class, "{key}")"/>
+ </Property>
+ <Property name="name" type="java.lang.String" value="deleteCommand" noResource="true"/>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="deleteButtonActionPerformed"/>
+ </Events>
+ </Component>
+ <Component class="javax.swing.JButton" name="addLanguageButton">
+ <Properties>
+ <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/openoffice/extensions/projecttemplates/calcaddin/Bundle.properties" key="LBL_BUTTON_AddLanguage" replaceFormat="org.openide.util.NbBundle.getMessage(AddOnWizardIterator.class, "LBL_BUTTON_AddLanguage")"/>
+ </Property>
+ <Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/openoffice/extensions/projecttemplates/calcaddin/Bundle.properties" key="BUTTON_AddLang_Tooltip" replaceFormat="NbBundle.getMessage(AddOnPanelVisual2Description.class, "{key}")"/>
+ </Property>
+ <Property name="name" type="java.lang.String" value="addLanguage" noResource="true"/>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="addLanguageButtonActionPerformed"/>
+ </Events>
+ </Component>
+ </SubComponents>
+</Form>
Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/addon/AddOnPanelVisual2Description.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/addon/AddOnPanelVisual2Description.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/addon/AddOnPanelVisual2Description.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/addon/AddOnPanelVisual2Description.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,373 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: AddOnPanelVisual2Description.java,v $
+ *
+ * $Revision: 1.10 $
+ *
+ * last change: $Author: sg $ $Date: 2008/07/24 10:59:00 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+package org.openoffice.extensions.projecttemplates.addon;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyVetoException;
+import java.util.HashSet;
+import javax.swing.ActionMap;
+import javax.swing.JPanel;
+import javax.swing.tree.TreeSelectionModel;
+import org.openide.WizardDescriptor;
+import org.openide.WizardValidationException;
+import org.openide.explorer.ExplorerManager;
+import org.openide.explorer.ExplorerUtils;
+import org.openide.explorer.propertysheet.PropertySheet;
+import org.openide.explorer.view.TreeTableView;
+import org.openide.nodes.Node;
+import org.openide.util.Lookup;
+import org.openide.util.NbBundle;
+import org.openoffice.extensions.projecttemplates.addon.datamodel.AddOn;
+import org.openoffice.extensions.projecttemplates.addon.datamodel.Command;
+import org.openoffice.extensions.projecttemplates.addon.datamodel.node.AddOnNode;
+import org.openoffice.extensions.projecttemplates.addon.datamodel.node.AddOnTreeCreator;
+import org.openoffice.extensions.util.datamodel.localization.LanguageDefinition;
+import org.openoffice.extensions.util.datamodel.properties.LocalizedOpenOfficeOrgProperty;
+import org.openoffice.extensions.util.datamodel.NbNodeObject;
+//import org.openoffice.extensions.projecttemplates.calcaddin.datamodel.node.AddInNode;
+//import org.openoffice.extensions.projecttemplates.calcaddin.datamodel.node.AddInTreeCreator;
+import org.openoffice.extensions.util.LogWriter;
+import org.openoffice.extensions.util.datamodel.actions.BaseAction;
+import org.openoffice.extensions.util.datamodel.properties.UnknownOpenOfficeOrgPropertyException;
+
+public class AddOnPanelVisual2Description extends JPanel implements
+ ExplorerManager.Provider, PropertyChangeListener {
+
+ public static final String PROP_PROJECT_NAME = "descFirst"; // NOI18N
+
+ private ExplorerManager manager = new ExplorerManager();
+ private PropertySheet propSheet;
+ private Lookup lookup;
+
+ private AddOnActions actions;
+ private AddOnWizardPanel2Description panel;
+
+ /** Creates new form PanelProjectLocationVisual */
+ public AddOnPanelVisual2Description(AddOnWizardPanel2Description panel) {
+ initComponents();
+
+ this.panel = panel;
+
+ AddOnNode node = AddOnTreeCreator.createInitialFunctionTree();
+ manager.setRootContext(node);
+
+ TreeTableView view = (TreeTableView)jScrollPane1;
+ view.setRootVisible(false);
+ view.setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
+
+ // for keyboard actions enable this: handle actions must be done, too
+ ActionMap map = getActionMap();
+// map.put("delete", ExplorerUtils.actionDelete(manager, true)); // NOI18N
+
+ propSheet = (PropertySheet)jPanel1;
+ // this does not seem to work; commented -> later version of NB?
+// propSheet.addPropertyChangeListener(this);
+
+ actions = new AddOnActions(manager, panel);
+ // deliver the actual actions to the node-actions
+ AddOnNode rootNode = (AddOnNode)manager.getRootContext();
+ rootNode.setActions((BaseAction)actions);
+
+ manager.addPropertyChangeListener(this);
+ lookup = ExplorerUtils.createLookup(manager, map);
+ }
+
+ public ExplorerManager getExplorerManager() {
+ return manager;
+ }
+
+ public Lookup getLookup() {
+ return lookup;
+ }
+
+ /** This method is called from within the constructor to
+ * initialize the form.
+ * WARNING: Do NOT modify this code. The content of this method is
+ * always regenerated by the Form Editor.
+ */
+ // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
+ private void initComponents() {
+ jSplitPane1 = new javax.swing.JSplitPane();
+ jPanel1 = new PropertySheet();
+ jScrollPane1 = new TreeTableView();
+ addFunctionButton = new javax.swing.JButton();
+ deleteLanguageButton = new javax.swing.JButton();
+ deleteButton = new javax.swing.JButton();
+ addLanguageButton = new javax.swing.JButton();
+
+ setAutoscrolls(true);
+ setRequestFocusEnabled(false);
+ jSplitPane1.setDividerLocation(200);
+ jSplitPane1.setForeground(java.awt.Color.white);
+ jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());
+ jPanel1.setMinimumSize(new java.awt.Dimension(5, 10));
+ jPanel1.setName("properties");
+ jPanel1.setPreferredSize(new java.awt.Dimension(5, 10));
+ jSplitPane1.setRightComponent(jPanel1);
+
+ jScrollPane1.setBorder(javax.swing.BorderFactory.createEtchedBorder());
+ jScrollPane1.setFocusTraversalPolicy(getFocusTraversalPolicy());
+ jScrollPane1.setMinimumSize(new java.awt.Dimension(5, 10));
+ jScrollPane1.setName("commands");
+ jScrollPane1.setPreferredSize(new java.awt.Dimension(5, 10));
+ jSplitPane1.setLeftComponent(jScrollPane1);
+
+ org.openide.awt.Mnemonics.setLocalizedText(addFunctionButton, org.openide.util.NbBundle.getMessage(AddOnWizardIterator.class, "LBL_BUTTON_AddCommand"));
+ addFunctionButton.setToolTipText(NbBundle.getMessage(AddOnPanelVisual2Description.class, "BUTTON_AddFunction_Tooltip"));
+ addFunctionButton.setName("addCommand");
+ addFunctionButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ addFunctionButtonActionPerformed(evt);
+ }
+ });
+
+ org.openide.awt.Mnemonics.setLocalizedText(deleteLanguageButton, org.openide.util.NbBundle.getMessage(AddOnWizardIterator.class, "LBL_BUTTON_DeleteLanguage"));
+ deleteLanguageButton.setToolTipText(NbBundle.getMessage(AddOnPanelVisual2Description.class, "BUTTON_DeleteLang_Tooltip"));
+ deleteLanguageButton.setName("deleteLanguage");
+ deleteLanguageButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ deleteLanguageButtonActionPerformed(evt);
+ }
+ });
+
+ org.openide.awt.Mnemonics.setLocalizedText(deleteButton, org.openide.util.NbBundle.getMessage(AddOnPanelVisual2Description.class, "LBL_BUTTON_Delete"));
+ deleteButton.setToolTipText(NbBundle.getMessage(AddOnPanelVisual2Description.class, "BUTTON_Delete_Tooltip"));
+ deleteButton.setName("deleteCommand");
+ deleteButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ deleteButtonActionPerformed(evt);
+ }
+ });
+
+ org.openide.awt.Mnemonics.setLocalizedText(addLanguageButton, org.openide.util.NbBundle.getMessage(AddOnWizardIterator.class, "LBL_BUTTON_AddLanguage"));
+ addLanguageButton.setToolTipText(NbBundle.getMessage(AddOnPanelVisual2Description.class, "BUTTON_AddLang_Tooltip"));
+ addLanguageButton.setName("addLanguage");
+ addLanguageButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ addLanguageButtonActionPerformed(evt);
+ }
+ });
+
+ org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
+ this.setLayout(layout);
+ layout.setHorizontalGroup(
+ layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
+ .add(jSplitPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 405, Short.MAX_VALUE)
+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+ .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
+ .add(addFunctionButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 152, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .add(deleteButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 152, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
+ .add(deleteLanguageButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 152, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .add(addLanguageButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 152, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
+ .addContainerGap())
+ );
+ layout.setVerticalGroup(
+ layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(layout.createSequentialGroup()
+ .add(addFunctionButton)
+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+ .add(deleteButton)
+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 364, Short.MAX_VALUE)
+ .add(addLanguageButton)
+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+ .add(deleteLanguageButton))
+ .add(org.jdesktop.layout.GroupLayout.TRAILING, jSplitPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 488, Short.MAX_VALUE)
+ );
+ }// </editor-fold>//GEN-END:initComponents
+
+ private void deleteLanguageButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteLanguageButtonActionPerformed
+
+ actions.deleteLanguageAction();
+
+ }//GEN-LAST:event_deleteLanguageButtonActionPerformed
+
+ private void addLanguageButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addLanguageButtonActionPerformed
+
+ actions.addLanguageAction();
+
+ }//GEN-LAST:event_addLanguageButtonActionPerformed
+
+ private void deleteButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteButtonActionPerformed
+
+ actions.deleteAction();
+
+ }//GEN-LAST:event_deleteButtonActionPerformed
+
+ private void addFunctionButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addFunctionButtonActionPerformed
+
+ actions.addCommandAction();
+
+ }//GEN-LAST:event_addFunctionButtonActionPerformed
+
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JButton addFunctionButton;
+ private javax.swing.JButton addLanguageButton;
+ private javax.swing.JButton deleteButton;
+ private javax.swing.JButton deleteLanguageButton;
+ private javax.swing.JPanel jPanel1;
+ private javax.swing.JScrollPane jScrollPane1;
+ private javax.swing.JSplitPane jSplitPane1;
+ // End of variables declaration//GEN-END:variables
+
+ public void addNotify() {
+ super.addNotify();
+ try {
+ //same problem as in 31086, initial focus on Cancel button
+ manager.setSelectedNodes(manager.getRootContext().getChildren().getNodes());
+ } catch (PropertyVetoException ex) {
+ LogWriter.getLogWriter().printStackTrace(ex);
+ }
+ }
+
+ boolean valid(WizardDescriptor wizardDescriptor) {
+ Node node = manager.getRootContext();
+ AddOn addon = (AddOn)node.getLookup().lookup(NbNodeObject.class);
+ NbNodeObject[]commands = addon.getAllCommands();
+ if (commands.length == 0) {
+ String message = NbBundle.getMessage(AddOnWizardIterator.class, "LBL_ErrorMessageOneCommand");
+ wizardDescriptor.putProperty("WizardPanel_errorMessage", message); // NOI18N
+ return false;
+ }
+ HashSet<String>names = new HashSet<String>();
+ for (int i = 0; i < commands.length; i++) {
+ Command com = (Command)commands[i];
+ try {
+ String name = com.getSimpleProperty(com.PROPERTY_CONTAINER_NAME);
+ // use hash set for checking if names are unique;
+ // every element is only once inside
+ names.add(name);
+ if (names.size() != i + 1) {
+ String message = NbBundle.getMessage(AddOnWizardIterator.class, "LBL_ErrorMessageUniqueName");
+ wizardDescriptor.putProperty("WizardPanel_errorMessage", message); // NOI18N
+ return false;
+ }
+ } catch (UnknownOpenOfficeOrgPropertyException ex) {
+ LogWriter.getLogWriter().printStackTrace(ex);
+ }
+ }
+ wizardDescriptor.putProperty("WizardPanel_errorMessage", ""); // NOI18N
+ return true;
+ }
+
+ void store(WizardDescriptor d) {
+ Node node = manager.getRootContext();
+ // first subnodes are functions
+ NbNodeObject addOn = (NbNodeObject)node.getLookup().lookup(NbNodeObject.class);
+ d.putProperty("AddOn", addOn); // NOI18N
+
+// NbNodeObject[] subNodes = addOn.getAllSubObjects();
+// d.putProperty("functionCount", new Integer(subNodes.length)); // NOI18N
+// for (int i=0; i<subNodes.length; i++) {
+// Vector<String> functionSignatureContainer = new Vector<String>();
+// Function function = (Function)subNodes[i];
+// try {
+// String retValue = function.getProperty(function.PROPERTY_Type).getValueForLanguage(-1);
+// functionSignatureContainer.add(retValue);
+// String funcName = function.getProperty(function.PROPERTY_Name).getValueForLanguage(-1);
+// functionSignatureContainer.add(funcName);
+//
+// // multilingual stuff
+// LocalizedOpenOfficeOrgProperty prop = (LocalizedOpenOfficeOrgProperty)function.getProperty(function.PROPERTY_DisplayName);
+// String[][]localProps = getLocalizedProperties(prop, funcName);
+// d.putProperty(funcName.concat("DisplayName"), localProps); // NOI18N
+//
+// } catch (UnknownOpenOfficeOrgLanguageIDException ex) {
+// LogWriter.getLogWriter().printStackTrace(ex);
+// }
+// String[] functionArray = (String[])functionSignatureContainer.toArray(new String[functionSignatureContainer.size()]);
+// d.putProperty(new StringBuffer("function").append(i).toString(), functionArray); // NOI18N
+// }
+ }
+
+// private String[][] getLocalizedProperties(LocalizedOpenOfficeOrgProperty prop, String defaultValue) {
+// if (defaultValue == null) defaultValue = ""; // NOI18N
+// Integer[] indexes = prop.getUsedLanguageIndexes();
+// String[][] retValue = new String[2][indexes.length];
+// for (int i=0; i<indexes.length; i++) {
+// int languageID = indexes[i].intValue();
+// String text = prop.getValueForLanguage(languageID);
+// String language = LanguageDefinition.getLanguageShortNameForId(languageID);
+// retValue[0][i] = language;
+// if (text != null && text.length() > 0 && text.charAt(0) != '<'
+// && text.charAt(text.length() - 1) != '>') {
+// retValue[1][i] = text;
+// }
+// else {
+// retValue[1][i] = defaultValue;
+// }
+// }
+// return retValue;
+// }
+
+ void read(WizardDescriptor settings) {
+
+ /* File projectLocation = (File) settings.getProperty("projdir"); // NOI18N
+ if (projectLocation == null || projectLocation.getParentFile() == null || !projectLocation.getParentFile().isDirectory()) {
+ projectLocation = ProjectChooser.getProjectsFolder();
+ } else {
+ projectLocation = projectLocation.getParentFile();
+ }
+ this.projectLocationTextField.setText(projectLocation.getAbsolutePath());
+
+ String projectName = (String) settings.getProperty("name"); // NOI18N
+ if(projectName == null) {
+ projectName = "AddOn"; // NOI18N
+ }
+ this.projectNameTextField.setText(projectName);
+ this.projectNameTextField.selectAll(); */
+ }
+
+ void validate(WizardDescriptor d) throws WizardValidationException {
+ // nothing to validate
+ }
+
+ public void propertyChange(PropertyChangeEvent evt) {
+ // because of TreeSelectionModel.SINGLE_TREE_SELECTION max. one node is selected
+ Node[] selectedNodes = manager.getSelectedNodes();
+ if (selectedNodes.length > 0) {
+ deleteButton.setEnabled(true);
+ }
+ else {
+ deleteButton.setEnabled(false);
+ }
+ propSheet.setNodes(selectedNodes);
+ panel.fireChangeEvent(); // Notify that the panel changed
+ }
+}
Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/addon/AddOnPanelVisual3Menubar.form
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/addon/AddOnPanelVisual3Menubar.form?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/addon/AddOnPanelVisual3Menubar.form (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/projecttemplates/addon/AddOnPanelVisual3Menubar.form Fri Jan 27 01:29:33 2012
@@ -0,0 +1,249 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<Form version="1.3" maxVersion="1.3" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
+ <Properties>
+ <Property name="autoscrolls" type="boolean" value="true"/>
+ <Property name="requestFocusEnabled" type="boolean" value="false"/>
+ </Properties>
+ <AuxValues>
+ <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
+ <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
+ <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="2"/>
+ <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
+ <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
+ </AuxValues>
+
+ <Layout>
+ <DimensionLayout dim="0">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Group type="102" alignment="1" attributes="0">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Group type="102" alignment="1" attributes="0">
+ <Component id="jLabel1" pref="91" max="32767" attributes="0"/>
+ <EmptySpace max="-2" attributes="0"/>
+ <Component id="previewComboBox" min="-2" pref="350" max="-2" attributes="0"/>
+ </Group>
+ <Component id="jSplitPane1" pref="453" max="32767" attributes="0"/>
+ </Group>
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Group type="102" attributes="0">
+ <EmptySpace max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Component id="addMenuButton" alignment="0" pref="179" max="32767" attributes="1"/>
+ <Component id="addSeparatorButton" alignment="0" pref="179" max="32767" attributes="1"/>
+ <Component id="addCommandsButton" pref="179" max="32767" attributes="0"/>
+ <Component id="removeCommandButton" pref="179" max="32767" attributes="0"/>
+ </Group>
+ </Group>
+ <Group type="102" alignment="0" attributes="0">
+ <EmptySpace min="-2" pref="46" max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="1" attributes="0">
+ <Component id="downButton" alignment="0" pref="63" max="32767" attributes="1"/>
+ <Component id="upButton" alignment="0" max="32767" attributes="1"/>
+ </Group>
+ <EmptySpace min="-2" pref="76" max="-2" attributes="0"/>
+ </Group>
+ </Group>
+ <EmptySpace max="-2" attributes="0"/>
+ </Group>
+ </Group>
+ </DimensionLayout>
+ <DimensionLayout dim="1">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Group type="102" alignment="0" attributes="0">
+ <Group type="103" groupAlignment="3" attributes="0">
+ <Component id="previewComboBox" alignment="3" min="-2" max="-2" attributes="0"/>
+ <Component id="jLabel1" alignment="3" min="-2" pref="23" max="-2" attributes="0"/>
+ </Group>
+ <EmptySpace max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="1" attributes="0">
+ <Group type="102" alignment="0" attributes="0">
+ <Component id="addMenuButton" min="-2" max="-2" attributes="0"/>
+ <EmptySpace max="-2" attributes="0"/>
+ <Component id="addSeparatorButton" min="-2" max="-2" attributes="0"/>
+ <EmptySpace max="-2" attributes="0"/>
+ <Component id="addCommandsButton" min="-2" max="-2" attributes="0"/>
+ <EmptySpace max="-2" attributes="0"/>
+ <Component id="removeCommandButton" min="-2" max="-2" attributes="0"/>
+ <EmptySpace min="-2" pref="50" max="-2" attributes="0"/>
+ <Component id="upButton" min="-2" pref="31" max="-2" attributes="0"/>
+ <EmptySpace max="-2" attributes="0"/>
+ <Component id="downButton" min="-2" pref="29" max="-2" attributes="0"/>
+ <EmptySpace max="-2" attributes="0"/>
+ </Group>
+ <Component id="jSplitPane1" pref="449" max="32767" attributes="0"/>
+ </Group>
+ </Group>
+ </Group>
+ </DimensionLayout>
+ </Layout>
+ <SubComponents>
+ <Container class="javax.swing.JSplitPane" name="jSplitPane1">
+ <Properties>
+ <Property name="dividerLocation" type="int" value="200"/>
+ <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
+ <Color blue="ff" green="ff" id="white" palette="1" red="ff" type="palette"/>
+ </Property>
+ </Properties>
+
+ <Layout class="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout"/>
+ <SubComponents>
+ <Container class="javax.swing.JPanel" name="jPanel1">
+ <Properties>
+ <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
+ <Border info="org.netbeans.modules.form.compat2.border.EtchedBorderInfo">
+ <EtchetBorder/>
+ </Border>
+ </Property>
+ <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[5, 10]"/>
+ </Property>
+ <Property name="name" type="java.lang.String" value="properties" noResource="true"/>
+ <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[5, 10]"/>
+ </Property>
+ </Properties>
+ <AuxValues>
+ <AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="new PropertySheet();"/>
+ </AuxValues>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
+ <JSplitPaneConstraints position="right"/>
+ </Constraint>
+ </Constraints>
+
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout"/>
+ </Container>
+ <Container class="javax.swing.JScrollPane" name="jScrollPane1">
+ <Properties>
+ <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
+ <Border info="org.netbeans.modules.form.compat2.border.EtchedBorderInfo">
+ <EtchetBorder/>
+ </Border>
+ </Property>
+ <Property name="focusTraversalPolicy" type="java.awt.FocusTraversalPolicy" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
+ <Connection component="Form" name="focusTraversalPolicy" type="property"/>
+ </Property>
+ <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[5, 10]"/>
+ </Property>
+ <Property name="name" type="java.lang.String" value="menuStructure" noResource="true"/>
+ <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[5, 10]"/>
+ </Property>
+ </Properties>
+ <AuxValues>
+ <AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="new TreeTableView();"/>
+ </AuxValues>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
+ <JSplitPaneConstraints position="left"/>
+ </Constraint>
+ </Constraints>
+
+ <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
+ </Container>
+ </SubComponents>
+ </Container>
+ <Component class="javax.swing.JButton" name="addMenuButton">
+ <Properties>
+ <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/openoffice/extensions/projecttemplates/addon/Bundle.properties" key="LBL_BUTTON_AddSubMenu" replaceFormat="NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
+ </Property>
+ <Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/openoffice/extensions/projecttemplates/addon/Bundle.properties" key="BUTTON_AddSubMenu_Tooltip" replaceFormat="NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
+ </Property>
+ <Property name="name" type="java.lang.String" value="addMenu" noResource="true"/>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="addMenuButtonActionPerformed"/>
+ </Events>
+ </Component>
+ <Component class="javax.swing.JButton" name="addSeparatorButton">
+ <Properties>
+ <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/openoffice/extensions/projecttemplates/addon/Bundle.properties" key="LBL_BUTTON_AddSeparator" replaceFormat="NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
+ </Property>
+ <Property name="name" type="java.lang.String" value="addSeparator" noResource="true"/>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="addSeparatorButtonActionPerformed"/>
+ </Events>
+ </Component>
+ <Component class="javax.swing.JButton" name="upButton">
+ <Properties>
+ <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
+ <Image iconType="3" name="/org/openoffice/extensions/projecttemplates/addon/icons/up.gif"/>
+ </Property>
+ <Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/openoffice/extensions/projecttemplates/addon/Bundle.properties" key="BUTTON_MoveUp_Tooltip" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "LBL_BUTTON_Delete")"/>
+ </Property>
+ <Property name="name" type="java.lang.String" value="up" noResource="true"/>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="upButtonActionPerformed"/>
+ </Events>
+ </Component>
+ <Component class="javax.swing.JButton" name="downButton">
+ <Properties>
+ <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
+ <Image iconType="3" name="/org/openoffice/extensions/projecttemplates/addon/icons/down.gif"/>
+ </Property>
+ <Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/openoffice/extensions/projecttemplates/addon/Bundle.properties" key="BUTTON_MoveDown_Tooltip" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "LBL_BUTTON_Delete")"/>
+ </Property>
+ <Property name="name" type="java.lang.String" value="down" noResource="true"/>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="downButtonActionPerformed"/>
+ </Events>
+ </Component>
+ <Component class="javax.swing.JButton" name="removeCommandButton">
+ <Properties>
+ <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/openoffice/extensions/projecttemplates/addon/Bundle.properties" key="LBL_BUTTON_Delete" replaceFormat="NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
+ </Property>
+ <Property name="name" type="java.lang.String" value="delete" noResource="true"/>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="removeCommandButtonActionPerformed"/>
+ </Events>
+ </Component>
+ <Component class="javax.swing.JButton" name="addCommandsButton">
+ <Properties>
+ <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/openoffice/extensions/projecttemplates/addon/Bundle.properties" key="LBL_BUTTON_AddCommand" replaceFormat="NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
+ </Property>
+ <Property name="name" type="java.lang.String" value="addCommand" noResource="true"/>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="addCommandsButtonActionPerformed"/>
+ </Events>
+ </Component>
+ <Component class="javax.swing.JComboBox" name="previewComboBox">
+ <Properties>
+ <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
+ <Connection code="getPreviewModel()" type="code"/>
+ </Property>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="previewComboBoxActionPerformed"/>
+ </Events>
+ </Component>
+ <Component class="javax.swing.JLabel" name="jLabel1">
+ <Properties>
+ <Property name="horizontalAlignment" type="int" value="2"/>
+ <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
+ <ComponentRef name="previewComboBox"/>
+ </Property>
+ <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/openoffice/extensions/projecttemplates/addon/Bundle.properties" key="LBL_Preview" replaceFormat="NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
+ </Property>
+ <Property name="horizontalTextPosition" type="int" value="4"/>
+ </Properties>
+ </Component>
+ </SubComponents>
+</Form>