Flowable 6.6.0 Eclipse设计器 - 5.扩展Flowable设计器 - 5.1定制调色板(6)

Flowable 6.6.0 用户指南相关文档下载

有关Flowable文档的其他资料,参见:

《Flowable文档大全》


《Flowable 6.6.0 Eclipse设计器》

1 安装(Installation
2 Flowable 设计器编辑器特性(Flowable Designer editor features)
3 Flowable设计器BPMN 特性(Flowable Designer BPMN features)
4 Flowable设计器部署特性(Flowable Designer deployment features)
5 扩展Flowable设计器(Extending Flowable Designer)

5 扩展Flowable设计器(Extending Flowable Designer)

5.1 定制调色板(Customizing the palette)

5.1.6 禁用调色板的缺省形状(Disabling default shapes in the palette)

This customization requires you to include a class in your extension that implements the DefaultPaletteCustomizer interface. You should not implement this interface directly, but subclass the AbstractDefaultPaletteCustomizer base class. Currently, this class provides no functionality, but future versions of the DefaultPaletteCustomizer interface will offer more capabilities for which this base class will provide some sensible defaults, so it’s best to subclass it to be sure your extension will be compatible with future releases.

此自定义要求您在实现DefaultPaletteCustomizer接口的扩展(extension)中包含一个类。不应直接实现此接口,而应作为AbstractDefaultPaletteCustomizer基类的子类。目前,这个类没有提供任何功能,但是DefaultPaletteCustomizer接口的未来版本将提供更多的功能,这个基类将为这些功能提供一些合理的默认值,因此最好作为其子类,以确保您的扩展与将来的版本兼容。

Extending the AbstractDefaultPaletteCustomizer class requires you to implement one method, disablePaletteEntries(), from which you must return a list of PaletteEntry values. For each of the default shapes, you can disable it by adding its corresponding PaletteEntry value to your list. Note that if you remove shapes from the default set and there are no remaining shapes in a particular drawer, that drawer will be removed from the palette in its entirety. If you wish to disable all of the default shapes, you only need to add PaletteEntry.ALL to your result. As an example, the code below disables the Manual task and Script task shapes in the palette.

扩展AbstractDefaultPaletteCustomizer类需要实现一个方法:disablePaletteEntries(),从该方法必须返回PaletteEntry值的列表。对于每个默认形状,可以通过将其相应的PaletteEntry值添加到列表中来禁用它。请注意,如果从默认设置集中删除形状,并且特定抽屉中没有剩余形状,则该抽屉将从调色板中全部删除。如果要禁用所有默认形状,只需添加PaletteEntry.ALL到你的结果(result)。例如,下面的代码禁用调色板中的手动任务和脚本任务形状。

public class MyPaletteCustomizer extends AbstractDefaultPaletteCustomizer {

  @Override
  public List<PaletteEntry> disablePaletteEntries() {
    List<PaletteEntry> result = new ArrayList<PaletteEntry>();
    result.add(PaletteEntry.MANUAL_TASK);
    result.add(PaletteEntry.SCRIPT_TASK);
    return result;
  }

}

The result of applying this extension is shown in the image below. As you can see, the manual task and script task shapes are no longer available in the Tasks drawer.

应用此扩展的结果如下图所示。如您所见,手动任务和脚本任务形状在任务抽屉中不再可用。
在这里插入图片描述
To disable all of the default shapes, you could use something similar to the code below.

要禁用所有默认形状,可以使用类似于下面代码的代码。

public class MyPaletteCustomizer extends AbstractDefaultPaletteCustomizer {

  @Override
  public List<PaletteEntry> disablePaletteEntries() {
    List<PaletteEntry> result = new ArrayList<PaletteEntry>();
    result.add(PaletteEntry.ALL);
    return result;
  }

}

The result will look like this (notice that the drawers the default shapes were in are no longer in the palette):

结果如下所示(请注意,默认形状所在的抽屉不再位于调色板中):
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

月满闲庭

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值