Package org.nasutekds.guitools.controlpanel.ui.components

Examples of org.nasutekds.guitools.controlpanel.ui.components.BasicExpander


      add(progressBar, gbc);

      gbc.insets.top = 10;
      gbc.insets.bottom = 5;
      details =
        new BasicExpander(INFO_CTRL_PANEL_PROGRESS_DIALOG_DETAILS_LABEL.get());
      gbc.gridy ++;
      add(details, gbc);

      logs = Utilities.makeHtmlPane(FAKE_PROGRESS_TEXT,
          ColorAndFontConstants.progressFont);
View Full Code Here


    gbc.gridx = 0;
    gbc.gridy = 0;
    gbc.anchor = GridBagConstraints.NORTHWEST;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    int labelInsetLeft = 15;
    final BasicExpander expander =
      new BasicExpander(INFO_CTRL_PANEL_DATA_INCLUSION_OPTIONS.get());
    panel.add(expander, gbc);

    gbc.gridy ++;
    lDnsToInclude =
      Utilities.createPrimaryLabel(INFO_CTRL_PANEL_DNS_TO_INCLUDE.get());
    gbc.insets.left = labelInsetLeft;
    gbc.anchor = GridBagConstraints.NORTHWEST;
    gbc.insets.top = 10;
    gbc.gridwidth = 1;
    gbc.weightx = 0.0;
    panel.add(lDnsToInclude, gbc);

    gbc.gridx = 1;
    gbc.weightx = 1.0;
    gbc.insets.left = 10;
    dnsToInclude = Utilities.createTextArea(Message.EMPTY, 5, 25);
    final JScrollPane scrollDns = Utilities.createScrollPane(dnsToInclude);
    panel.add(scrollDns, gbc);
    lDnsToInclude.setLabelFor(dnsToInclude);

    gbc.insets.top = 2;
    gbc.gridy ++;
    final JLabel lDnsExplanation = Utilities.createInlineHelpLabel(
        INFO_CTRL_PANEL_SEPARATE_DNS_LINE_BREAK.get());
    panel.add(lDnsExplanation, gbc);

    gbc.gridy ++;
    gbc.gridx = 0;
    gbc.weightx = 0.0;
    lAttributesToInclude = Utilities.createPrimaryLabel(
        INFO_CTRL_PANEL_ATTRIBUTES_TO_INCLUDE.get());
    gbc.insets.left = labelInsetLeft;
    gbc.anchor = GridBagConstraints.NORTHWEST;
    gbc.insets.top = 10;
    gbc.gridwidth = 1;
    panel.add(lAttributesToInclude, gbc);

    gbc.gridx = 1;
    gbc.weightx = 1.0;
    gbc.insets.left = 10;
    gbc.weightx = 1.0;
    attributesToInclude = Utilities.createMediumTextField();
    panel.add(attributesToInclude, gbc);
    lAttributesToInclude.setLabelFor(attributesToInclude);

    gbc.insets.top = 2;
    gbc.gridy ++;
    final JLabel lAttributesExplanation = Utilities.createInlineHelpLabel(
        INFO_CTRL_PANEL_SEPARATE_ATTRIBUTES_COMMA.get());
    panel.add(lAttributesExplanation, gbc);

    gbc.gridy ++;
    gbc.gridx = 0;
    lInclusionFilter = Utilities.createPrimaryLabel(
        INFO_CTRL_PANEL_INCLUSION_FILTER.get());
    gbc.insets.left = labelInsetLeft;
    gbc.anchor = GridBagConstraints.NORTHWEST;
    gbc.insets.top = 10;
    gbc.gridwidth = 1;
    gbc.weightx = 0.0;
    panel.add(lInclusionFilter, gbc);

    gbc.gridx = 1;
    gbc.weightx = 1.0;
    gbc.insets.left = 10;
    inclusionFilter = Utilities.createMediumTextField();
    panel.add(inclusionFilter, gbc);
    lInclusionFilter.setLabelFor(inclusionFilter);

    addExtraComponents(panel, extraComponentLabels, extraComponents, gbc,
        labelInsetLeft);

    ChangeListener changeListener = new ChangeListener()
    {
      /**
       * {@inheritDoc}
       */
      public void stateChanged(ChangeEvent e)
      {
        lDnsToInclude.setVisible(expander.isSelected());
        scrollDns.setVisible(expander.isSelected());
        lDnsExplanation.setVisible(expander.isSelected());
        lAttributesToInclude.setVisible(expander.isSelected());
        attributesToInclude.setVisible(expander.isSelected());
        lAttributesExplanation.setVisible(expander.isSelected());
        lInclusionFilter.setVisible(expander.isSelected());
        inclusionFilter.setVisible(expander.isSelected());
        expanderStateChanged(expander, extraComponentLabels, extraComponents);
      }
    };
    expander.addChangeListener(changeListener);
    expander.setSelected(false);
    changeListener.stateChanged(null);

    return panel;
  }
View Full Code Here

    gbc.gridx = 0;
    gbc.gridy = 0;
    gbc.anchor = GridBagConstraints.NORTHWEST;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    int labelInsetLeft = 15;
    final BasicExpander expander =
      new BasicExpander(INFO_CTRL_PANEL_DATA_EXCLUSION_OPTIONS.get());
    panel.add(expander, gbc);

    gbc.gridy ++;
    lDnsToExclude =
      Utilities.createPrimaryLabel(INFO_CTRL_PANEL_DNS_TO_EXCLUDE.get());
    gbc.insets.left = labelInsetLeft;
    gbc.anchor = GridBagConstraints.NORTHWEST;
    gbc.insets.top = 10;
    gbc.gridwidth = 1;
    gbc.weightx = 0.0;
    panel.add(lDnsToExclude, gbc);

    gbc.gridx = 1;
    gbc.weightx = 1.0;
    gbc.insets.left = 10;
    dnsToExclude = Utilities.createTextArea(Message.EMPTY, 5, 0);
    final JScrollPane scrollDns = Utilities.createScrollPane(dnsToExclude);
    lDnsToExclude.setLabelFor(dnsToExclude);
    panel.add(scrollDns, gbc);

    gbc.insets.top = 2;
    gbc.gridy ++;
    final JLabel lDnsExplanation = Utilities.createInlineHelpLabel(
        INFO_CTRL_PANEL_SEPARATE_DNS_LINE_BREAK.get());
    panel.add(lDnsExplanation, gbc);

    gbc.gridy ++;
    gbc.gridx = 0;
    gbc.weightx = 0.0;
    lAttributesToExclude = Utilities.createPrimaryLabel(
        INFO_CTRL_PANEL_ATTRIBUTES_TO_EXCLUDE.get());
    gbc.insets.left = labelInsetLeft;
    gbc.anchor = GridBagConstraints.NORTHWEST;
    gbc.insets.top = 10;
    gbc.gridwidth = 1;
    panel.add(lAttributesToExclude, gbc);

    gbc.gridx = 1;
    gbc.weightx = 1.0;
    gbc.insets.left = 10;
    gbc.weightx = 1.0;
    attributesToExclude = Utilities.createTextField();
    panel.add(attributesToExclude, gbc);
    lAttributesToExclude.setLabelFor(dnsToExclude);

    gbc.insets.top = 2;
    gbc.gridy ++;
    final JLabel lAttributesExplanation = Utilities.createInlineHelpLabel(
        INFO_CTRL_PANEL_SEPARATE_ATTRIBUTES_COMMA.get());
    panel.add(lAttributesExplanation, gbc);
    lAttributesExplanation.setLabelFor(dnsToExclude);

    gbc.gridy ++;
    gbc.gridx = 0;
    lExclusionFilter = Utilities.createPrimaryLabel(
        INFO_CTRL_PANEL_EXCLUSION_FILTER.get());
    gbc.insets.left = labelInsetLeft;
    gbc.anchor = GridBagConstraints.NORTHWEST;
    gbc.insets.top = 10;
    gbc.gridwidth = 1;
    gbc.weightx = 0.0;
    panel.add(lExclusionFilter, gbc);

    gbc.gridx = 1;
    gbc.weightx = 1.0;
    gbc.insets.left = 10;
    exclusionFilter = Utilities.createTextField();
    panel.add(exclusionFilter, gbc);
    lExclusionFilter.setLabelFor(exclusionFilter);

    addExtraComponents(panel, extraComponentLabels, extraComponents, gbc,
        labelInsetLeft);

    ChangeListener changeListener = new ChangeListener()
    {
      /**
       * {@inheritDoc}
       */
      public void stateChanged(ChangeEvent e)
      {
        lDnsToExclude.setVisible(expander.isSelected());
        scrollDns.setVisible(expander.isSelected());
        lDnsExplanation.setVisible(expander.isSelected());
        lAttributesToExclude.setVisible(expander.isSelected());
        attributesToExclude.setVisible(expander.isSelected());
        lAttributesExplanation.setVisible(expander.isSelected());
        lExclusionFilter.setVisible(expander.isSelected());
        exclusionFilter.setVisible(expander.isSelected());
        expanderStateChanged(expander, extraComponentLabels, extraComponents);
      }
    };
    expander.addChangeListener(changeListener);
    expander.setSelected(false);
    changeListener.stateChanged(null);

    return panel;
  }
View Full Code Here

        Utilities.createInlineHelpLabel(
            INFO_CTRL_PANEL_SYNTAX_INLINE_HELP.get())};
    add(basicLabels, basicComps, basicInlineHelp, c, gbc);

    BasicExpander[] expanders = new BasicExpander[] {
        new BasicExpander(INFO_CTRL_PANEL_EXTRA_OPTIONS_EXPANDER.get()),
        new BasicExpander(
            INFO_CTRL_PANEL_ATTRIBUTE_TYPE_OPTIONS_EXPANDER.get()),
        new BasicExpander(INFO_CTRL_PANEL_MATCHING_RULE_OPTIONS_EXPANDER.get())
    };

    Component[][] comps = {{parent, aliases, origin, file},
        {usage, singleValued, nonModifiable, collective, obsolete},
        {approximate, equality, ordering, substring}};
    JLabel[][] labels = {{lSuperior, lAliases, lOrigin, lFile},
        {lUsage, lType, null, null, null},
        {lApproximate, lEquality, lOrdering, lSubstring}};
    JLabel[][] inlineHelps = {{null,
      Utilities.createInlineHelpLabel(
          INFO_CTRL_PANEL_SEPARATED_WITH_COMMAS_HELP.get()), null,
      Utilities.createInlineHelpLabel(
          INFO_CTRL_PANEL_SCHEMA_FILE_ATTRIBUTE_HELP.get(File.separator))},
      {null, null, null, null, null, null},
      {Utilities.createInlineHelpLabel(
          INFO_CTRL_PANEL_MATCHING_RULE_APPROXIMATE_HELP.get()),
        Utilities.createInlineHelpLabel(
            INFO_CTRL_PANEL_MATCHING_RULE_EQUALITY_HELP.get()),
        Utilities.createInlineHelpLabel(
            INFO_CTRL_PANEL_MATCHING_RULE_ORDERING_HELP.get()),
        Utilities.createInlineHelpLabel(
            INFO_CTRL_PANEL_MATCHING_RULE_SUBSTRING_HELP.get())
      }
    };
    for (int i=0; i<expanders.length; i++)
    {
      gbc.gridwidth = 2;
      gbc.gridx = 0;
      gbc.insets.left = 0;
      c.add(expanders[i], gbc);
      final JPanel p = new JPanel(new GridBagLayout());
      gbc.insets.left = 15;
      gbc.gridy ++;
      c.add(p, gbc);
      gbc.gridy ++;
      p.setOpaque(false);

      GridBagConstraints gbc1 = new GridBagConstraints();
      gbc1.fill = GridBagConstraints.HORIZONTAL;
      gbc1.gridy = 0;

      add(labels[i], comps[i], inlineHelps[i], p, gbc1);
      final BasicExpander expander = expanders[i];
      ChangeListener changeListener = new ChangeListener()
      {
        /**
         * {@inheritDoc}
         */
        public void stateChanged(ChangeEvent e)
        {
          p.setVisible(expander.isSelected());
        }
      };
      expander.addChangeListener(changeListener);
      expander.setSelected(false);
      changeListener.stateChanged(null);
    }

    ItemListener itemListener = new ItemListener()
    {
View Full Code Here

    JLabel explanation = Utilities.createInlineHelpLabel(
        INFO_CTRL_PANEL_INHERITED_ATTRIBUTES_HELP.get());
    gbc.insets.top = 3;
    c.add(explanation, gbc);

    final BasicExpander expander = new BasicExpander(
        INFO_CTRL_PANEL_EXTRA_OPTIONS_EXPANDER.get());

    obsolete.setText("Obsolete");

    Component[] comps = {aliases, origin, file, type, obsolete};
    JLabel[] labels = {lAliases, lOrigin, lFile, lType, null};
    JLabel[] inlineHelps = {
        Utilities.createInlineHelpLabel(
            INFO_CTRL_PANEL_SEPARATED_WITH_COMMAS_HELP.get()), null,
        Utilities.createInlineHelpLabel(
            INFO_CTRL_PANEL_SCHEMA_FILE_OBJECTCLASS_HELP.get(File.separator)),
            null, null};
    gbc.gridwidth = 2;
    gbc.gridx = 0;
    gbc.weighty = 0.0;
    gbc.insets.left = 0;
    gbc.gridy ++;
    c.add(expander, gbc);
    final JPanel p = new JPanel(new GridBagLayout());
    gbc.insets.left = 15;
    gbc.gridy ++;
    c.add(p, gbc);
    gbc.gridy ++;
    p.setOpaque(false);

    GridBagConstraints gbc1 = new GridBagConstraints();
    gbc1.fill = GridBagConstraints.HORIZONTAL;
    gbc1.gridy = 0;

    add(labels, comps, inlineHelps, p, gbc1);
    ChangeListener changeListener = new ChangeListener()
    {
      /**
       * {@inheritDoc}
       */
      public void stateChanged(ChangeEvent e)
      {
        p.setVisible(expander.isSelected());
      }
    };
    expander.addChangeListener(changeListener);
    expander.setSelected(false);
    changeListener.stateChanged(null);

    DocumentListener docListener = new DocumentListener()
    {
      /**
 
View Full Code Here

    JLabel explanation = Utilities.createInlineHelpLabel(
        INFO_CTRL_PANEL_INHERITED_ATTRIBUTES_HELP.get());
    gbc.insets.top = 3;
    add(explanation, gbc);

    final BasicExpander expander = new BasicExpander(
        INFO_CTRL_PANEL_EXTRA_OPTIONS_EXPANDER.get());

    obsolete.setText("Obsolete");

    Component[] comps = {aliases, origin, file, type, obsolete};
    JLabel[] labels = {lAliases, lOrigin, lFile, lType, null};
    JLabel[] inlineHelps = {
        Utilities.createInlineHelpLabel(
            INFO_CTRL_PANEL_SEPARATED_WITH_COMMAS_HELP.get()), null,
        Utilities.createInlineHelpLabel(
            INFO_CTRL_PANEL_SCHEMA_FILE_OBJECTCLASS_HELP.get(File.separator)),
            null, null};
    gbc.gridwidth = 2;
    gbc.gridx = 0;
    gbc.weighty = 0.0;
    gbc.insets.left = 0;
    gbc.gridy ++;
    add(expander, gbc);
    final JPanel p = new JPanel(new GridBagLayout());
    gbc.insets.left = 15;
    gbc.gridy ++;
    add(p, gbc);
    gbc.gridy ++;
    p.setOpaque(false);

    GridBagConstraints gbc1 = new GridBagConstraints();
    gbc1.fill = GridBagConstraints.HORIZONTAL;
    gbc1.gridy = 0;

    add(labels, comps, inlineHelps, p, gbc1);
    ChangeListener changeListener = new ChangeListener()
    {
      /**
       * {@inheritDoc}
       */
      public void stateChanged(ChangeEvent e)
      {
        p.setVisible(expander.isSelected());
      }
    };
    expander.addChangeListener(changeListener);
    expander.setSelected(false);
    changeListener.stateChanged(null);

    file.setText(ConfigConstants.FILE_USER_SCHEMA_ELEMENTS);
  }
View Full Code Here

        Utilities.createInlineHelpLabel(
            INFO_CTRL_PANEL_SYNTAX_INLINE_HELP.get())};
    add(basicLabels, basicComps, basicInlineHelp, this, gbc);

    BasicExpander[] expanders = new BasicExpander[] {
        new BasicExpander(INFO_CTRL_PANEL_EXTRA_OPTIONS_EXPANDER.get()),
        new BasicExpander(
            INFO_CTRL_PANEL_ATTRIBUTE_TYPE_OPTIONS_EXPANDER.get()),
        new BasicExpander(INFO_CTRL_PANEL_MATCHING_RULE_OPTIONS_EXPANDER.get())
    };

    Component[][] comps = {{parent, aliases, origin, file},
        {usage, singleValued, nonModifiable, collective, obsolete},
        {approximate, equality, ordering, substring}};
    JLabel[][] labels = {{lParent, lAliases, lOrigin, lFile},
        {lUsage, lType, null, null, null},
        {lApproximate, lEquality, lOrdering, lSubstring}};
    JLabel[][] inlineHelps = {{null,
      Utilities.createInlineHelpLabel(
          INFO_CTRL_PANEL_SEPARATED_WITH_COMMAS_HELP.get()), null,
      Utilities.createInlineHelpLabel(
          INFO_CTRL_PANEL_SCHEMA_FILE_ATTRIBUTE_HELP.get(File.separator))},
      {null, null, null, null, null, null},
      {Utilities.createInlineHelpLabel(
          INFO_CTRL_PANEL_MATCHING_RULE_APPROXIMATE_HELP.get()),
        Utilities.createInlineHelpLabel(
            INFO_CTRL_PANEL_MATCHING_RULE_EQUALITY_HELP.get()),
        Utilities.createInlineHelpLabel(
            INFO_CTRL_PANEL_MATCHING_RULE_ORDERING_HELP.get()),
        Utilities.createInlineHelpLabel(
            INFO_CTRL_PANEL_MATCHING_RULE_SUBSTRING_HELP.get())
      }
    };
    for (int i=0; i<expanders.length; i++)
    {
      gbc.gridwidth = 2;
      gbc.gridx = 0;
      gbc.insets.left = 0;
      add(expanders[i], gbc);
      final JPanel p = new JPanel(new GridBagLayout());
      gbc.insets.left = 15;
      gbc.gridy ++;
      add(p, gbc);
      gbc.gridy ++;
      p.setOpaque(false);

      GridBagConstraints gbc1 = new GridBagConstraints();
      gbc1.fill = GridBagConstraints.HORIZONTAL;
      gbc1.gridy = 0;

      add(labels[i], comps[i], inlineHelps[i], p, gbc1);
      final BasicExpander expander = expanders[i];
      ChangeListener changeListener = new ChangeListener()
      {
        /**
         * {@inheritDoc}
         */
        public void stateChanged(ChangeEvent e)
        {
          p.setVisible(expander.isSelected());
        }
      };
      expander.addChangeListener(changeListener);
      expander.setSelected(false);
      changeListener.stateChanged(null);
    }
    addBottomGlue(gbc);

    ItemListener itemListener = new ItemListener()
View Full Code Here

        gbc.fill = GridBagConstraints.HORIZONTAL;
        add(generalMonitoringComps.get(i), gbc);
      }
    }

    final BasicExpander extraExpander = new BasicExpander(
        INFO_CTRL_PANEL_EXTRA_JAVA_ATTRIBUTES.get());
    gbc.gridwidth = 2;
    gbc.gridx = 0;
    gbc.weighty = 0.0;
    gbc.insets.left = 0;
    gbc.weightx = 1.0;
    gbc.fill = GridBagConstraints.BOTH;
    gbc.gridy ++;
    add(extraExpander, gbc);
    final JPanel extraGeneralPanel = new JPanel(new GridBagLayout());
    gbc.insets.left = 15;
    gbc.gridy ++;
    add(extraGeneralPanel, gbc);
    extraGeneralPanel.setOpaque(false);
    extraGeneralPanel.setVisible(false);

    final BasicExpander memoryExpander = new BasicExpander(
        INFO_CTRL_PANEL_JAVA_MEMORY_ATTRIBUTES.get());
    gbc.gridy ++;
    gbc.insets.left = 0;
    add(memoryExpander, gbc);
    memoryPanel = new JPanel(new GridBagLayout());
    gbc.insets.left = 15;
    gbc.gridy ++;
    add(memoryPanel, gbc);
    memoryPanel.setOpaque(false);
    memoryPanel.setVisible(false);

    GridBagConstraints gbc1 = new GridBagConstraints();
    gbc1.fill = GridBagConstraints.HORIZONTAL;
    gbc1.gridy = 0;
    gbc1.gridx = 0;
    gbc1.gridwidth = 1;

    for (int i=0; i<extraAttributes.size(); i++)
    {
      int index = generalAttributes.indexOf(extraAttributes.get(i));
      JLabel l = Utilities.createPrimaryLabel(
          getLabel(extraAttributes.get(i)));
      gbc1.insets.left = 0;
      gbc1.insets.right = 0;
      gbc1.gridx = 0;
      gbc1.weightx = 0.0;
      gbc1.gridwidth = 1;
      gbc1.fill = GridBagConstraints.NONE;
      boolean isTextComponent =
        generalMonitoringComps.get(index) instanceof JTextComponent;
      if (isTextComponent)
      {
        gbc1.anchor = GridBagConstraints.NORTHWEST;
      }
      else
      {
        gbc1.anchor = GridBagConstraints.WEST;
      }
      extraGeneralPanel.add(l, gbc1);
      gbc1.insets.left = 10;
      gbc1.gridx = 1;
      if (isTextComponent)
      {
        gbc1.insets.right = 10;
        gbc1.weightx = 1.0;
        gbc1.fill = GridBagConstraints.BOTH;
        extraGeneralPanel.add(generalMonitoringComps.get(index), gbc1);
      }
      else
      {
        gbc1.weightx = 1.0;
        gbc1.fill = GridBagConstraints.HORIZONTAL;
        extraGeneralPanel.add(generalMonitoringComps.get(index), gbc1);
      }
      gbc1.insets.top = 10;
      gbc1.gridy ++;
    }
    ChangeListener changeListener = new ChangeListener()
    {
      /**
       * {@inheritDoc}
       */
      public void stateChanged(ChangeEvent e)
      {
        extraGeneralPanel.setVisible(extraExpander.isSelected());
      }
    };
    extraExpander.addChangeListener(changeListener);

    changeListener = new ChangeListener()
    {
      /**
       * {@inheritDoc}
       */
      public void stateChanged(ChangeEvent e)
      {
        memoryPanel.setVisible(memoryExpander.isSelected());
      }
    };
    memoryExpander.addChangeListener(changeListener);

    gbc.gridx = 0;
    gbc.gridy ++;
    gbc.fill = GridBagConstraints.BOTH;
    gbc.weightx = 1.0;
View Full Code Here

TOP

Related Classes of org.nasutekds.guitools.controlpanel.ui.components.BasicExpander

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.