Package com.ca.commons.cbutil

Examples of com.ca.commons.cbutil.CBButton


  public audioaccessory() {
    // Set up the accessory.  The file chooser will give us a reasonable size.
    setLayout(new BorderLayout());
    add(fileLabel = new JLabel("  " + CBIntText.get("Select sound file")), BorderLayout.NORTH);
    JPanel p = new JPanel();
    playButton = new CBButton(CBIntText.get("Play"), CBIntText.get("Play this audio clip."));
    stopButton = new CBButton(CBIntText.get("Stop"), CBIntText.get("Stop playing the current audio clip."));
    playButton.setEnabled(false);
    stopButton.setEnabled(false);
    p.add(playButton);
    p.add(stopButton);
    add(p, BorderLayout.CENTER)
View Full Code Here


    display.addln(panel);   
    display.add(tabbedPane);
    display.makeLight();
    display.add(getButtonPanel());

    CBButton btnAttrs = new CBButton(CBIntText.get("Return Attrs"), CBIntText.get("Select Returning Attributes."));
    btnAttrs.addActionListener(new ActionListener(){
        public void actionPerformed(ActionEvent e){
          ArrayList list = CBListSelector.getSelectedValues(jx, build.getAttributes(), CBIntText.get("Select Returning Attributes"), HelpIDs.SEARCH);
          if(list!=null)
            returnAttrs = (String[])list.toArray(new String[list.size()]);
    }});   
View Full Code Here

  */
  public CBPanel getButtonPanel()
  {
    CBPanel panel = new CBPanel();   

    btnMore = new CBButton(CBIntText.get("More"), CBIntText.get("Add a Line to the search window."));
    btnMore.addActionListener(new ActionListener(){
        public void actionPerformed(ActionEvent e){
          if (isFilterValid()) 
          {
            if (tabbedPane.getSelectedIndex()==0//TE: make sure that you are adding rows to the tab that is visible, not to both tabs!
            {
              build.addFilterRow();
            }
            else if (tabbedPane.getSelectedIndex()==1 && buttonCounter<50)
            { 
              join.addFilterRow(getEditButton());  
              buttonCounter++;          //TE: a counter that keeps track of the number of created 'edit' buttons.        
            }
          }
          else
          {
            showMessage(CBIntText.get("There is an error in the filter; there appears to be missing information.\nPlease make sure you have entered all the information for the filter correctly,\nthen try to add more rows."), CBIntText.get("Missing Information"));             
          }
    }});
   
    btnLess = new CBButton(CBIntText.get("Less"), CBIntText.get("Remove a Line from the search window."));
    btnLess.addActionListener(new ActionListener(){
        public void actionPerformed(ActionEvent e){
          if (tabbedPane.getSelectedIndex()==0//TE: make sure that you are removing rows from the tab that is visible, not from both tabs!
          {
            build.removeFilterRow();
          }
          else if (tabbedPane.getSelectedIndex()==1 && buttonCounter>1)
          {    
            buttonCounter--; 
            join.removeFilterRow(btnEdit[buttonCounter]);                   
          }
    }})
   
    btnSave = new CBButton(CBIntText.get("Save"), CBIntText.get("Save this filter."));
    btnSave.addActionListener(new ActionListener(){
        public void actionPerformed(ActionEvent e){
          if (isFilterValid())
            save();
          else
            showMessage(CBIntText.get("The filter cannot be constructed; there appears to be missing information.\nPlease make sure you have entered all the information for the filter correctly."), CBIntText.get("Missing Information"));             
    }});
   
    btnLoad = new CBButton(CBIntText.get("Load"), CBIntText.get("Load a previously saved filter."));
    btnLoad.addActionListener(new ActionListener(){
        public void actionPerformed(ActionEvent e){
          if(tabbedPane.getSelectedIndex()==0)
            loadBuild();
          else if(tabbedPane.getSelectedIndex()==1)
            loadJoin()
          else if(tabbedPane.getSelectedIndex()==2)
            loadText();             
    }});   
   
    btnView = new CBButton(CBIntText.get("View"), CBIntText.get("View this search filter as text."));
    btnView.addActionListener(new ActionListener(){
        public void actionPerformed(ActionEvent e){
          if (!isFilterValid())
            showMessage(CBIntText.get("The filter cannot be constructed; there appears to be missing information.\nPlease make sure you have entered all the information for the filter correctly."), CBIntText.get("Missing Information"));
          else if(tabbedPane.getSelectedIndex()==1 && recursiveFilterCheck(null, join.getFilter(), "View"))   // We don't care about the name of this filter b/c we are just viewing it.
View Full Code Here

  this filter.", and has an action listener that calls the edit method with it's position (or row number).
  *  @return the configured button.
  */
  protected CBButton getEditButton()
  {
    btnEdit[buttonCounter] = new CBButton(CBIntText.get("Edit"), CBIntText.get("Edit this filter."));

    btnEdit[buttonCounter].setPreferredSize(new Dimension(55,21));
    btnEdit[buttonCounter].addActionListener(new ActionListener()
    {
      public void actionPerformed(ActionEvent e)
      {
        CBButton item = (CBButton)e.getSource();

        for(int i=0; i<buttonCounter; i++)
        {
          if (item == btnEdit[i])
              edit(i);
View Full Code Here

        setTitle(CBIntText.get("JXplorer Advanced Options"));

        display = new CBPanel();

        btnApply = new CBButton(CBIntText.get("Apply"), CBIntText.get("Click here to apply the changes"));
        btnApply.addActionListener(new ActionListener()
        {
            public void actionPerformed(ActionEvent e)
            {
                apply();
            }
        });

        btnReset = new CBButton(CBIntText.get("Reset"),
                CBIntText.get("Click here to reset the options"));
        btnReset.addActionListener(new ActionListener()
        {
            public void actionPerformed(ActionEvent e)
            {
                reset();
            }
        });

        btnCancel = new CBButton(CBIntText.get("Cancel"),
                CBIntText.get("Click here to exit Advanced Options"));
        btnCancel.addActionListener(new ActionListener()
        {
            public void actionPerformed(ActionEvent e)
            {
                quit();
            }
        });

        // Creates a new help button with a listener that will open JX help at appropriate location...
        btnHelp = new CBButton(CBIntText.get("Help"), CBIntText.get("Click here for help"));
        CBHelpSystem.useDefaultHelp(btnHelp, HelpIDs.CONFIG_ADVANCED);

        //TE: better way to implement keystroke listening...
        display.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("ENTER"), "enter");
        display.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("ESCAPE"), "escape");
View Full Code Here

TOP

Related Classes of com.ca.commons.cbutil.CBButton

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.