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 [9/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/or...
Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/implobject/ImplObjectDescription_zh_CN.html
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/implobject/ImplObjectDescription_zh_CN.html?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/implobject/ImplObjectDescription_zh_CN.html (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/implobject/ImplObjectDescription_zh_CN.html Fri Jan 27 01:29:33 2012
@@ -0,0 +1,8 @@
+<html lang='zh'>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=gb2312"/>
+</head>
+ <body>
+´´½¨Ò»¸öÒÔ Java ʵÏֵķþÎñ¶ÔÏó¡£
+ </body>
+</html>
Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/implobject/ImplObjectIterator.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/implobject/ImplObjectIterator.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/implobject/ImplObjectIterator.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/implobject/ImplObjectIterator.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,241 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ImplObjectIterator.java,v $
+ *
+ * $Revision: 1.5 $
+ *
+ * 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.filetypes.implobject;
+
+import java.awt.Component;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.LinkedHashSet;
+import java.util.NoSuchElementException;
+import java.util.Properties;
+import java.util.Set;
+import javax.swing.JComponent;
+import javax.swing.event.ChangeListener;
+import org.openide.WizardDescriptor;
+import org.openide.filesystems.FileLock;
+import org.openide.filesystems.FileObject;
+import org.openide.filesystems.FileUtil;
+import org.openoffice.extensions.config.ConfigurationSettings;
+import org.openoffice.extensions.util.LogWriter;
+import org.openoffice.extensions.util.ProjectCreator;
+
+public final class ImplObjectIterator implements WizardDescriptor.InstantiatingIterator {
+
+ private int index;
+
+ private WizardDescriptor wizard;
+ private WizardDescriptor.Panel[] panels;
+
+ /**
+ * Initialize panels representing individual wizard's steps and sets
+ * various properties for them influencing wizard appearance.
+ */
+ private WizardDescriptor.Panel[] getPanels() {
+ if (panels == null) {
+ panels = new WizardDescriptor.Panel[] {
+ new ImplObjectWizardPanel1(),
+ };
+ String[] steps = createSteps();
+ for (int i = 0; i < panels.length; i++) {
+ Component c = panels[i].getComponent();
+ if (steps[i] == null) {
+ // Default step name to component name of panel. Mainly
+ // useful for getting the name of the target chooser to
+ // appear in the list of steps.
+ steps[i] = c.getName();
+ }
+ if (c instanceof JComponent) { // assume Swing components
+ JComponent jc = (JComponent) c;
+ // Sets step number of a component
+ jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i)); // NOI18N
+ // Sets steps names for a panel
+ jc.putClientProperty("WizardPanel_contentData", steps); // NOI18N
+ // Turn on subtitle creation on each step
+ jc.putClientProperty("WizardPanel_autoWizardStyle", Boolean.TRUE); // NOI18N
+ // Show steps on the left side with the image on the background
+ jc.putClientProperty("WizardPanel_contentDisplayed", Boolean.TRUE); // NOI18N
+ // Turn on numbering of all steps
+ jc.putClientProperty("WizardPanel_contentNumbered", Boolean.TRUE); // NOI18N
+ }
+ }
+ }
+ return panels;
+ }
+
+ public Set instantiate() throws IOException {
+ Set<FileObject> resultSet = new LinkedHashSet<FileObject>();
+ File dirF = FileUtil.normalizeFile((File) wizard.getProperty("srcdir")); // NOI18N
+ dirF.mkdirs();
+
+ // construct necessary properties in wizard
+ wizard.putProperty("TimeStamp", ConfigurationSettings.getTimeStamp()); // NOI18N
+
+ String[] idlFiles = (String[])wizard.getProperty("Service"); // NOI18N
+ // fire skeletonmaker!
+ ProjectCreator creator = new ProjectCreator(dirF.getParentFile(), wizard);
+ boolean allOk = creator.skeletonmaker(idlFiles);
+
+ FileObject projectRoot = FileUtil.toFileObject(dirF.getParentFile());
+ FileObject projectUnoProps = projectRoot.getFileObject("nbproject").getFileObject("project-uno", "properties"); // NOI18N
+ Properties props = new Properties();
+
+ // load the existing props
+ boolean doRegistration = ((Boolean)wizard.getProperty("DoRegistration")).booleanValue();
+ if (allOk && doRegistration) {
+ InputStream inStream = projectUnoProps.getInputStream();
+ props.load(inStream);
+ inStream.close();
+ String centralRegClass = props.getProperty("central.registration.class"); // NOI18N
+ // entry exists, do nothing
+ if (centralRegClass != null) {
+ String regClasses = props.getProperty("registration.classname"); // NOI18N
+ String fullName = ((String)wizard.getProperty("packageName")).concat(
+ ".").concat((String)wizard.getProperty("mainClassName"));
+ regClasses = regClasses.concat(" ").concat(fullName);
+ props.setProperty("registration.classname", regClasses); // NOI18N
+ }
+ FileLock lock = projectUnoProps.lock();
+ try {
+ OutputStream out = projectUnoProps.getOutputStream(lock);
+ props.store(out, null);
+ out.close();
+ } catch (IOException ex) {
+ LogWriter.getLogWriter().printStackTrace(ex);
+ }
+ finally {
+ lock.releaseLock();
+ }
+ }
+ return resultSet;
+ }
+
+ public void initialize(WizardDescriptor wizard) {
+ this.wizard = wizard;
+ }
+
+ public void uninitialize(WizardDescriptor wizard) {
+ panels = null;
+ }
+
+ public WizardDescriptor.Panel current() {
+ return getPanels()[index];
+ }
+
+ public String name() {
+ return index + 1 + ". from " + getPanels().length; // NOI18N ?? is this used anyway?
+ }
+
+ public boolean hasNext() {
+ return index < getPanels().length - 1;
+ }
+
+ public boolean hasPrevious() {
+ return index > 0;
+ }
+
+ public void nextPanel() {
+ if (!hasNext()) {
+ throw new NoSuchElementException();
+ }
+ index++;
+ }
+
+ public void previousPanel() {
+ if (!hasPrevious()) {
+ throw new NoSuchElementException();
+ }
+ index--;
+ }
+
+ // If nothing unusual changes in the middle of the wizard, simply:
+ public void addChangeListener(ChangeListener l) {}
+ public void removeChangeListener(ChangeListener l) {}
+
+ // If something changes dynamically (besides moving between panels), e.g.
+ // the number of panels changes in response to user input, then uncomment
+ // the following and call when needed: fireChangeEvent();
+ /*
+ private Set<ChangeListener> listeners = new HashSet<ChangeListener>(1);
+ public final void addChangeListener(ChangeListener l) {
+ synchronized (listeners) {
+ listeners.add(l);
+ }
+ }
+ public final void removeChangeListener(ChangeListener l) {
+ synchronized (listeners) {
+ listeners.remove(l);
+ }
+ }
+ protected final void fireChangeEvent() {
+ Iterator<ChangeListener> it;
+ synchronized (listeners) {
+ it = new HashSet<ChangeListener>(listeners).iterator();
+ }
+ ChangeEvent ev = new ChangeEvent(this);
+ while (it.hasNext()) {
+ it.next().stateChanged(ev);
+ }
+ }
+ */
+
+ // You could safely ignore this method. Is is here to keep steps which were
+ // there before this wizard was instantiated. It should be better handled
+ // by NetBeans Wizard API itself rather than needed to be implemented by a
+ // client code.
+ private String[] createSteps() {
+ String[] beforeSteps = null;
+ Object prop = wizard.getProperty("WizardPanel_contentData"); // NOI18N
+ if (prop != null && prop instanceof String[]) {
+ beforeSteps = (String[]) prop;
+ }
+
+ if (beforeSteps == null) {
+ beforeSteps = new String[0];
+ }
+
+ String[] res = new String[(beforeSteps.length - 1) + panels.length];
+ for (int i = 0; i < res.length; i++) {
+ if (i < (beforeSteps.length - 1)) {
+ res[i] = beforeSteps[i];
+ } else {
+ res[i] = panels[i - beforeSteps.length + 1].getComponent().getName();
+ }
+ }
+ return res;
+ }
+
+}
Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/implobject/ImplObjectResolver.xml
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/implobject/ImplObjectResolver.xml?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/implobject/ImplObjectResolver.xml (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/implobject/ImplObjectResolver.xml Fri Jan 27 01:29:33 2012
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE MIME-resolver PUBLIC "-//NetBeans//DTD MIME Resolver 1.0//EN" "http://www.netbeans.org/dtds/mime-resolver-1_0.dtd">
+<MIME-resolver>
+ <file>
+ <ext name="java"/>
+ <resolver mime="text/x-java"/>
+
+ </file>
+</MIME-resolver>
Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/implobject/ImplObjectTemplate.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/implobject/ImplObjectTemplate.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/implobject/ImplObjectTemplate.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/implobject/ImplObjectTemplate.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,5 @@
+package org.openoffice.extensions.filetypes.implobject;
+
+class ImplObjectTemplate {
+
+}
Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/implobject/ImplObjectTypeBrowser.form
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/implobject/ImplObjectTypeBrowser.form?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/implobject/ImplObjectTypeBrowser.form (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/implobject/ImplObjectTypeBrowser.form Fri Jan 27 01:29:33 2012
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<Form version="1.3" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
+ <AuxValues>
+ <AuxValue name="FormSettings_generateMnemonicsCode" 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="0" attributes="0">
+ <EmptySpace max="-2" attributes="0"/>
+ <Component id="jScrollPane1" pref="299" max="32767" attributes="0"/>
+ <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">
+ <EmptySpace max="-2" attributes="0"/>
+ <Component id="jScrollPane1" pref="207" max="32767" attributes="0"/>
+ <EmptySpace max="-2" attributes="0"/>
+ </Group>
+ </Group>
+ </DimensionLayout>
+ </Layout>
+ <SubComponents>
+ <Container class="javax.swing.JScrollPane" name="jScrollPane1">
+ <AuxValues>
+ <AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="new BeanTreeView();"/>
+ </AuxValues>
+
+ <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
+ </Container>
+ </SubComponents>
+</Form>
Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/implobject/ImplObjectTypeBrowser.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/implobject/ImplObjectTypeBrowser.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/implobject/ImplObjectTypeBrowser.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/implobject/ImplObjectTypeBrowser.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,126 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ImplObjectTypeBrowser.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: sg $ $Date: 2007/09/06 17:14:11 $
+ *
+ * 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.filetypes.implobject;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import org.openide.DialogDescriptor;
+import org.openide.explorer.ExplorerManager;
+import org.openide.explorer.view.BeanTreeView;
+import org.openide.nodes.Node;
+import org.openoffice.extensions.util.datamodel.NbNodeObject;
+import org.openoffice.extensions.util.typebrowser.logic.TypeNode;
+
+/**
+ *
+ * @author sg128468
+ */
+public class ImplObjectTypeBrowser extends javax.swing.JPanel
+ implements ExplorerManager.Provider, ActionListener {
+
+ private ExplorerManager manager = new ExplorerManager();
+
+ private TypeNode rootNode;
+
+ private ImplObjectVisualPanel1 comp;
+
+ /** Creates new form ImplObjectTypeBrowser */
+ public ImplObjectTypeBrowser(ImplObjectVisualPanel1 comp, String[] allowedNodes, NbNodeObject[] ownIdlTypes) {
+ initComponents();
+
+ this.comp = comp;
+ TypeNode.setDesignedTypes(ownIdlTypes);
+ this.rootNode = TypeNode.createRootNode(allowedNodes);
+ manager.setRootContext(rootNode);
+
+ BeanTreeView typeView = (BeanTreeView)jScrollPane1;
+ if (rootNode.getChildren().getNodesCount() != 0) // display error message correctly if needed
+ typeView.setRootVisible(false);
+ else
+ typeView.setRootVisible(true);
+ }
+
+ /** 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() {
+ jScrollPane1 = new BeanTreeView();
+
+ 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(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 299, Short.MAX_VALUE)
+ .addContainerGap())
+ );
+ layout.setVerticalGroup(
+ layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(layout.createSequentialGroup()
+ .addContainerGap()
+ .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 207, Short.MAX_VALUE)
+ .addContainerGap())
+ );
+ }// </editor-fold>//GEN-END:initComponents
+
+ public ExplorerManager getExplorerManager() {
+ return manager;
+ }
+
+ protected void addDialogDescriptor(DialogDescriptor ddsc) {
+// this.dialogDescriptor = ddsc;
+ ddsc.setButtonListener(this);
+
+ // set help context eventually
+// dialogDescriptor.setHelpCtx(new HelpCtx("helpCtxString")); // NOI18N
+ }
+
+ public void actionPerformed(ActionEvent e) {
+ if (e.getActionCommand().equals("OK")) { // NOI18N
+ Node[] nodes = manager.getSelectedNodes();
+ comp.setNodes(nodes);
+ }
+ }
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JScrollPane jScrollPane1;
+ // End of variables declaration//GEN-END:variables
+
+}
Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/implobject/ImplObjectVisualPanel1.form
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/implobject/ImplObjectVisualPanel1.form?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/implobject/ImplObjectVisualPanel1.form (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/implobject/ImplObjectVisualPanel1.form Fri Jan 27 01:29:33 2012
@@ -0,0 +1,201 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<Form version="1.3" maxVersion="1.3" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
+ <AuxValues>
+ <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
+ <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
+ <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">
+ <EmptySpace max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="1" attributes="0">
+ <Component id="jSeparator1" alignment="1" pref="404" max="32767" attributes="0"/>
+ <Group type="102" alignment="1" attributes="0">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Component id="jLabel5" alignment="0" pref="83" max="32767" attributes="1"/>
+ <Component id="jLabel4" alignment="1" pref="83" max="32767" attributes="1"/>
+ <Component id="jLabel3" alignment="0" pref="83" max="32767" attributes="1"/>
+ <Component id="jLabel6" alignment="0" pref="83" max="32767" attributes="1"/>
+ <Component id="jLabel2" pref="83" max="32767" attributes="1"/>
+ <Component id="jLabel1" alignment="0" pref="83" max="32767" attributes="1"/>
+ </Group>
+ <EmptySpace max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Component id="locationTextField" pref="309" max="32767" attributes="1"/>
+ <Component id="packageComboBox" alignment="1" pref="309" max="32767" attributes="0"/>
+ <Component id="nameTextField1" alignment="1" pref="309" max="32767" attributes="1"/>
+ <Component id="createdFileTextField" alignment="1" pref="309" max="32767" attributes="0"/>
+ <Component id="projectTextField" alignment="1" pref="309" max="32767" attributes="1"/>
+ <Group type="102" alignment="1" attributes="0">
+ <Component id="serviceTextField" pref="224" max="32767" attributes="0"/>
+ <EmptySpace max="-2" attributes="0"/>
+ <Component id="jBrowsButton" min="-2" max="-2" attributes="0"/>
+ </Group>
+ </Group>
+ </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">
+ <EmptySpace max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Component id="nameTextField1" min="-2" max="-2" attributes="0"/>
+ <Component id="jLabel1" min="-2" max="-2" attributes="0"/>
+ </Group>
+ <EmptySpace min="-2" pref="40" max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="3" attributes="0">
+ <Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/>
+ <Component id="jBrowsButton" alignment="3" min="-2" max="-2" attributes="0"/>
+ <Component id="serviceTextField" alignment="3" min="-2" max="-2" attributes="0"/>
+ </Group>
+ <EmptySpace max="32767" attributes="0"/>
+ <Group type="103" groupAlignment="3" attributes="0">
+ <Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
+ <Component id="projectTextField" alignment="3" min="-2" max="-2" attributes="0"/>
+ </Group>
+ <EmptySpace max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="3" attributes="0">
+ <Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
+ <Component id="locationTextField" alignment="3" min="-2" max="-2" attributes="0"/>
+ </Group>
+ <EmptySpace max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="3" attributes="0">
+ <Component id="packageComboBox" alignment="3" min="-2" max="-2" attributes="0"/>
+ <Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/>
+ </Group>
+ <EmptySpace max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="3" attributes="0">
+ <Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/>
+ <Component id="createdFileTextField" alignment="3" min="-2" max="-2" attributes="0"/>
+ </Group>
+ <EmptySpace max="-2" attributes="0"/>
+ <Component id="jSeparator1" min="-2" pref="12" max="-2" attributes="0"/>
+ <EmptySpace min="-2" pref="114" max="-2" attributes="0"/>
+ </Group>
+ </Group>
+ </DimensionLayout>
+ </Layout>
+ <SubComponents>
+ <Component class="javax.swing.JLabel" name="jLabel1">
+ <Properties>
+ <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
+ <ComponentRef name="nameTextField1"/>
+ </Property>
+ <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/openoffice/extensions/filetypes/implobject/Bundle.properties" key="LBL_ClassName" replaceFormat="NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
+ </Property>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JLabel" name="jLabel2">
+ <Properties>
+ <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
+ <ComponentRef name="projectTextField"/>
+ </Property>
+ <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/openoffice/extensions/filetypes/implobject/Bundle.properties" key="LBL_Project" replaceFormat="NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
+ </Property>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JLabel" name="jLabel3">
+ <Properties>
+ <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
+ <ComponentRef name="locationTextField"/>
+ </Property>
+ <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/openoffice/extensions/filetypes/implobject/Bundle.properties" key="LBL_Location" replaceFormat="NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
+ </Property>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JLabel" name="jLabel4">
+ <Properties>
+ <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
+ <ComponentRef name="packageComboBox"/>
+ </Property>
+ <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/openoffice/extensions/filetypes/implobject/Bundle.properties" key="LBL_Package" replaceFormat="NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
+ </Property>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JLabel" name="jLabel5">
+ <Properties>
+ <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
+ <ComponentRef name="createdFileTextField"/>
+ </Property>
+ <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/openoffice/extensions/filetypes/implobject/Bundle.properties" key="LBL_CreatedFile" replaceFormat="NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
+ </Property>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JTextField" name="nameTextField1">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="NewUNOJavaImpl"/>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JComboBox" name="packageComboBox">
+ <Properties>
+ <Property name="editable" type="boolean" value="true"/>
+ <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
+ <Connection code="m_comboBoxModel" type="code"/>
+ </Property>
+ <Property name="actionCommand" type="java.lang.String" value="packageComboBoxChanged"/>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JTextField" name="projectTextField">
+ <Properties>
+ <Property name="editable" type="boolean" value="false"/>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JTextField" name="locationTextField">
+ <Properties>
+ <Property name="editable" type="boolean" value="false"/>
+ <Property name="text" type="java.lang.String" value="Source Packages"/>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JTextField" name="createdFileTextField">
+ <Properties>
+ <Property name="editable" type="boolean" value="false"/>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JSeparator" name="jSeparator1">
+ </Component>
+ <Component class="javax.swing.JLabel" name="jLabel6">
+ <Properties>
+ <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
+ <ComponentRef name="serviceTextField"/>
+ </Property>
+ <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/openoffice/extensions/filetypes/implobject/Bundle.properties" key="LBL_Service" replaceFormat="NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
+ </Property>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JTextField" name="serviceTextField">
+ <Properties>
+ <Property name="editable" type="boolean" value="false"/>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JButton" name="jBrowsButton">
+ <Properties>
+ <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/openoffice/extensions/filetypes/implobject/Bundle.properties" key="LBL_BUTTON_SelectService" replaceFormat="NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
+ </Property>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jBrowsButtonActionPerformed"/>
+ </Events>
+ </Component>
+ </SubComponents>
+</Form>
Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/implobject/ImplObjectVisualPanel1.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/implobject/ImplObjectVisualPanel1.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/implobject/ImplObjectVisualPanel1.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/implobject/ImplObjectVisualPanel1.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,500 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ImplObjectVisualPanel1.java,v $
+ *
+ * $Revision: 1.8 $
+ *
+ * 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.filetypes.implobject;
+
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Dialog;
+import java.awt.Image;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.KeyEvent;
+import java.awt.event.KeyListener;
+import java.io.File;
+import java.io.IOException;
+import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.Vector;
+import java.util.regex.Pattern;
+import javax.swing.ComboBoxModel;
+import javax.swing.ImageIcon;
+import javax.swing.JLabel;
+import javax.swing.JList;
+import javax.swing.JPanel;
+import javax.swing.ListCellRenderer;
+import javax.swing.SwingConstants;
+import javax.swing.event.DocumentEvent;
+import javax.swing.event.DocumentListener;
+import javax.swing.event.ListDataEvent;
+import javax.swing.event.ListDataListener;
+import org.netbeans.api.project.Project;
+import org.netbeans.api.project.ProjectUtils;
+import org.netbeans.spi.project.ui.templates.support.Templates;
+import org.openide.DialogDescriptor;
+import org.openide.DialogDisplayer;
+import org.openide.WizardDescriptor;
+import org.openide.filesystems.FileObject;
+import org.openide.filesystems.FileUtil;
+import org.openide.nodes.Node;
+import org.openide.util.ImageUtilities;
+import org.openide.util.NbBundle;
+import org.openoffice.extensions.util.IdlFileHelper;
+import org.openoffice.extensions.util.LogWriter;
+import org.openoffice.extensions.util.datamodel.NbNodeObject;
+import org.openoffice.extensions.util.typebrowser.logic.UnoTypes;
+import org.openoffice.extensions.util.typebrowser.logic.TypeNode;
+
+public final class ImplObjectVisualPanel1 extends JPanel implements DocumentListener, KeyListener, ActionListener {
+
+ public static final String PROP_NAME = "name"; // NOI18N
+
+ private SourceFolderComboBoxModel m_comboBoxModel;
+ private String m_sBasePath;
+ private Vector<String> m_services;
+ private ImplObjectWizardPanel1 panel;
+ private String m_sPackage;
+ private NbNodeObject[] m_IdlFiles;
+ private boolean m_bServiceAdded;
+
+ /**
+ * Creates new form ImplObjectVisualPanel1
+ */
+ public ImplObjectVisualPanel1(ImplObjectWizardPanel1 panel) {
+ this.panel = panel;
+ m_sPackage = "";
+ m_comboBoxModel = new SourceFolderComboBoxModel();
+ Image iconImage = ImageUtilities.loadImage("org/openoffice/extensions/projecttemplates/component/icons/module.png");
+ SourceFolderListCellRenderer renderer = new SourceFolderListCellRenderer(new ImageIcon(iconImage));
+ m_services = new Vector<String>();
+ initComponents();
+ packageComboBox.setRenderer(renderer);
+ packageComboBox.addActionListener(this);
+ packageComboBox.getEditor().getEditorComponent().addKeyListener(this);
+ nameTextField1.getDocument().addDocumentListener(this);
+ }
+
+ public String getName() {
+ return NbBundle.getMessage(ImplObjectIterator.class, "ImplObjectVisualPanelName"); // NOI18N
+ }
+
+ /** 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() {
+
+ jLabel1 = new javax.swing.JLabel();
+ jLabel2 = new javax.swing.JLabel();
+ jLabel3 = new javax.swing.JLabel();
+ jLabel4 = new javax.swing.JLabel();
+ jLabel5 = new javax.swing.JLabel();
+ nameTextField1 = new javax.swing.JTextField();
+ packageComboBox = new javax.swing.JComboBox();
+ projectTextField = new javax.swing.JTextField();
+ locationTextField = new javax.swing.JTextField();
+ createdFileTextField = new javax.swing.JTextField();
+ jSeparator1 = new javax.swing.JSeparator();
+ jLabel6 = new javax.swing.JLabel();
+ serviceTextField = new javax.swing.JTextField();
+ jBrowsButton = new javax.swing.JButton();
+
+ jLabel1.setLabelFor(nameTextField1);
+ org.openide.awt.Mnemonics.setLocalizedText(jLabel1, NbBundle.getMessage(ImplObjectVisualPanel1.class, "LBL_ClassName")); // NOI18N
+
+ jLabel2.setLabelFor(projectTextField);
+ org.openide.awt.Mnemonics.setLocalizedText(jLabel2, NbBundle.getMessage(ImplObjectVisualPanel1.class, "LBL_Project")); // NOI18N
+
+ jLabel3.setLabelFor(locationTextField);
+ org.openide.awt.Mnemonics.setLocalizedText(jLabel3, NbBundle.getMessage(ImplObjectVisualPanel1.class, "LBL_Location")); // NOI18N
+
+ jLabel4.setLabelFor(packageComboBox);
+ org.openide.awt.Mnemonics.setLocalizedText(jLabel4, NbBundle.getMessage(ImplObjectVisualPanel1.class, "LBL_Package")); // NOI18N
+
+ jLabel5.setLabelFor(createdFileTextField);
+ org.openide.awt.Mnemonics.setLocalizedText(jLabel5, NbBundle.getMessage(ImplObjectVisualPanel1.class, "LBL_CreatedFile")); // NOI18N
+
+ nameTextField1.setText("NewUNOJavaImpl");
+
+ packageComboBox.setEditable(true);
+ packageComboBox.setModel(m_comboBoxModel);
+ packageComboBox.setActionCommand("packageComboBoxChanged");
+
+ projectTextField.setEditable(false);
+
+ locationTextField.setEditable(false);
+ locationTextField.setText("Source Packages");
+
+ createdFileTextField.setEditable(false);
+
+ jLabel6.setLabelFor(serviceTextField);
+ org.openide.awt.Mnemonics.setLocalizedText(jLabel6, NbBundle.getMessage(ImplObjectVisualPanel1.class, "LBL_Service")); // NOI18N
+
+ serviceTextField.setEditable(false);
+
+ org.openide.awt.Mnemonics.setLocalizedText(jBrowsButton, NbBundle.getMessage(ImplObjectVisualPanel1.class, "LBL_BUTTON_SelectService")); // NOI18N
+ jBrowsButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ jBrowsButtonActionPerformed(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()
+ .addContainerGap()
+ .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
+ .add(jSeparator1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 404, Short.MAX_VALUE)
+ .add(layout.createSequentialGroup()
+ .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(jLabel5, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 83, Short.MAX_VALUE)
+ .add(org.jdesktop.layout.GroupLayout.TRAILING, jLabel4, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 83, Short.MAX_VALUE)
+ .add(jLabel3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 83, Short.MAX_VALUE)
+ .add(jLabel6, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 83, Short.MAX_VALUE)
+ .add(jLabel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 83, Short.MAX_VALUE)
+ .add(jLabel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 83, Short.MAX_VALUE))
+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+ .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(locationTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 309, Short.MAX_VALUE)
+ .add(org.jdesktop.layout.GroupLayout.TRAILING, packageComboBox, 0, 309, Short.MAX_VALUE)
+ .add(org.jdesktop.layout.GroupLayout.TRAILING, nameTextField1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 309, Short.MAX_VALUE)
+ .add(org.jdesktop.layout.GroupLayout.TRAILING, createdFileTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 309, Short.MAX_VALUE)
+ .add(org.jdesktop.layout.GroupLayout.TRAILING, projectTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 309, Short.MAX_VALUE)
+ .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
+ .add(serviceTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 224, Short.MAX_VALUE)
+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+ .add(jBrowsButton)))))
+ .addContainerGap())
+ );
+ layout.setVerticalGroup(
+ layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(layout.createSequentialGroup()
+ .addContainerGap()
+ .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(nameTextField1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .add(jLabel1))
+ .add(40, 40, 40)
+ .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
+ .add(jLabel6)
+ .add(jBrowsButton)
+ .add(serviceTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
+ .add(jLabel2)
+ .add(projectTextField, 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(jLabel3)
+ .add(locationTextField, 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(packageComboBox, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .add(jLabel4))
+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+ .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
+ .add(jLabel5)
+ .add(createdFileTextField, 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(jSeparator1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 12, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .add(114, 114, 114))
+ );
+ }// </editor-fold>//GEN-END:initComponents
+
+ private void jBrowsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBrowsButtonActionPerformed
+
+ // open dialog
+ ImplObjectTypeBrowser typeBrowser = new ImplObjectTypeBrowser(this,
+ new String[]{UnoTypes.MODULE, UnoTypes.SERVICE, UnoTypes.INTERFACE},
+ m_IdlFiles);
+
+ DialogDescriptor ddscr = new DialogDescriptor(typeBrowser,
+ NbBundle.getMessage(ImplObjectVisualPanel1.class, "LBL_TypeBrowser_Title"));
+
+ typeBrowser.addDialogDescriptor(ddscr);
+
+ Dialog d = DialogDisplayer.getDefault().createDialog(ddscr);
+ d.setVisible(true);
+
+ }//GEN-LAST:event_jBrowsButtonActionPerformed
+
+
+ protected void setNodes(Node[] typeNodes) {
+ // empty settings first
+ String services = null; // NOI18N
+ m_services.clear();
+ m_bServiceAdded = false;
+ for (int i = 0; i < typeNodes.length; i++) {
+ TypeNode node = (TypeNode)typeNodes[i];
+ if (node.getNodeType() == UnoTypes.SERVICE_TYPE ||
+ node.getNodeType() == UnoTypes.INTERFACE_TYPE) {
+ m_services.add(node.getHierarchicalName());
+ if (services != null) // null only when i == 0
+ services = services.concat(", ").concat(node.getHierarchicalName()); // NOI18N
+ else
+ services = node.getHierarchicalName();
+ }
+ m_bServiceAdded |= (node.getNodeType() == UnoTypes.SERVICE_TYPE);
+ }
+ serviceTextField.setText(services);
+ String etxt = serviceTextField.getText();
+ panel.fireChangeEvent();
+ }
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JTextField createdFileTextField;
+ private javax.swing.JButton jBrowsButton;
+ private javax.swing.JLabel jLabel1;
+ private javax.swing.JLabel jLabel2;
+ private javax.swing.JLabel jLabel3;
+ private javax.swing.JLabel jLabel4;
+ private javax.swing.JLabel jLabel5;
+ private javax.swing.JLabel jLabel6;
+ private javax.swing.JSeparator jSeparator1;
+ private javax.swing.JTextField locationTextField;
+ private javax.swing.JTextField nameTextField1;
+ private javax.swing.JComboBox packageComboBox;
+ private javax.swing.JTextField projectTextField;
+ private javax.swing.JTextField serviceTextField;
+ // End of variables declaration//GEN-END:variables
+
+ protected void read(WizardDescriptor desc) {
+ // project name
+ Project p = Templates.getProject(desc);
+ if (p != null) {
+ String displayName = ProjectUtils.getInformation(p).getDisplayName();
+ projectTextField.setText(displayName);
+ FileObject sourceObject = null;
+ try {
+ FileObject projDir = p.getProjectDirectory();
+ desc.putProperty("projdir", FileUtil.toFile(projDir)); // NOI18N
+ sourceObject = FileUtil.createFolder(projDir, "src"); // NOI18N
+ m_comboBoxModel.setItems(getOrderedSubFolders(sourceObject));
+ IdlFileHelper idlHelper = new IdlFileHelper(sourceObject);
+ this.m_IdlFiles = idlHelper.getAllIdlFiles();
+ } catch (IOException ex) {
+ LogWriter.getLogWriter().printStackTrace(ex);
+ }
+
+ // update UI
+ if (sourceObject != null) {
+ try {
+ File baseFile = FileUtil.toFile(sourceObject);
+ this.m_sBasePath = baseFile.getCanonicalPath();
+ desc.putProperty("srcdir", baseFile); // NOI18N
+ } catch (IOException ex) {
+ LogWriter.getLogWriter().printStackTrace(ex);
+ }
+ }
+ updateCreatedFileTextField();
+ }
+ }
+
+ protected void store(WizardDescriptor desc) {
+ String name = this.nameTextField1.getText();
+
+ desc.putProperty("Name", name); // NOI18N
+ desc.putProperty("mainClassName", name); // NOI18N
+
+ // TODO: consolidate different keys for the same values
+ desc.putProperty("Package", m_sPackage); // NOI18N
+ desc.putProperty("UnoPackage", m_sPackage); // NOI18N
+ desc.putProperty("packageName", m_sPackage); // NOI18N
+
+ desc.putProperty("DoRegistration", m_bServiceAdded);
+ desc.putProperty("Service", m_services.toArray(new String[m_services.size()])); // NOI18N
+ }
+
+ protected boolean valid() {
+ String text = serviceTextField.getText();
+ return text.length() > 0;
+ }
+
+ private void updateCreatedFileTextField() {
+ String selectedPackage = m_sPackage.replace('.', File.separatorChar);
+ String fileName = nameTextField1.getText();
+
+ String fullName = selectedPackage;
+ if (!fileName.endsWith(".java")) { // NOI18N
+ fullName = fullName.concat(".").concat(fileName);
+ fileName = fileName.concat(".java"); // NOI18N
+ }
+ else {
+ if (fileName.length() > 5) {
+ fullName = fullName.concat(".").concat(fileName.substring(0, fileName.length() - 5));
+ }
+ }
+
+ String[] services = m_services.toArray(new String[m_services.size()]);
+ for (int i = 0; i < services.length; i++) {
+ String serviceName = services[i];
+ if (fullName.equals(serviceName)) {
+
+ }
+ }
+ if (m_sBasePath != null) {
+ String fullFileName = m_sBasePath.concat(File.separator).concat(selectedPackage).concat(File.separator).concat(fileName);
+ createdFileTextField.setText(fullFileName);
+ }
+ else {
+ String fullFileName = "...".concat(File.separator).concat(selectedPackage).concat(File.separator).concat(fileName); // NOI18N
+ createdFileTextField.setText(fullFileName);
+ }
+ panel.fireChangeEvent();
+ }
+
+ private String[] getOrderedSubFolders(FileObject sourceObject) {
+ Vector<String>subFolders = new Vector<String>();
+ int length = sourceObject.getPath().length();
+ if (sourceObject != null) {
+ Enumeration sourceChildren = sourceObject.getFolders(true);
+ while (sourceChildren.hasMoreElements()) {
+ FileObject nextCandidate = (FileObject)sourceChildren.nextElement();
+ String p = nextCandidate.getPath();
+ subFolders.add(p.substring(length + 1).replace('/', '.'));
+ }
+ }
+ return subFolders.toArray(new String[subFolders.size()]);
+ }
+
+ public void insertUpdate(DocumentEvent documentEvent) {
+ updateCreatedFileTextField();
+ }
+
+ public void removeUpdate(DocumentEvent documentEvent) {
+ updateCreatedFileTextField();
+ }
+
+ public void changedUpdate(DocumentEvent documentEvent) {
+ updateCreatedFileTextField();
+ }
+
+ public void actionPerformed(ActionEvent actionEvent) {
+ if (actionEvent.getActionCommand().equals(packageComboBox.getActionCommand())) {
+ m_sPackage = packageComboBox.getSelectedItem().toString();
+ updateCreatedFileTextField();
+ }
+ }
+
+ public void keyTyped(KeyEvent e) {
+ char c = e.getKeyChar();
+ String charc = new String(new char[]{c});
+ m_sPackage = packageComboBox.getEditor().getItem().toString();
+ if (Pattern.matches("[a-zA-Z_0-9\\.]", charc)) {
+ m_sPackage = m_sPackage.concat(charc);
+ }
+ updateCreatedFileTextField();
+ }
+
+ public void keyPressed(KeyEvent e) {
+ }
+
+ public void keyReleased(KeyEvent e) {
+ }
+
+ private class SourceFolderComboBoxModel implements ComboBoxModel {
+ Vector<ListDataListener> listeners;
+ private String[] items;
+ private int index;
+ public SourceFolderComboBoxModel() {
+ listeners = new Vector<ListDataListener>();
+ items = new String[0];
+ }
+ public void setItems(String[] itemArray) {
+ if (itemArray != null && itemArray.length > 0) {
+ items = itemArray;
+ for (Iterator<ListDataListener>it = listeners.iterator(); it.hasNext();) {
+ ListDataListener l = it.next();
+ l.contentsChanged(new ListDataEvent(this, ListDataEvent.CONTENTS_CHANGED,
+ 0, items.length - 1));
+ }
+ }
+ }
+ public void setSelectedItem(Object object) {
+ for (int i = 0; i < items.length; i++) {
+ if (items[i].equals(object)) {
+ index = i;
+ }
+ }
+ }
+ public Object getSelectedItem() {
+ if (index >= 0 && index < items.length) {
+ return items[index];
+ }
+ return null;
+ }
+ public int getSize() {
+ return items.length;
+ }
+ public Object getElementAt(int i) {
+ if (i >= 0 && i < items.length) {
+ return items[i];
+ }
+ return null;
+ }
+ public void addListDataListener(ListDataListener listDataListener) {
+ listeners.add(listDataListener);
+ }
+ public void removeListDataListener(ListDataListener listDataListener) {
+ listeners.remove(listDataListener);
+ }
+ }
+
+ private class SourceFolderListCellRenderer extends JLabel implements ListCellRenderer {
+ public SourceFolderListCellRenderer(ImageIcon icon) {
+ super(icon, SwingConstants.LEFT);
+ setOpaque(true);
+ }
+ public Component getListCellRendererComponent(JList list, Object value, int index,
+ boolean isSelected, boolean cellHasFocus) {
+ Object e = m_comboBoxModel.getElementAt(index);
+ if (e != null) {
+ String name = e.toString();
+ this.setText(name);
+ if (isSelected) {
+ setBackground(new Color(184, 207, 229));
+ }
+ else {
+ setBackground(new Color(255, 255, 255));
+ }
+ }
+ return this;
+ }
+ }
+}
+
Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/implobject/ImplObjectWizardPanel1.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/implobject/ImplObjectWizardPanel1.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/implobject/ImplObjectWizardPanel1.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/implobject/ImplObjectWizardPanel1.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,113 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ImplObjectWizardPanel1.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: sg $ $Date: 2007/08/15 13:45:23 $
+ *
+ * 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.filetypes.implobject;
+
+import java.awt.Component;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+import org.openide.WizardDescriptor;
+import org.openide.util.HelpCtx;
+
+public class ImplObjectWizardPanel1 implements WizardDescriptor.Panel {
+
+ /**
+ * The visual component that displays this panel. If you need to access the
+ * component from this class, just use getComponent().
+ */
+ private ImplObjectVisualPanel1 component;
+
+ // Get the visual component for the panel. In this template, the component
+ // is kept separate. This can be more efficient: if the wizard is created
+ // but never displayed, or not all panels are displayed, it is better to
+ // create only those which really need to be visible.
+ public Component getComponent() {
+ if (component == null) {
+ component = new ImplObjectVisualPanel1(this);
+ }
+ return component;
+ }
+
+ public HelpCtx getHelp() {
+ // Show no Help button for this panel:
+ return HelpCtx.DEFAULT_HELP;
+ // If you have context help:
+ // return new HelpCtx(SampleWizardPanel1.class);
+ }
+
+ public boolean isValid() {
+ getComponent();
+ return component.valid();
+ }
+
+ private final Set<ChangeListener> listeners = new HashSet<ChangeListener>(1);
+ public final void addChangeListener(ChangeListener l) {
+ synchronized (listeners) {
+ listeners.add(l);
+ }
+ }
+ public final void removeChangeListener(ChangeListener l) {
+ synchronized (listeners) {
+ listeners.remove(l);
+ }
+ }
+ protected final void fireChangeEvent() {
+ Iterator<ChangeListener> it;
+ synchronized (listeners) {
+ it = new HashSet<ChangeListener>(listeners).iterator();
+ }
+ ChangeEvent ev = new ChangeEvent(this);
+ while (it.hasNext()) {
+ it.next().stateChanged(ev);
+ }
+ }
+
+
+ // You can use a settings object to keep track of state. Normally the
+ // settings object will be the WizardDescriptor, so you can use
+ // WizardDescriptor.getProperty & putProperty to store information entered
+ // by the user.
+ public void readSettings(Object settings) {
+ component.read((WizardDescriptor)settings);
+ }
+
+ public void storeSettings(Object settings) {
+ component.store((WizardDescriptor)settings);
+ }
+
+}
+
Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/odf/Bundle.properties
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/odf/Bundle.properties?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/odf/Bundle.properties (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/odf/Bundle.properties Fri Jan 27 01:29:33 2012
@@ -0,0 +1,5 @@
+CTL_OpenWithOpenOffice=\ Open With OpenOffice.org
+LBL_Odt_loader_name=Odf Files
+
+Services/MIMEResolver/OdfResolver.xml=Odf Files
+#Templates/Other/OdtTemplate.odt=Empty Odt file
Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/odf/Galaxy_OOo3_base-doc_16.png
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/odf/Galaxy_OOo3_base-doc_16.png?rev=1236486&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/odf/Galaxy_OOo3_base-doc_16.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/odf/Galaxy_OOo3_calc-doc_16.png
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/odf/Galaxy_OOo3_calc-doc_16.png?rev=1236486&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/odf/Galaxy_OOo3_calc-doc_16.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/odf/Galaxy_OOo3_chart-doc_16.png
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/odf/Galaxy_OOo3_chart-doc_16.png?rev=1236486&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/odf/Galaxy_OOo3_chart-doc_16.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/odf/Galaxy_OOo3_draw-doc_16.png
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/odf/Galaxy_OOo3_draw-doc_16.png?rev=1236486&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/odf/Galaxy_OOo3_draw-doc_16.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/odf/Galaxy_OOo3_impress-doc_16.png
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/odf/Galaxy_OOo3_impress-doc_16.png?rev=1236486&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/odf/Galaxy_OOo3_impress-doc_16.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/odf/Galaxy_OOo3_math-doc_16.png
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/odf/Galaxy_OOo3_math-doc_16.png?rev=1236486&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/odf/Galaxy_OOo3_math-doc_16.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/odf/Galaxy_OOo3_writer-doc_16.png
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/odf/Galaxy_OOo3_writer-doc_16.png?rev=1236486&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/odf/Galaxy_OOo3_writer-doc_16.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/odf/OdfDataLoader.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/odf/OdfDataLoader.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/odf/OdfDataLoader.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/odf/OdfDataLoader.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,72 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: OdfDataLoader.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: sg $ $Date: 2008/10/07 08:55:26 $
+ *
+ * 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.filetypes.odf;
+
+import java.io.IOException;
+import org.openide.filesystems.FileObject;
+import org.openide.loaders.DataObjectExistsException;
+import org.openide.loaders.MultiDataObject;
+import org.openide.loaders.UniFileLoader;
+import org.openide.util.NbBundle;
+
+public class OdfDataLoader extends UniFileLoader {
+
+ public static final String REQUIRED_MIME = "text/x-vnd.oasis.opendocument.text";
+ private static final long serialVersionUID = 1L;
+
+ public OdfDataLoader() {
+ super("org.openoffice.extensions.filetypes.odf.OdfDataObject");
+ }
+
+ @Override
+ protected String defaultDisplayName() {
+ return NbBundle.getMessage(OdfDataLoader.class, "LBL_Odt_loader_name");
+ }
+
+ @Override
+ protected void initialize() {
+ super.initialize();
+ getExtensions().addMimeType(REQUIRED_MIME);
+ }
+
+ protected MultiDataObject createMultiObject(FileObject primaryFile) throws DataObjectExistsException, IOException {
+ return new OdfDataObject(primaryFile, this);
+ }
+
+ @Override
+ protected String actionsContext() {
+ return "Loaders/" + REQUIRED_MIME + "/Actions";
+ }
+}
Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/odf/OdfDataLoaderBeanInfo.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/odf/OdfDataLoaderBeanInfo.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/odf/OdfDataLoaderBeanInfo.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/odf/OdfDataLoaderBeanInfo.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,65 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: OdfDataLoaderBeanInfo.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: sg $ $Date: 2009/07/06 14:51:28 $
+ *
+ * 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.filetypes.odf;
+
+import java.awt.Image;
+import java.beans.BeanInfo;
+import java.beans.IntrospectionException;
+import java.beans.Introspector;
+import java.beans.SimpleBeanInfo;
+import org.openide.loaders.UniFileLoader;
+import org.openide.util.ImageUtilities;
+
+public class OdfDataLoaderBeanInfo extends SimpleBeanInfo {
+
+ @Override
+ public BeanInfo[] getAdditionalBeanInfo() {
+ try {
+ return new BeanInfo[]{Introspector.getBeanInfo(UniFileLoader.class)};
+ } catch (IntrospectionException e) {
+ throw new AssertionError(e);
+ }
+ }
+
+ @Override
+ public Image getIcon(int type) {
+ if (type == BeanInfo.ICON_COLOR_16x16 || type == BeanInfo.ICON_MONO_16x16) {
+ return ImageUtilities.loadImage("org/openoffice/extensions/filetypes/odf/ooo_16.png");
+ } else {
+ return null;
+ }
+
+ }
+}
Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/odf/OdfDataNode.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/odf/OdfDataNode.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/odf/OdfDataNode.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/odf/OdfDataNode.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,63 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: OdfDataNode.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: sg $ $Date: 2008/10/07 08:55:26 $
+ *
+ * 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.filetypes.odf;
+
+import org.openide.loaders.DataNode;
+import org.openide.nodes.Children;
+import org.openide.util.Lookup;
+
+public class OdfDataNode extends DataNode {
+
+ public OdfDataNode(OdfDataObject obj) {
+ super(obj, Children.LEAF);
+ setIconBaseWithExtension(obj.getIconString());
+ }
+
+ OdfDataNode(OdfDataObject obj, Lookup lookup) {
+ super(obj, Children.LEAF, lookup);
+ setIconBaseWithExtension(obj.getIconString());
+ }// /** Creates a property sheet. */
+// @Override
+// protected Sheet createSheet() {
+// Sheet s = super.createSheet();
+// Sheet.Set ss = s.get(Sheet.PROPERTIES);
+// if (ss == null) {
+// ss = Sheet.createPropertiesSet();
+// s.put(ss);
+// }
+// // TODO add some relevant properties: ss.put(...)
+// return s;
+// }
+}
Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/odf/OdfDataObject.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/odf/OdfDataObject.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/odf/OdfDataObject.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/odf/OdfDataObject.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,106 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: OdfDataObject.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: sg $ $Date: 2008/10/07 08:55:26 $
+ *
+ * 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.filetypes.odf;
+
+import java.io.IOException;
+import org.openide.filesystems.FileObject;
+import org.openide.loaders.DataObjectExistsException;
+import org.openide.loaders.MultiDataObject;
+import org.openide.nodes.CookieSet;
+import org.openide.nodes.Node;
+import org.openide.util.Lookup;
+import org.openide.text.DataEditorSupport;
+
+public class OdfDataObject extends MultiDataObject {
+
+ public static final String[] ALL_ODF_EXTENSIONS = new String[]{
+ "odt", "ods", "odp", "odb", "odg", "odc", "odf"
+ };
+ private static final String GENERAL_IMAGE_ICON = "org/openoffice/extensions/filetypes/odf/ooo_16.png"; // NOI18N
+ private static final String WRITER_IMAGE_ICON = "org/openoffice/extensions/filetypes/odf/Galaxy_OOo3_writer-doc_16.png"; // NOI18N
+ private static final String MATH_IMAGE_ICON = "org/openoffice/extensions/filetypes/odf/Galaxy_OOo3_math-doc_16.png"; // NOI18N
+ private static final String IMPRESS_IMAGE_ICON = "org/openoffice/extensions/filetypes/odf/Galaxy_OOo3_impress-doc_16.png"; // NOI18N
+ private static final String DRAW_IMAGE_ICON = "org/openoffice/extensions/filetypes/odf/Galaxy_OOo3_draw-doc_16.png"; // NOI18N
+ private static final String CHART_IMAGE_ICON = "org/openoffice/extensions/filetypes/odf/Galaxy_OOo3_chart-doc_16.png"; // NOI18N
+ private static final String CALC_IMAGE_ICON = "org/openoffice/extensions/filetypes/odf/Galaxy_OOo3_calc-doc_16.png"; // NOI18N
+ private static final String BASE_IMAGE_ICON = "org/openoffice/extensions/filetypes/odf/Galaxy_OOo3_base-doc_16.png"; // NOI18N
+
+ private String iconString;
+
+ public OdfDataObject(FileObject pf, OdfDataLoader loader) throws DataObjectExistsException, IOException {
+ super(pf, loader);
+ String ext = pf.getExt();
+ if (ext.endsWith("odt")) { // NOI18N
+ iconString = WRITER_IMAGE_ICON;
+ }
+ else if (ext.endsWith("ods")) { // NOI18N
+ iconString = CALC_IMAGE_ICON;
+ }
+ else if (ext.endsWith("odb")) { // NOI18N
+ iconString = BASE_IMAGE_ICON;
+ }
+ else if (ext.endsWith("odp")) { // NOI18N
+ iconString = IMPRESS_IMAGE_ICON;
+ }
+ else if (ext.endsWith("odf")) { // NOI18N
+ iconString = MATH_IMAGE_ICON;
+ }
+ else if (ext.endsWith("odc")) { // NOI18N
+ iconString = CHART_IMAGE_ICON;
+ }
+ else if (ext.endsWith("odg")) { // NOI18N
+ iconString = DRAW_IMAGE_ICON;
+ }
+ else { // fallback
+ iconString = GENERAL_IMAGE_ICON;
+ }
+ CookieSet cookies = getCookieSet();
+ cookies.add((Node.Cookie) DataEditorSupport.create(this, getPrimaryEntry(), cookies));
+ }
+
+ @Override
+ protected Node createNodeDelegate() {
+ return new OdfDataNode(this, getLookup());
+ }
+
+ @Override
+ public Lookup getLookup() {
+ return getCookieSet().getLookup();
+ }
+
+ public String getIconString() {
+ return iconString;
+ }
+}
Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/odf/OdfResolver.xml
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/odf/OdfResolver.xml?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/odf/OdfResolver.xml (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/odf/OdfResolver.xml Fri Jan 27 01:29:33 2012
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+To change this template, choose Tools | Templates
+and open the template in the editor.
+-->
+<!DOCTYPE MIME-resolver PUBLIC "-//NetBeans//DTD MIME Resolver 1.0//EN" "http://www.netbeans.org/dtds/mime-resolver-1_0.dtd">
+<MIME-resolver>
+ <file>
+ <ext name="odt"/>
+ <ext name="ods"/>
+ <ext name="odp"/>
+ <ext name="odb"/>
+ <ext name="odg"/> <!-- draw -->
+ <ext name="odc"/> <!-- chart -->
+ <ext name="odf"/> <!-- formula -->
+ <resolver mime="text/x-vnd.oasis.opendocument.text"/>
+ </file>
+</MIME-resolver>
Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/odf/OpenWithOpenOffice.java
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/odf/OpenWithOpenOffice.java?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/odf/OpenWithOpenOffice.java (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/odf/OpenWithOpenOffice.java Fri Jan 27 01:29:33 2012
@@ -0,0 +1,63 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.openoffice.extensions.filetypes.odf;
+
+import java.io.File;
+import java.io.IOException;
+import org.openide.filesystems.FileObject;
+import org.openide.filesystems.FileUtil;
+import org.openide.nodes.Node;
+import org.openide.util.HelpCtx;
+import org.openide.util.NbBundle;
+import org.openide.util.actions.CookieAction;
+import org.openoffice.extensions.config.ConfigurationSettings;
+import org.openoffice.extensions.config.ConfigurationValidator;
+import org.openoffice.extensions.config.office.PlatformInfo;
+import org.openoffice.extensions.util.LogWriter;
+
+public final class OpenWithOpenOffice extends CookieAction {
+
+ protected void performAction(Node[] activatedNodes) {
+ OdfDataObject odtDataObject = activatedNodes[0].getLookup().lookup(OdfDataObject.class);
+ // check for correct office and open dialog if office not found
+ ConfigurationValidator.validateSettings();
+ String officePath = ConfigurationSettings.getSettings().getValue(ConfigurationSettings.KEY_OFFICE_INSTALLATION);
+ officePath = officePath.concat("/").concat(PlatformInfo.getOfficeProgramDir()).concat("/soffice");
+ FileObject fileObject = odtDataObject.getLookup().lookup(FileObject.class);
+ File file = FileUtil.toFile(fileObject);
+ try {
+ Runtime.getRuntime().exec(new String[]{officePath, file.getPath()});
+ } catch (IOException ex) {
+ LogWriter.getLogWriter().printStackTrace(ex);
+ }
+ }
+
+ protected int mode() {
+ return CookieAction.MODE_EXACTLY_ONE;
+ }
+
+ public String getName() {
+ return NbBundle.getMessage(OpenWithOpenOffice.class, "CTL_OpenWithOpenOffice");
+ }
+
+ protected Class[] cookieClasses() {
+ return new Class[]{OdfDataObject.class};
+ }
+
+ @Override
+ protected String iconResource() {
+ return null;
+ }
+
+ public HelpCtx getHelpCtx() {
+ return HelpCtx.DEFAULT_HELP;
+ }
+
+ @Override
+ protected boolean asynchronous() {
+ return false;
+ }
+}
+
Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/odf/ooo_16.png
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/odf/ooo_16.png?rev=1236486&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/odf/ooo_16.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/oxt/Bundle.properties
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/oxt/Bundle.properties?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/oxt/Bundle.properties (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/oxt/Bundle.properties Fri Jan 27 01:29:33 2012
@@ -0,0 +1,7 @@
+LBL_Oxt_loader_name=Oxt Files
+
+Services/MIMEResolver/OxtResolver.xml=Oxt Files
+#Templates/Other/OxtTemplate.oxt=Empty Oxt file
+
+# Actions
+LBL_OpenAction=Open
\ No newline at end of file
Added: incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/oxt/Bundle_ja.properties
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/oxt/Bundle_ja.properties?rev=1236486&view=auto
==============================================================================
--- incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/oxt/Bundle_ja.properties (added)
+++ incubator/ooo/devtools/netbeansintegration/src/org/openoffice/extensions/filetypes/oxt/Bundle_ja.properties Fri Jan 27 01:29:33 2012
@@ -0,0 +1,12 @@
+# LBL_Oxt_loader_name=Oxt Files
+LBL_Oxt_loader_name=Oxt \u30d5\u30a1\u30a4\u30eb
+
+# Services/MIMEResolver/OxtResolver.xml=Oxt Files
+Services/MIMEResolver/OxtResolver.xml=Oxt \u30d5\u30a1\u30a4\u30eb
+#Templates/Other/OxtTemplate.oxt=Empty Oxt file
+
+# Actions
+# LBL_OpenAction=Open
+LBL_OpenAction=\u958b\u304f
+
+