Skip to main content



      Home
Home » Eclipse Projects » Eclipse Scout » No way to hide search Form in SWING??
icon11.gif  No way to hide search Form in SWING?? [message #1577158] Wed, 21 January 2015 13:54 Go to next message
Eclipse UserFriend
Is there no way to hide the search form in a Table Page when using Swing??
I have tried to set minimized and un-ticked 'modular'. Am I missing a config setting? Or is this just not possible?
Re: No way to hide search Form in SWING?? [message #1585445 is a reply to message #1577158] Mon, 26 January 2015 04:13 Go to previous messageGo to next message
Eclipse UserFriend
I think you can hide a form using: IDesktop.removeForm(IForm) and display it again using IDesktop.addForm(IForm).
The model of the form (field values etc.) stays untouched.

The Desktop holds already a reference to to the SearchForm instance. I think that you can use that.

Here some code that hide/display the SearchForm using 2 menus defined in the Desktop form:
@Order(10.0)
public class HideSearchFormMenu extends AbstractExtensibleMenu {

  @Override
  protected String getConfiguredText() {
    return TEXTS.get("HideSearchForm");
  }

  @Override
  protected void execAction() throws ProcessingException {
    IForm searchForm = getPageSearchForm();
    if (searchForm != null) {
      removeForm(searchForm);
    }
  }
}

@Order(20.0)
public class DisplaySearchFormMenu extends AbstractExtensibleMenu {

  @Override
  protected String getConfiguredText() {
    return TEXTS.get("DisplaySearchForm");
  }

  @Override
  protected void execAction() throws ProcessingException {
    IForm searchForm = getPageSearchForm();
    if (searchForm != null) {
      addForm(searchForm);
    }
  }
}


Feel free to continue the discussion if you have additional question or if my answer did not help you.
Re: No way to hide search Form in SWING?? [message #1585916 is a reply to message #1585445] Mon, 26 January 2015 10:07 Go to previous message
Eclipse UserFriend
You Rock Jeremie!! Thanks for your input. I wanted to achieve this with a toggle button so here is how I implemented:

  @Order(10.0)
  public class SearchTool extends AbstractFormToolButton {

    @Override
    protected String getConfiguredIconId() {
      return AbstractIcons.SmartFieldBrowse;
    }

    @Override
    protected String getConfiguredText() {
      return TEXTS.get("Search");
    }

    @Override
    protected boolean getConfiguredToggleAction() {
      return false;
    }

    @Override
    protected void execAction() throws ProcessingException {
      IForm searchForm = getPageSearchForm();
      if (searchForm.isShowing() == true) {
        removeForm(searchForm);
      }
      else {
        addForm(searchForm);
      }
    }
  }
Previous Topic:Button width and style
Next Topic:OutlinePage with Form only?
Goto Forum:
  


Current Time: Tue Jul 01 12:07:44 EDT 2025

Powered by FUDForum. Page generated in 0.02996 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top