org.uberfire.workbench.model.menu.MenuItem.addEnabledStateChangeListener()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(5.6k)|赞(0)|评价(0)|浏览(122)

本文整理了Java中org.uberfire.workbench.model.menu.MenuItem.addEnabledStateChangeListener()方法的一些代码示例,展示了MenuItem.addEnabledStateChangeListener()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MenuItem.addEnabledStateChangeListener()方法的具体详情如下:
包路径:org.uberfire.workbench.model.menu.MenuItem
类名称:MenuItem
方法名:addEnabledStateChangeListener

暂无

代码示例

代码示例来源:origin: kiegroup/appformer

private void setupEnableDisableMenuItem(final MenuItem menuItem) {
    menuItem.addEnabledStateChangeListener(new EnabledStateChangeListener() {
      @Override
      public void enabledStateChanged(final boolean enabled) {
        view.enableMenuItem(getMenuItemId(menuItem),
                  enabled);
      }
    });
  }
}));

代码示例来源:origin: kiegroup/appformer

private void setupEnableDisableContextMenuItem(final MenuItem menuItem) {
    menuItem.addEnabledStateChangeListener(new EnabledStateChangeListener() {
      @Override
      public void enabledStateChanged(final boolean enabled) {
        view.enableContextMenuItem(getMenuItemId(menuItem),
                     enabled);
      }
    });
  }
}));

代码示例来源:origin: kiegroup/appformer

private void setupEnableDisableContextMenuItem(final MenuItem menuItem) {
    menuItem.addEnabledStateChangeListener(enabled -> presenter.enableContextMenuItem(WorkbenchBaseMenuUtils.getMenuItemId(menuItem),
                                             enabled));
  }
}

代码示例来源:origin: kiegroup/appformer

protected void setupEnableDisableMenuItem(final MenuItem menuItem) {
    menuItem.addEnabledStateChangeListener(enabled -> presenter.enableMenuItem(WorkbenchBaseMenuUtils.getMenuItemId(menuItem),
                                          enabled));
  }
}

代码示例来源:origin: org.uberfire/uberfire-workbench-client-views-patternfly

/**
   * Sets up the enabled/disabled state of the view widget, and installs a listener on the model to keep the
   * widget's enabled state in sync with it.
   * @param model the description of the menu item to get the current enabled state from, and to subscibe to for
   * future changes.
   * @param view the widget that provides a view of the given model.
   */
  protected void setupEnableDisable(final MenuItem model,
                   final AnchorListItem view) {
    view.setEnabled(model.isEnabled());
    model.addEnabledStateChangeListener(new EnabledStateChangeListener() {
      @Override
      public void enabledStateChanged(final boolean enabled) {
        view.setEnabled(enabled);
      }
    });
  }
}

代码示例来源:origin: kiegroup/appformer

/**
   * Sets up the enabled/disabled state of the view widget, and installs a listener on the model to keep the
   * widget's enabled state in sync with it.
   * @param model the description of the menu item to get the current enabled state from, and to subscibe to for
   * future changes.
   * @param view the widget that provides a view of the given model.
   */
  protected void setupEnableDisable(final MenuItem model,
                   final AnchorListItem view) {
    view.setEnabled(model.isEnabled());
    model.addEnabledStateChangeListener(new EnabledStateChangeListener() {
      @Override
      public void enabledStateChanged(final boolean enabled) {
        view.setEnabled(enabled);
      }
    });
  }
}

代码示例来源:origin: org.uberfire/uberfire-workbench-client-views-bs2

Widget makeNavLink( final MenuItem item ) {
  final NavLink gwtItem = new NavLink( item.getCaption() ) {{
    setDisabled( !item.isEnabled() );
  }};
  item.addEnabledStateChangeListener( new EnabledStateChangeListener() {
    @Override
    public void enabledStateChanged( final boolean enabled ) {
      gwtItem.setDisabled( !enabled );
    }
  } );
  return gwtItem;
}

代码示例来源:origin: org.uberfire/uberfire-workbench-client-views-bs2

Widget makeMenuItemCommand( final MenuItem item ) {
  final MenuItemCommand cmdItem = (MenuItemCommand) item;
  final Widget gwtItem;
  gwtItem = new NavLink( cmdItem.getCaption() ) {{
    setDisabled( !item.isEnabled() );
    addClickHandler( new ClickHandler() {
      @Override
      public void onClick( final ClickEvent event ) {
        cmdItem.getCommand().execute();
      }
    } );
  }};
  item.addEnabledStateChangeListener( new EnabledStateChangeListener() {
    @Override
    public void enabledStateChanged( final boolean enabled ) {
      ( (NavLink) gwtItem ).setDisabled( !enabled );
    }
  } );
  return gwtItem;
}

代码示例来源:origin: org.uberfire/uberfire-workbench-client-views-bs2

Widget makeMenuItemCommand( final MenuItem item ) {
  final MenuItemCommand cmdItem = (MenuItemCommand) item;
  final Widget gwtItem;
  gwtItem = new NavLink( cmdItem.getCaption() ) {{
    setDisabled( !item.isEnabled() );
    addClickHandler( new ClickHandler() {
      @Override
      public void onClick( final ClickEvent event ) {
        cmdItem.getCommand().execute();
      }
    } );
  }};
  item.addEnabledStateChangeListener( new EnabledStateChangeListener() {
    @Override
    public void enabledStateChanged( final boolean enabled ) {
      ( (NavLink) gwtItem ).setDisabled( !enabled );
    }
  } );
  return gwtItem;
}

代码示例来源:origin: org.uberfire/uberfire-workbench-client-views-bs2

Widget makeMenuItemCommand( final MenuItem item ) {
  final MenuItemCommand cmdItem = (MenuItemCommand) item;
  final Widget gwtItem;
  gwtItem = new NavLink( cmdItem.getCaption() ) {{
    setDisabled( !item.isEnabled() );
    addClickHandler( new ClickHandler() {
      @Override
      public void onClick( final ClickEvent event ) {
        cmdItem.getCommand().execute();
      }
    } );
  }};
  item.addEnabledStateChangeListener( new EnabledStateChangeListener() {
    @Override
    public void enabledStateChanged( final boolean enabled ) {
      ( (NavLink) gwtItem ).setDisabled( !enabled );
    }
  } );
  return gwtItem;
}

代码示例来源:origin: org.uberfire/uberfire-workbench-client-views-bs2

item.addEnabledStateChangeListener( new EnabledStateChangeListener() {
  @Override
  public void enabledStateChanged( final boolean enabled ) {
item.addEnabledStateChangeListener( new EnabledStateChangeListener() {
  @Override
  public void enabledStateChanged( final boolean enabled ) {

代码示例来源:origin: kiegroup/appformer

item.addEnabledStateChangeListener(new EnabledStateChangeListener() {
  @Override
  public void enabledStateChanged(final boolean enabled) {
item.addEnabledStateChangeListener(new EnabledStateChangeListener() {
  @Override
  public void enabledStateChanged(final boolean enabled) {

代码示例来源:origin: org.uberfire/uberfire-simple-docks-client

item.addEnabledStateChangeListener(new EnabledStateChangeListener() {
  @Override
  public void enabledStateChanged(final boolean enabled) {
item.addEnabledStateChangeListener(new EnabledStateChangeListener() {
  @Override
  public void enabledStateChanged(final boolean enabled) {

相关文章