Package org.openbp.jaspira.propertybrowser

Examples of org.openbp.jaspira.propertybrowser.PropertyBrowser


        initializePropertyBrowser();
      }
      else if (event.eventType == WizardEvent.FINISH || event.eventType == WizardEvent.NEXT || event.eventType == WizardEvent.BACK)
      {
        boolean failed = false;
        PropertyBrowser oe = getPropertyBrowser();
        if (!oe.saveObject())
        {
          failed = true;
          if (event.eventType == WizardEvent.BACK)
          {
            // We will ignore error if the user hit the back button
View Full Code Here


    private void initializePropertyBrowser()
    {
      GeneratorContext context = getContext();
      Item item = context.getItem();

      PropertyBrowser oe = getPropertyBrowser();
      oe.setObjectModified(false);
      oe.setOriginalObject(context.getOriginalItem());

      try
      {
        if (context.isNewItem() && !context.isItemSaved())
        {
          // Make the object name editable if it's a new item

          // Create the property browser tree and clone it
          ObjectNode rootNode = NodeStructureMgr.getInstance().createEditorStructureFor(item.getClass());

          // Set the read-only property of the 'Name' property to false
          changeReadOnlyModeOfPropertyDescriptor(rootNode, "Name", false);
          // TODO Feature 3 Allow for selecting the model for new items; implement setOwningModelQualifier
          // changeReadOnlyModeOfPropertyDescriptor(rootNode, "OwningModelQualifier", false);

          // Set the item; we consider it new (needed for the ModelObjectValidator, which
          // checks name uniqueness) only if the item has not been saved yet.
          boolean newFlag = !context.isItemSaved();
          oe.setObject(item, newFlag, rootNode);
        }
        else
        {
          oe.setObject(item, false);
        }
      }
      catch (XMLDriverException e)
      {
        ExceptionUtil.printTrace(e);
View Full Code Here

    /**
     * Clears the property browser.
     */
    private void clearPropertyBrowser()
    {
      PropertyBrowser oe = getPropertyBrowser();
      try
      {
        // Clear the property browser for later use
        oe.setObjectModified(false);
        oe.setObject(null, false);
        oe.setOriginalObject(null);
      }
      catch (XMLDriverException e)
      {
        // Never happens
      }
View Full Code Here

    // Customize the property page
    JaspiraWizardObjectPage objectPage = (JaspiraWizardObjectPage) wizard.getPage("property");

    // Constrain the visible element
    PropertyBrowser oe = objectPage.getPropertyBrowser();
    oe.setVisibleMembers(typeVisibleProperties);

    // Add the 'Addd member' button below the property browser
    JPanel buttonPanel = createButtonPanel();
    buttonPanel.add(BorderLayout.CENTER, createAddButton(context, objectPage));
    objectPage.getContentPanel().add(buttonPanel, BorderLayout.SOUTH);
View Full Code Here

   *
   * @param page Page that contains the property browser
   */
  public static void clearPropertyBrowser(JaspiraWizardObjectPage page)
  {
    PropertyBrowser oe = page.getPropertyBrowser();
    try
    {
      // Clear the property browser for later use
      oe.setObjectModified(false);
      oe.setObject(null, false);
      oe.setOriginalObject(null);
    }
    catch (XMLDriverException e)
    {
      // Never happens
    }
View Full Code Here

     */
    public MemberPage(final GeneratorWizard wizard)
    {
      super(wizard);

      PropertyBrowser oe = getPropertyBrowser();
      oe.setVisibleMembers(memberVisibleProperties);

      canFinish = true;

      // Add the 'Add member' and 'Remove member' buttons below the property browser
      JPanel buttonPanel = new JPanel();
View Full Code Here

        {
          // Current member exists
          member = (DataMember) memberList.get(currentMemberIndex);
        }

        PropertyBrowser oe = getPropertyBrowser();

        // Set the item; note that the 'new' flag must be set to true
        // in order for the ModelObjectValidator properly check name uniqueness.
        try
        {
          oe.setObject(member, true);
        }
        catch (XMLDriverException e)
        {
          // Doesn't happen
        }
        catch (CloneNotSupportedException e)
        {
          // Doesn't happen
        }

        // Make the object modified so validation will occur when pressing 'Next' or 'Finish'
        oe.setObjectModified(true);
        oe.setOriginalObject(member);

        // Update the status of the 'Next' button
        canMoveForward = memberList != null && currentMemberIndex < memberList.size() - 1;
        updateNavigator();
      }
      else if (event.eventType == WizardEvent.FINISH || event.eventType == WizardEvent.NEXT || event.eventType == WizardEvent.BACK)
      {
        PropertyBrowser oe = getPropertyBrowser();
        if (!oe.saveObject())
        {
          // Save failed, don't continue
          event.cancel = true;
          return;
        }
View Full Code Here

TOP

Related Classes of org.openbp.jaspira.propertybrowser.PropertyBrowser

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.