From 97993b7b20b27bbd1e3b7601381dbc90d1cb7848 Mon Sep 17 00:00:00 2001 From: Radek Oslejsek <oslejsek@fi.muni.cz> Date: Thu, 13 May 2021 15:35:42 +0200 Subject: [PATCH] Added new standsrd Option panel into the netbeans platform application --- .../options/TestOptionsPanelController.java | 95 ++++++++++++++++++ .../analyst/gui/options/TestPanel.form | 66 ++++++++++++ .../analyst/gui/options/TestPanel.java | 77 ++++++++++++++ .../analyst/gui/options/package-info.java | 9 ++ .../analyst/gui/options/Bundle.properties | 1 + GUI/src/main/resources/logo-28x32.png | Bin 0 -> 6879 bytes 6 files changed, 248 insertions(+) create mode 100644 GUI/src/main/java/cz/fidentis/analyst/gui/options/TestOptionsPanelController.java create mode 100644 GUI/src/main/java/cz/fidentis/analyst/gui/options/TestPanel.form create mode 100644 GUI/src/main/java/cz/fidentis/analyst/gui/options/TestPanel.java create mode 100644 GUI/src/main/java/cz/fidentis/analyst/gui/options/package-info.java create mode 100644 GUI/src/main/resources/cz/fidentis/analyst/gui/options/Bundle.properties create mode 100644 GUI/src/main/resources/logo-28x32.png diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/options/TestOptionsPanelController.java b/GUI/src/main/java/cz/fidentis/analyst/gui/options/TestOptionsPanelController.java new file mode 100644 index 00000000..19b26bc9 --- /dev/null +++ b/GUI/src/main/java/cz/fidentis/analyst/gui/options/TestOptionsPanelController.java @@ -0,0 +1,95 @@ +package cz.fidentis.analyst.gui.options; + +import java.beans.PropertyChangeListener; +import java.beans.PropertyChangeSupport; +import javax.swing.JComponent; +import javax.swing.SwingUtilities; +import org.netbeans.spi.options.OptionsPanelController; +import org.openide.util.HelpCtx; +import org.openide.util.Lookup; + +/** + * Generated from NetBeans (secondary Option Panel). + * + * @author Radek Oslejsek + */ +@OptionsPanelController.SubRegistration( + displayName = "#AdvancedOption_DisplayName_Test", + keywords = "#AdvancedOption_Keywords_Test", + keywordsCategory = "Advanced/Test" +) +@org.openide.util.NbBundle.Messages({"AdvancedOption_DisplayName_Test=Test", "AdvancedOption_Keywords_Test=test"}) +public final class TestOptionsPanelController extends OptionsPanelController { + + private TestPanel panel; + private final PropertyChangeSupport pcs = new PropertyChangeSupport(this); + private boolean changed; + + @Override + public void update() { + getPanel().load(); + changed = false; + } + + @Override + public void applyChanges() { + SwingUtilities.invokeLater(new Runnable() { + @Override + public void run() { + getPanel().store(); + changed = false; + } + }); + } + + @Override + public void cancel() { + // need not do anything special, if no changes have been persisted yet + } + + @Override + public boolean isValid() { + return getPanel().valid(); + } + + @Override + public boolean isChanged() { + return changed; + } + + @Override + public HelpCtx getHelpCtx() { + return null; // new HelpCtx("...ID") if you have a help set + } + + @Override + public JComponent getComponent(Lookup masterLookup) { + return getPanel(); + } + + @Override + public void addPropertyChangeListener(PropertyChangeListener l) { + pcs.addPropertyChangeListener(l); + } + + @Override + public void removePropertyChangeListener(PropertyChangeListener l) { + pcs.removePropertyChangeListener(l); + } + + private TestPanel getPanel() { + if (panel == null) { + panel = new TestPanel(this); + } + return panel; + } + + void changed() { + if (!changed) { + changed = true; + pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, false, true); + } + pcs.firePropertyChange(OptionsPanelController.PROP_VALID, null, null); + } + +} diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/options/TestPanel.form b/GUI/src/main/java/cz/fidentis/analyst/gui/options/TestPanel.form new file mode 100644 index 00000000..df4f0282 --- /dev/null +++ b/GUI/src/main/java/cz/fidentis/analyst/gui/options/TestPanel.form @@ -0,0 +1,66 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<!-- + + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + +--> + +<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo"> + <AuxValues> + <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/> + <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="true"/> + <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> + <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="jLabel1" min="-2" max="-2" attributes="0"/> + <EmptySpace pref="143" max="32767" 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="jLabel1" min="-2" max="-2" attributes="0"/> + <EmptySpace pref="38" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="jLabel1"> + <Properties> + <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> + <ResourceString bundle="cz/fidentis/analyst/gui/options/Bundle.properties" key="TestPanel.jLabel1.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/> + </Property> + </Properties> + </Component> + </SubComponents> +</Form> diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/options/TestPanel.java b/GUI/src/main/java/cz/fidentis/analyst/gui/options/TestPanel.java new file mode 100644 index 00000000..3645d60d --- /dev/null +++ b/GUI/src/main/java/cz/fidentis/analyst/gui/options/TestPanel.java @@ -0,0 +1,77 @@ +package cz.fidentis.analyst.gui.options; + +/** + * Test option panel. To be replaced with suitable implementation(s) + * Generated from NetBeans (secondary Option Panel) + * + * @author Radek Oslejsek + */ +final class TestPanel extends javax.swing.JPanel { + + private final TestOptionsPanelController controller; + + TestPanel(TestOptionsPanelController controller) { + this.controller = controller; + initComponents(); + // TODO listen to changes in form fields and call controller.changed() + } + + /** + * 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(); + + org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(TestPanel.class, "TestPanel.jLabel1.text")); // NOI18N + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabel1) + .addContainerGap(143, Short.MAX_VALUE)) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabel1) + .addContainerGap(38, Short.MAX_VALUE)) + ); + }// </editor-fold>//GEN-END:initComponents + + void load() { + // TODO read settings and initialize GUI + // Example: + // someCheckBox.setSelected(Preferences.userNodeForPackage(TestPanel.class).getBoolean("someFlag", false)); + // or for org.openide.util with API spec. version >= 7.4: + // someCheckBox.setSelected(NbPreferences.forModule(TestPanel.class).getBoolean("someFlag", false)); + // or: + // someTextField.setText(SomeSystemOption.getDefault().getSomeStringProperty()); + } + + void store() { + // TODO store modified settings + // Example: + // Preferences.userNodeForPackage(TestPanel.class).putBoolean("someFlag", someCheckBox.isSelected()); + // or for org.openide.util with API spec. version >= 7.4: + // NbPreferences.forModule(TestPanel.class).putBoolean("someFlag", someCheckBox.isSelected()); + // or: + // SomeSystemOption.getDefault().setSomeStringProperty(someTextField.getText()); + } + + boolean valid() { + // TODO check whether form is consistent and complete + return true; + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JLabel jLabel1; + // End of variables declaration//GEN-END:variables +} diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/options/package-info.java b/GUI/src/main/java/cz/fidentis/analyst/gui/options/package-info.java new file mode 100644 index 00000000..29f2b35b --- /dev/null +++ b/GUI/src/main/java/cz/fidentis/analyst/gui/options/package-info.java @@ -0,0 +1,9 @@ +/** + * FIDENTIS settings integrated into the Options window of the NetBean Platform. + */ +@OptionsPanelController.ContainerRegistration(id = "Fidentis", categoryName = "#OptionsCategory_Name_Fidentis", iconBase = "logo-28x32.png", keywords = "#OptionsCategory_Keywords_Fidentis", keywordsCategory = "Fidentis") +@NbBundle.Messages(value = {"OptionsCategory_Name_Fidentis=Fidentis", "OptionsCategory_Keywords_Fidentis=fidentis"}) +package cz.fidentis.analyst.gui.options; + +import org.netbeans.spi.options.OptionsPanelController; +import org.openide.util.NbBundle; diff --git a/GUI/src/main/resources/cz/fidentis/analyst/gui/options/Bundle.properties b/GUI/src/main/resources/cz/fidentis/analyst/gui/options/Bundle.properties new file mode 100644 index 00000000..c7bbd768 --- /dev/null +++ b/GUI/src/main/resources/cz/fidentis/analyst/gui/options/Bundle.properties @@ -0,0 +1 @@ +TestPanel.jLabel1.text=TO DO diff --git a/GUI/src/main/resources/logo-28x32.png b/GUI/src/main/resources/logo-28x32.png new file mode 100644 index 0000000000000000000000000000000000000000..ee2291925ff5aad496d15f9d5de9d12b4d1094a1 GIT binary patch literal 6879 zcmeHLc{r3^|G%w?C|Q!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