Package com.projity.pm.graphic

Examples of com.projity.pm.graphic.ChangeAwareTextField


      if (zoom<box.getMinZoom()) return;
      JComponent component;
      if(box.getFieldId()==null) component=new JLabel(Messages.getString(box.getTextId()));
      else{
        if (editor&&!box.getField().isReadOnly()){
          component=new ChangeAwareTextField();
          component.setBorder(null);
          //component.setOpaque(false);
        }else component=new JLabel();
       
        //if (box.getRow()==1&&!editor) ((JLabel)component).setHorizontalAlignment(SwingConstants.CENTER);
View Full Code Here


        if (comp instanceof KeyboardFocusable)
          ((KeyboardFocusable)comp).selectAll(e == null);

        else if (comp instanceof ChangeAwareTextField){
            ChangeAwareTextField text=((ChangeAwareTextField)comp);
            if (e==null){
              text.selectAll();
            }
            else if (e instanceof MouseEvent){
              if (nameCell){
                MouseEvent me=(MouseEvent)e;
                Rectangle bounds=text.getBounds(null);
                Rectangle cell=getCellRect(row,column,false);
                bounds.setFrame(cell.getX()+bounds.getX(),cell.getY()+bounds.getY(),bounds.getWidth(),bounds.getHeight());
                  if(bounds.contains(me.getPoint())){
                       text.selectAllOnNextCaretUpdate(); //to avoid diselection when the cell is clicked
                  }
                 else{ //because if it's outside there's no caret update
                   text.requestFocus();
                   text.selectAll();
                 }
              }else
                text.selectAllOnNextCaretUpdate(); //to avoid diselection when the cell is clicked
            }
            text.resetChange();
          }
        }
      return b;
    }
View Full Code Here

  protected Format useFormat = null;
  /**
   *
   */
  public TimeSimpleEditor() {
    super(new ChangeAwareTextField());
    component = (ChangeAwareTextField) getComponent();
    clazz = String.class;
  }
View Full Code Here

  JTable cachedTable = null;
  /**
   *
   */
  public SimpleEditor() {
    super(new ChangeAwareTextField());
    component = (ChangeAwareTextField) getComponent();
    component.setFocusLostBehavior(JFormattedTextField.COMMIT_OR_REVERT); // don't now if this is needed
   
    // this will make the enter key work properly. Otherwise, the enter does not go to the next line
    component.getInputMap(JComponent.WHEN_FOCUSED).getParent().getParent().getParent().remove(KeyStroke.getKeyStroke(10, 0));
View Full Code Here

TOP

Related Classes of com.projity.pm.graphic.ChangeAwareTextField

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.