Ejemplo n.º 1
0
 protected void refreshCanvas(FigureCanvas fc) {
   fc.getContents().revalidate();
   fc.getContents().repaint();
   String text = getSelectionText();
   if (text == null) {
     blockFigure.setToolTip(null);
   } else {
     blockFigure.setToolTip(new Label(text));
   }
 }
Ejemplo n.º 2
0
 /**
  * Updates the visual indicators for {@link WorkflowNodeValidationMessage}s and refreshes the
  * graphical representation of this {@link WorkflowNodePart}.
  *
  * @param valid true, if validation yielded not {@link WorkflowNodeValidationMessage}s.
  */
 private void updateValid() {
   final boolean valid = validationSupport.isValid();
   final String errorText = getValidationMessageText(WorkflowNodeValidationMessage.Type.ERROR);
   errorFigure.setVisible(!errorText.isEmpty());
   if (!valid) {
     errorFigure.setToolTip(new Label(errorText));
   }
   final String warningText = getValidationMessageText(WorkflowNodeValidationMessage.Type.WARNING);
   warningFigure.setVisible(!warningText.isEmpty());
   if (!valid) {
     warningFigure.setToolTip(new Label(warningText));
   }
   refresh();
   refreshVisuals();
 }
Ejemplo n.º 3
0
 {
   final int offsetX = 23;
   final int offsetY = 17;
   final int size = 32;
   deprecatedFigure.setBounds(new Rectangle(offsetX, offsetY, size, size));
   deprecatedFigure.setToolTip(new Label(Messages.deprecated));
   deprecatedFigure.setVisible(false);
 }
Ejemplo n.º 4
0
 {
   final int offsetX = 62;
   final int offsetY = 62;
   final int size = 16;
   localFigure.setBounds(new Rectangle(offsetX, offsetY, size, size));
   localFigure.setToolTip(new Label(Messages.localExecutionOnly));
   localFigure.setVisible(false);
 }
  /**
   * initialize the figure
   *
   * @param figure
   */
  protected void initFigure(final IFigure figure) {
    if (figure == null)
      throw new IllegalArgumentException("Editpart does not provide a figure!"); // $NON-NLS-1$
    Set<String> allPropIds = getWidgetModel().getAllPropertyIDs();
    if (allPropIds.contains(AbstractWidgetModel.PROP_COLOR_BACKGROUND))
      figure.setBackgroundColor(
          CustomMediaFactory.getInstance().getColor(getWidgetModel().getBackgroundColor()));

    if (allPropIds.contains(AbstractWidgetModel.PROP_COLOR_FOREGROUND))
      figure.setForegroundColor(
          CustomMediaFactory.getInstance().getColor(getWidgetModel().getForegroundColor()));

    if (allPropIds.contains(AbstractWidgetModel.PROP_FONT))
      figure.setFont(getWidgetModel().getFont().getSWTFont());

    if (allPropIds.contains(AbstractWidgetModel.PROP_VISIBLE))
      figure.setVisible(
          getExecutionMode() == ExecutionMode.RUN_MODE ? getWidgetModel().isVisible() : true);

    if (allPropIds.contains(AbstractWidgetModel.PROP_ENABLED))
      figure.setEnabled(getWidgetModel().isEnabled());

    if (allPropIds.contains(AbstractWidgetModel.PROP_WIDTH)
        && allPropIds.contains(AbstractWidgetModel.PROP_HEIGHT))
      figure.setSize(getWidgetModel().getSize());

    if (allPropIds.contains(AbstractWidgetModel.PROP_BORDER_COLOR)
        && allPropIds.contains(AbstractWidgetModel.PROP_BORDER_STYLE)
        && allPropIds.contains(AbstractWidgetModel.PROP_BORDER_WIDTH))
      figure.setBorder(
          BorderFactory.createBorder(
              getWidgetModel().getBorderStyle(),
              getWidgetModel().getBorderWidth(),
              getWidgetModel().getBorderColor(),
              getWidgetModel().getName()));

    if (allPropIds.contains(AbstractWidgetModel.PROP_TOOLTIP)) {
      if (!getWidgetModel().getTooltip().equals("")) { // $NON-NLS-1$
        tooltipLabel = new TooltipLabel(getWidgetModel());
        figure.setToolTip(tooltipLabel);
      }
    }
  }