Commit cedda738 authored by Radek Ošlejšek's avatar Radek Ošlejšek
Browse files

Merge branch '264-add-the-user-guide-link-into-the-help-menu' into 'master'

Resolve "Add the User Guide link into the Help menu"

Closes #264

See merge request grp-fidentis/analyst2!279
parents 7c733897 2609a267
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -55,12 +55,12 @@
        <dependency>
            <groupId>org.netbeans.api</groupId>
            <artifactId>org-openide-util</artifactId>
            <version>${version.org.netbeans}</version>
            <version>RELEASE170</version>
        </dependency>
        <dependency>
            <groupId>org.netbeans.api</groupId>
            <artifactId>org-openide-awt</artifactId>
            <version>${version.org.netbeans}</version>
            <version>RELEASE170</version>
        </dependency>
        <!--
        <dependency>
+55 −0
Original line number Diff line number Diff line
package cz.fidentis.analyst.gui.app;

import java.awt.Desktop;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.net.URI;
import javax.swing.JOptionPane;
import org.openide.awt.ActionID;
import org.openide.awt.ActionReference;
import org.openide.awt.ActionRegistration;
import org.openide.util.NbBundle.Messages;

/**
 * Show a GitLab wiki page with user guide.
 * 
 * @author Radek Oslejsek
 */

@ActionID(
        category = "Help",
        id = "cz.fidentis.analyst.gui.app.UserGuideAction"
)
@ActionRegistration(
        displayName = "#CTL_SomeAction"
)
@ActionReference(path = "Menu/Help", position = 100)
@Messages("CTL_SomeAction=User Guide")
public final class UserGuideAction implements ActionListener {
    
    public static final URI link = URI.create("https://gitlab.fi.muni.cz/grp-fidentis/analyst2/-/wikis");

    @Override
    public void actionPerformed(ActionEvent e) {
        if (Desktop.isDesktopSupported()) {
                try {
                    Desktop.getDesktop().browse(link);
                    return;
                } catch (Exception ex) {
                    showError();
                }
            } else {
                showError();
            }
    }
    
    /**
     * Show an error window if the redirection to the URI fails.
     */
    public void showError() {
        JOptionPane.showMessageDialog(null,
                "Can't navigate to " + link + System.lineSeparator() + "Type this address to your web browser manually.", 
                "Error",
                JOptionPane.WARNING_MESSAGE);
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -41,7 +41,7 @@ public class InfoLinkButton extends JButton {
     */
    public void showError() {
        JOptionPane.showMessageDialog(this,
                "Can't navigate to " + uri + System.lineSeparator() + "Put this address to your web browser manually.", 
                "Can't navigate to " + uri + System.lineSeparator() + "Type this address to your web browser manually.", 
                "Error",
                JOptionPane.WARNING_MESSAGE);
    }
+155 −96
Original line number Diff line number Diff line
@@ -19,6 +19,14 @@
          <Group type="102" alignment="0" attributes="0">
              <EmptySpace max="-2" attributes="0"/>
              <Group type="103" groupAlignment="1" max="-2" attributes="0">
                  <Component id="jPanel2" max="32767" attributes="0"/>
                  <Group type="103" groupAlignment="1" max="-2" attributes="0">
                      <Component id="jScrollPane1" alignment="0" pref="0" max="32767" attributes="0"/>
                      <Group type="102" alignment="0" attributes="0">
                          <Component id="jPanel4" min="-2" max="-2" attributes="0"/>
                          <EmptySpace type="unrelated" max="-2" attributes="0"/>
                          <Component id="jPanel1" pref="0" max="32767" attributes="0"/>
                      </Group>
                      <Group type="102" alignment="0" attributes="0">
                          <Component id="jButton1" min="-2" max="-2" attributes="0"/>
                          <EmptySpace max="-2" attributes="0"/>
@@ -26,11 +34,10 @@
                          <EmptySpace max="-2" attributes="0"/>
                          <Component id="jButton3" min="-2" max="-2" attributes="0"/>
                      </Group>
                  <Component id="jPanel1" alignment="0" max="32767" attributes="0"/>
                  <Component id="jScrollPane1" alignment="0" pref="0" max="32767" attributes="0"/>
                  <Component id="jPanel2" alignment="0" max="32767" attributes="0"/>
                      <Component id="jPanel3" alignment="0" max="32767" attributes="0"/>
                  </Group>
              </Group>
              <EmptySpace pref="43" max="32767" attributes="0"/>
              <EmptySpace max="32767" attributes="0"/>
          </Group>
      </Group>
    </DimensionLayout>
@@ -38,8 +45,13 @@
      <Group type="103" groupAlignment="0" attributes="0">
          <Group type="102" alignment="0" attributes="0">
              <EmptySpace max="-2" attributes="0"/>
              <Component id="jPanel1" min="-2" max="-2" attributes="0"/>
              <EmptySpace max="-2" attributes="0"/>
              <Group type="103" groupAlignment="0" max="-2" attributes="0">
                  <Component id="jPanel4" max="32767" attributes="0"/>
                  <Component id="jPanel1" max="32767" attributes="0"/>
              </Group>
              <EmptySpace type="unrelated" max="-2" attributes="0"/>
              <Component id="jPanel3" min="-2" max="-2" attributes="0"/>
              <EmptySpace type="unrelated" max="-2" attributes="0"/>
              <Component id="jScrollPane1" min="-2" pref="366" max="-2" attributes="0"/>
              <EmptySpace max="-2" attributes="0"/>
              <Group type="103" groupAlignment="3" attributes="0">
@@ -47,9 +59,9 @@
                  <Component id="jButton2" alignment="3" min="-2" max="-2" attributes="0"/>
                  <Component id="jButton3" alignment="3" min="-2" max="-2" attributes="0"/>
              </Group>
              <EmptySpace max="-2" attributes="0"/>
              <EmptySpace min="-2" pref="15" max="-2" attributes="0"/>
              <Component id="jPanel2" min="-2" max="-2" attributes="0"/>
              <EmptySpace pref="25" max="32767" attributes="0"/>
              <EmptySpace max="32767" attributes="0"/>
          </Group>
      </Group>
    </DimensionLayout>
@@ -72,65 +84,30 @@
          <Group type="103" groupAlignment="0" attributes="0">
              <Group type="102" alignment="0" attributes="0">
                  <EmptySpace max="-2" attributes="0"/>
                  <Group type="103" groupAlignment="1" attributes="0">
                      <Component id="jLabel5" min="-2" max="-2" attributes="0"/>
                      <Component id="jLabel4" min="-2" max="-2" attributes="0"/>
                  </Group>
                  <EmptySpace max="-2" attributes="0"/>
                  <Group type="103" groupAlignment="0" attributes="0">
                      <Component id="jComboBox2" max="32767" attributes="0"/>
                      <Component id="jComboBox1" max="32767" attributes="0"/>
                  </Group>
                  <EmptySpace max="-2" attributes="0"/>
                  <Group type="103" groupAlignment="0" attributes="0">
                      <Group type="102" alignment="0" attributes="0">
                          <Component id="jLabel3" min="-2" max="-2" attributes="0"/>
                  <Component id="jComboBox2" min="-2" max="-2" attributes="0"/>
                  <EmptySpace max="-2" attributes="0"/>
                          <Component id="jComboBox4" min="-2" max="-2" attributes="0"/>
                      </Group>
                      <Group type="102" alignment="0" attributes="0">
                  <Component id="jComboBox3" min="-2" max="-2" attributes="0"/>
                          <EmptySpace max="-2" attributes="0"/>
                  <EmptySpace max="32767" attributes="0"/>
                  <Component id="jCheckBox1" min="-2" max="-2" attributes="0"/>
                      </Group>
                  </Group>
                  <EmptySpace max="-2" attributes="0"/>
                  <EmptySpace min="-2" pref="151" 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="102" attributes="0">
                  <EmptySpace max="-2" attributes="0"/>
                  <Group type="103" groupAlignment="3" attributes="0">
                      <Component id="jComboBox2" alignment="3" min="-2" max="-2" attributes="0"/>
                      <Component id="jComboBox3" alignment="3" min="-2" max="-2" attributes="0"/>
                      <Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/>
                      <Component id="jCheckBox1" alignment="3" min="-2" max="-2" attributes="0"/>
                  </Group>
                  <EmptySpace min="-2" pref="15" max="-2" attributes="0"/>
                  <Group type="103" groupAlignment="3" attributes="0">
                      <Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
                      <Component id="jComboBox4" alignment="3" min="-2" max="-2" attributes="0"/>
                      <Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/>
                      <Component id="jComboBox1" alignment="3" min="-2" max="-2" attributes="0"/>
                  </Group>
                  <EmptySpace max="32767" attributes="0"/>
              </Group>
          </Group>
        </DimensionLayout>
      </Layout>
      <SubComponents>
        <Component class="javax.swing.JComboBox" name="jComboBox1">
          <Properties>
            <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
              <StringArray count="0"/>
            </Property>
          </Properties>
          <AuxValues>
            <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;String&gt;"/>
          </AuxValues>
        </Component>
        <Component class="javax.swing.JComboBox" name="jComboBox2">
          <Properties>
            <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
@@ -160,45 +137,6 @@
            <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;String&gt;"/>
          </AuxValues>
        </Component>
        <Component class="javax.swing.JComboBox" name="jComboBox4">
          <Properties>
            <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
              <StringArray count="4">
                <StringItem index="0" value="Item 1"/>
                <StringItem index="1" value="Item 2"/>
                <StringItem index="2" value="Item 3"/>
                <StringItem index="3" value="Item 4"/>
              </StringArray>
            </Property>
          </Properties>
          <AuxValues>
            <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;String&gt;"/>
          </AuxValues>
        </Component>
        <Component class="javax.swing.JLabel" name="jLabel3">
          <Properties>
            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
              <ResourceString bundle="cz/fidentis/analyst/gui/task/distance/Bundle.properties" key="DistancePanel.jLabel3.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
            </Property>
          </Properties>
        </Component>
        <Component class="javax.swing.JLabel" name="jLabel4">
          <Properties>
            <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
              <Font name="Ubuntu" size="15" style="1"/>
            </Property>
            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
              <ResourceString bundle="cz/fidentis/analyst/gui/task/distance/Bundle.properties" key="DistancePanel.jLabel4.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
            </Property>
          </Properties>
        </Component>
        <Component class="javax.swing.JLabel" name="jLabel5">
          <Properties>
            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
              <ResourceString bundle="cz/fidentis/analyst/gui/task/distance/Bundle.properties" key="DistancePanel.jLabel5.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
            </Property>
          </Properties>
        </Component>
        <Component class="javax.swing.JCheckBox" name="jCheckBox1">
          <Properties>
            <Property name="selected" type="boolean" value="true"/>
@@ -232,7 +170,7 @@
              <Layout>
                <DimensionLayout dim="0">
                  <Group type="103" groupAlignment="0" attributes="0">
                      <EmptySpace min="0" pref="522" max="32767" attributes="0"/>
                      <EmptySpace min="0" pref="626" max="32767" attributes="0"/>
                  </Group>
                </DimensionLayout>
                <DimensionLayout dim="1">
@@ -270,7 +208,7 @@
                  <Component id="jLabel2" min="-2" max="-2" attributes="0"/>
                  <EmptySpace max="-2" attributes="0"/>
                  <Component id="jTextField2" min="-2" pref="60" max="-2" attributes="0"/>
                  <EmptySpace max="32767" attributes="0"/>
                  <EmptySpace pref="83" max="32767" attributes="0"/>
              </Group>
          </Group>
        </DimensionLayout>
@@ -343,5 +281,126 @@
        </Property>
      </Properties>
    </Component>
    <Container class="javax.swing.JPanel" name="jPanel3">
      <Properties>
        <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
          <Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
            <TitledBorder title="Visualization settings">
              <ResourceString PropertyName="titleX" bundle="cz/fidentis/analyst/gui/task/distance/Bundle.properties" key="DistancePanel.jPanel3.border.title" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
              <Font PropertyName="font" name="Ubuntu" size="15" style="1"/>
            </TitledBorder>
          </Border>
        </Property>
      </Properties>

      <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="jLabel4" min="-2" max="-2" attributes="0"/>
                  <EmptySpace max="-2" attributes="0"/>
                  <Component id="jComboBox1" pref="158" max="32767" attributes="0"/>
                  <EmptySpace max="-2" attributes="0"/>
                  <Component id="jLabel3" min="-2" max="-2" attributes="0"/>
                  <EmptySpace max="-2" attributes="0"/>
                  <Component id="jComboBox4" min="-2" max="-2" attributes="0"/>
                  <EmptySpace min="-2" pref="49" 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="3" attributes="0">
                      <Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
                      <Component id="jComboBox4" alignment="3" min="-2" max="-2" attributes="0"/>
                      <Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/>
                      <Component id="jComboBox1" alignment="3" min="-2" max="-2" attributes="0"/>
                  </Group>
                  <EmptySpace max="32767" attributes="0"/>
              </Group>
          </Group>
        </DimensionLayout>
      </Layout>
      <SubComponents>
        <Component class="javax.swing.JLabel" name="jLabel4">
          <Properties>
            <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
              <Font name="Ubuntu" size="15" style="0"/>
            </Property>
            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
              <ResourceString bundle="cz/fidentis/analyst/gui/task/distance/Bundle.properties" key="DistancePanel.jLabel4.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
            </Property>
          </Properties>
        </Component>
        <Component class="javax.swing.JComboBox" name="jComboBox1">
          <Properties>
            <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
              <StringArray count="0"/>
            </Property>
          </Properties>
          <AuxValues>
            <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;String&gt;"/>
          </AuxValues>
        </Component>
        <Component class="javax.swing.JLabel" name="jLabel3">
          <Properties>
            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
              <ResourceString bundle="cz/fidentis/analyst/gui/task/distance/Bundle.properties" key="DistancePanel.jLabel3.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
            </Property>
          </Properties>
        </Component>
        <Component class="javax.swing.JComboBox" name="jComboBox4">
          <Properties>
            <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
              <StringArray count="4">
                <StringItem index="0" value="Item 1"/>
                <StringItem index="1" value="Item 2"/>
                <StringItem index="2" value="Item 3"/>
                <StringItem index="3" value="Item 4"/>
              </StringArray>
            </Property>
          </Properties>
          <AuxValues>
            <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;String&gt;"/>
          </AuxValues>
        </Component>
      </SubComponents>
    </Container>
    <Container class="javax.swing.JPanel" name="jPanel4">
      <Properties>
        <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
          <Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
            <TitledBorder title="Help">
              <ResourceString PropertyName="titleX" bundle="cz/fidentis/analyst/gui/task/distance/Bundle.properties" key="DistancePanel.jPanel4.border.title" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
            </TitledBorder>
          </Border>
        </Property>
      </Properties>

      <Layout>
        <DimensionLayout dim="0">
          <Group type="103" groupAlignment="0" attributes="0">
              <Component id="infoLinkButton1" alignment="0" pref="83" max="32767" attributes="0"/>
          </Group>
        </DimensionLayout>
        <DimensionLayout dim="1">
          <Group type="103" groupAlignment="0" attributes="0">
              <Component id="infoLinkButton1" alignment="0" max="32767" attributes="0"/>
          </Group>
        </DimensionLayout>
      </Layout>
      <SubComponents>
        <Component class="cz.fidentis.analyst.gui.elements.InfoLinkButton" name="infoLinkButton1">
          <Properties>
            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
              <ResourceString bundle="cz/fidentis/analyst/gui/task/distance/Bundle.properties" key="DistancePanel.infoLinkButton1.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
            </Property>
          </Properties>
        </Component>
      </SubComponents>
    </Container>
  </SubComponents>
</Form>
+97 −55

File changed.

Preview size limit exceeded, changes collapsed.

Loading