Package org.openbp.jaspira.propertybrowser.editor

Examples of org.openbp.jaspira.propertybrowser.editor.PropertyEditor


   *
   * @param event Event
   */
  public void defaultHandlePropertyBrowserEvent(PropertyBrowserEvent event)
  {
    PropertyEditor pe = event.propertyEditor;

    switch (event.eventType)
    {
    case PropertyBrowserEvent.PROPERTY_CHANGED:
      // TODO Feature 4: Later Sometime should go a request for an object lock here...
      fireObjectModified();
      break;

    case PropertyBrowserEvent.FOCUS_GAINED:
      currentPE = pe;

      // We should be able to save the object again if necessary
      saveDisabled = false;

      break;

    case PropertyBrowserEvent.FOCUS_LOST:
      // Save the property value when the focus gets lost

      // First, let the property editor's validator check the value and save the property to the object
      if (!pe.saveProperty())
        return;

      currentPE = null;

      if (objectModified)
View Full Code Here


  {
    public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column)
    {
      if (value instanceof PropertyEditor)
      {
        PropertyEditor pe = (PropertyEditor) value;

        setValue(value);

        JComponent component = pe.getPropertyComponent();
        if (component != null)
        {
          // Configure the component for usage by the property browser
          ((PropertyBrowser) table).configureSubComponent(component);
View Full Code Here

      {
        // Hack: Never show focus or selection in text components
        return super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
      }

      PropertyEditor pe = (PropertyEditor) value;

      JComponent component = pe.getPropertyComponent();
      if (component == null)
      {
        return super.getTableCellRendererComponent(table, null, isSelected, hasFocus, row, column);
      }
View Full Code Here

        propertyDescriptor.setEditorClass(cls);
      }

      // Instantiate and initialize the editor
      PropertyEditor pe = (PropertyEditor) ReflectUtil.instantiate(cls, PropertyEditor.class, "property editor");

      pe.initialize(propertyDescriptor.getEditorParamString());
      pe.setPropertyName(propertyDescriptor.getName());
      pe.setReadonly(propertyDescriptor.isReadOnly());
      pe.setPropertyBrowser(propertyBrowser);

      // Instantiate the property validator if desired
      if (propertyDescriptor.getValidatorClassName() != null)
      {
        cls = propertyDescriptor.getValidatorClass();
        if (cls == null)
        {
          cls = PropertyEditorMgr.getInstance().findPropertyValidator(propertyDescriptor.getValidatorClassName());
          if (cls != null)
          {
            propertyDescriptor.setValidatorClass(cls);
          }
        }

        if (cls != null)
        {
          PropertyValidator pv = (PropertyValidator) ReflectUtil.instantiate(cls, PropertyValidator.class, "property validator");
          pe.setValidator(pv);
        }
      }

      // Provide the object to edit
      if (object != null)
      {
        pe.setObject(object);
      }

      // Make it belong to this node
      pe.setOwner(this);

      propertyEditor = pe;
    }
    catch (Exception e)
    {
View Full Code Here

TOP

Related Classes of org.openbp.jaspira.propertybrowser.editor.PropertyEditor

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.