当前位置: 首页>>代码示例>>Java>>正文


Java SVGImage类代码示例

本文整理汇总了Java中org.vectomatic.dom.svg.ui.SVGImage的典型用法代码示例。如果您正苦于以下问题:Java SVGImage类的具体用法?Java SVGImage怎么用?Java SVGImage使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SVGImage类属于org.vectomatic.dom.svg.ui包,在下文中一共展示了SVGImage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: MessageLoader

import org.vectomatic.dom.svg.ui.SVGImage; //导入依赖的package包/类
@AssistedInject
public MessageLoader(@Assisted String message, MessageLoaderResources resources) {
  label.ensureDebugId(MESSAGE_DBG_ID);
  label.setText(message == null || message.isEmpty() ? DEF_MESSAGE : message);
  label.setStyleName(resources.Css().label());
  loader.setStyleName(resources.Css().loader());

  FlowPanel loaderSvg = new FlowPanel();
  loaderSvg.setStyleName(resources.Css().loaderSvg());
  loaderSvg.add(new SVGImage(resources.loader()));

  loader.ensureDebugId(LOADER_DBG_ID);
  loader.add(loaderSvg);
  loader.add(label);

  glass.ensureDebugId(GLASS_DBG_ID);
  glass.add(loader);
  glass.setStyleName(resources.Css().glass());
}
 
开发者ID:eclipse,项目名称:che,代码行数:20,代码来源:MessageLoader.java

示例2: build

import org.vectomatic.dom.svg.ui.SVGImage; //导入依赖的package包/类
@Override
public Element build() {
  Element button = null;
  if (resourceWidget != null) {
    Element buttonImage =
        svgImage != null ? svgImage.getElement() : new SVGImage(res.clipboard()).getElement();
    button =
        buildCopyToClipboardButton(
            resourceWidget.getElement(),
            buttonImage,
            res.clipboardCss().clipboardButton(),
            mimeType,
            promptReadyToCopy,
            promptAfterCopy,
            promptCopyError,
            promptReadyToSelect);
    append(button);
  }
  return button;
}
 
开发者ID:eclipse,项目名称:che,代码行数:21,代码来源:ClipboardButtonBuilderImpl.java

示例3: renderCategoryHeader

import org.vectomatic.dom.svg.ui.SVGImage; //导入依赖的package包/类
private Element renderCategoryHeader(String category) {
  SpanElement categoryElement = Document.get().createSpanElement();
  categoryElement.setClassName(resources.defaultCategoriesListCss().headerText());

  SpanElement iconElement = Document.get().createSpanElement();
  categoryElement.appendChild(iconElement);

  SpanElement textElement = Document.get().createSpanElement();
  categoryElement.appendChild(textElement);
  textElement.setInnerText(category);

  Icon icon = iconRegistry.getIconIfExist(category + ".samples.category.icon");
  if (icon != null) {
    final SVGImage iconSVG = icon.getSVGImage();
    if (iconSVG != null) {
      iconElement.appendChild(iconSVG.getElement());
      return categoryElement;
    }
  }

  return categoryElement;
}
 
开发者ID:eclipse,项目名称:che,代码行数:23,代码来源:CategoriesPageViewImpl.java

示例4: addMaximizeButton

import org.vectomatic.dom.svg.ui.SVGImage; //导入依赖的package包/类
/** Adds button to maximize part stack. */
private void addMaximizeButton() {
  SVGImage maximize = new SVGImage(resources.maximizePart());
  maximize.getElement().setAttribute("name", "workBenchIconMaximize");
  ToolButton maximizeToolButton = new ToolButton(maximize);
  maximizeButton.add(maximizeToolButton);

  maximizeToolButton.addClickHandler(
      new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
          delegate.onToggleMaximize();
        }
      });

  if (maximizeButton.getElement() instanceof elemental.dom.Element) {
    Tooltip.create(
        (elemental.dom.Element) maximizeButton.getElement(),
        PositionController.VerticalAlign.BOTTOM,
        PositionController.HorizontalAlign.MIDDLE,
        localizationConstant.maximizePartStackTitle());
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:24,代码来源:PartStackViewImpl.java

示例5: getCommandTypeIcon

import org.vectomatic.dom.svg.ui.SVGImage; //导入依赖的package包/类
/** Returns the icon for the given command type ID or {@code null} if none. */
@Nullable
public SVGResource getCommandTypeIcon(String typeId) {
  final Optional<CommandType> commandType = commandTypeRegistry.getCommandTypeById(typeId);

  if (commandType.isPresent()) {
    final Icon icon = iconRegistry.getIconIfExist("command.type." + commandType.get().getId());

    if (icon != null) {
      final SVGImage svgImage = icon.getSVGImage();

      if (svgImage != null) {
        return icon.getSVGResource();
      }
    }
  }

  return null;
}
 
开发者ID:eclipse,项目名称:che,代码行数:20,代码来源:CommandUtils.java

示例6: getCommandGoalIcon

import org.vectomatic.dom.svg.ui.SVGImage; //导入依赖的package包/类
/** Returns the icon for the given command goal ID or {@code null} if none. */
@Nullable
public SVGResource getCommandGoalIcon(String goalId) {
  final Optional<CommandGoal> goalOptional = goalRegistry.getPredefinedGoalById(goalId);

  if (goalOptional.isPresent()) {
    final Icon icon = iconRegistry.getIconIfExist("command.goal." + goalOptional.get().getId());

    if (icon != null) {
      final SVGImage svgImage = icon.getSVGImage();

      if (svgImage != null) {
        return icon.getSVGResource();
      }
    }
  }

  return null;
}
 
开发者ID:eclipse,项目名称:che,代码行数:20,代码来源:CommandUtils.java

示例7: ExecuteCommandAction

import org.vectomatic.dom.svg.ui.SVGImage; //导入依赖的package包/类
@Inject
ExecuteCommandAction(
    @Assisted CommandImpl command,
    CommandUtils commandUtils,
    CommandExecutor commandExecutor,
    CommandManager commandManager) {
  super(command.getName());

  this.command = command;
  this.commandExecutor = commandExecutor;
  this.commandManager = commandManager;

  final SVGResource commandIcon = commandUtils.getCommandTypeIcon(command.getType());
  if (commandIcon != null) {
    getTemplatePresentation().setImageElement(new SVGImage(commandIcon).getElement());
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:18,代码来源:ExecuteCommandAction.java

示例8: GoalPopUpGroup

import org.vectomatic.dom.svg.ui.SVGImage; //导入依赖的package包/类
@Inject
GoalPopUpGroup(
    @Assisted String goalId,
    ActionManager actionManager,
    CommandGoalRegistry goalRegistry,
    IconRegistry iconRegistry) {
  super(actionManager);

  this.iconRegistry = iconRegistry;
  commandGoal = goalRegistry.getGoalForId(goalId);

  setPopup(true);

  // set icon
  final SVGResource commandTypeIcon = getCommandGoalIcon();
  if (commandTypeIcon != null) {
    getTemplatePresentation().setImageElement(new SVGImage(commandTypeIcon).getElement());
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:20,代码来源:GoalPopUpGroup.java

示例9: getTitleImage

import org.vectomatic.dom.svg.ui.SVGImage; //导入依赖的package包/类
@Nullable
@Override
public SVGResource getTitleImage() {
  final VirtualFile file = getEditorInput().getFile();

  if (file instanceof CommandFileNode) {
    final CommandImpl command = ((CommandFileNode) file).getData();
    final Icon icon = iconRegistry.getIconIfExist("command.type." + command.getType());

    if (icon != null) {
      final SVGImage svgImage = icon.getSVGImage();

      if (svgImage != null) {
        return icon.getSVGResource();
      }
    }
  }

  return input.getSVGResource();
}
 
开发者ID:eclipse,项目名称:che,代码行数:21,代码来源:CommandEditor.java

示例10: createCloseWidget

import org.vectomatic.dom.svg.ui.SVGImage; //导入依赖的package包/类
/**
 * Create close icon widget that contains an close notification icon.
 *
 * @return {@link SimplePanel} as close icon wrapper
 */
private SimplePanel createCloseWidget() {
  SimplePanel closeWrapper = new SimplePanel();
  SVGImage closeImage = new SVGImage(resources.closeIcon());
  closeImage.addClickHandler(
      new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
          delegate.onClose(notification);
        }
      });
  closeWrapper.add(closeImage);
  closeWrapper.setStyleName(resources.notificationCss().notificationPopupCloseButtonWrapper());
  closeWrapper.ensureDebugId(CLOSE_ICON_DBG_ID + notification.getId());
  return closeWrapper;
}
 
开发者ID:eclipse,项目名称:che,代码行数:21,代码来源:NotificationPopup.java

示例11: createCloseWidget

import org.vectomatic.dom.svg.ui.SVGImage; //导入依赖的package包/类
/**
 * Create close icon widget that contains an close notification icon.
 *
 * @return {@link SimplePanel} as close icon wrapper
 */
private SimplePanel createCloseWidget() {
  SimplePanel closeWrapper = new SimplePanel();
  SVGImage closeImage = new SVGImage(resources.closeIcon());
  closeImage.addClickHandler(
      new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
          delegate.onClose(notification);
        }
      });
  closeWrapper.add(closeImage);
  closeWrapper.setStyleName(resources.notificationCss().notificationCloseButtonWrapper());
  closeImage.ensureDebugId(CLOSE_ICON_DBG_ID + notification.getId());
  return closeWrapper;
}
 
开发者ID:eclipse,项目名称:che,代码行数:21,代码来源:NotificationContainerItem.java

示例12: createCloseElement

import org.vectomatic.dom.svg.ui.SVGImage; //导入依赖的package包/类
private SpanElement createCloseElement(final ProcessTreeNode node) {
  SpanElement closeButton =
      Elements.createSpanElement(resources.getCss().processesPanelCloseButtonForProcess());
  ensureDebugId(closeButton, "close-terminal-node-button");

  SVGImage icon = new SVGImage(partResources.closeIcon());
  closeButton.appendChild((Node) icon.getElement());

  Tooltip.create(closeButton, BOTTOM, MIDDLE, locale.viewCloseProcessOutputTooltip());

  closeButton.addEventListener(
      Event.CLICK,
      event -> {
        if (stopProcessHandler != null) {
          stopProcessHandler.onCloseProcessOutputClick(node);
        }
      },
      true);

  return closeButton;
}
 
开发者ID:eclipse,项目名称:che,代码行数:22,代码来源:TerminalNodeRenderStrategy.java

示例13: createCloseElement

import org.vectomatic.dom.svg.ui.SVGImage; //导入依赖的package包/类
private SpanElement createCloseElement(final ProcessTreeNode node) {
  SpanElement closeButton =
      Elements.createSpanElement(resources.getCss().processesPanelCloseButtonForProcess());
  ensureDebugId(closeButton, "close-command-node-button");

  SVGImage icon = new SVGImage(partResources.closeIcon());
  closeButton.appendChild((Node) icon.getElement());

  Tooltip.create(closeButton, BOTTOM, MIDDLE, locale.viewCloseProcessOutputTooltip());

  closeButton.addEventListener(
      Event.CLICK,
      event -> {
        if (stopProcessHandler != null) {
          stopProcessHandler.onCloseProcessOutputClick(node);
        }
      },
      true);

  return closeButton;
}
 
开发者ID:eclipse,项目名称:che,代码行数:22,代码来源:CommandNodeRenderStrategy.java

示例14: addButton

import org.vectomatic.dom.svg.ui.SVGImage; //导入依赖的package包/类
/**
 * Adds the new radio button to the group.
 *
 * @param label radio button's label
 * @param title radio button's tooltip
 * @param icon radio button's icon
 * @param clickHandler click handler
 */
public void addButton(
    String label, String title, @Nullable SVGResource icon, ClickHandler clickHandler) {
  final RadioButton radioButton = new RadioButton(GROUP_NAME, label);
  radioButton.setTitle(title);
  radioButton.setStyleName(resources.getCSS().button());
  radioButton.addClickHandler(clickHandler);

  final Element radioButtonElement = radioButton.getElement();
  final Node labelNode = radioButtonElement.getLastChild();

  if (icon != null) {
    labelNode.insertFirst(new SVGImage(icon).getElement());
  } else {
    radioButtonElement.getStyle().setWidth(90, PX);
    as(labelNode).getStyle().setWidth(90, PX);
  }

  mainPanel.add(radioButton);
  buttons.add(radioButton);
}
 
开发者ID:eclipse,项目名称:che,代码行数:29,代码来源:RadioButtonGroup.java

示例15: TabWidget

import org.vectomatic.dom.svg.ui.SVGImage; //导入依赖的package包/类
@Inject
public TabWidget(
    PartStackUIResources resources,
    @Assisted String title,
    @Assisted SVGResource icon,
    @Assisted boolean closable) {
  this.resources = resources;
  this.title = title;
  this.icon = MoreObjects.firstNonNull(icon, emptySVGResource());

  initWidget(UI_BINDER.createAndBindUi(this));

  titleLabel.setText(title);

  iconPanel.add(new SVGImage(getIcon()));

  addDomHandler(this, ClickEvent.getType());
  addDomHandler(this, DoubleClickEvent.getType());

  if (closable) {
    closeButton.addDomHandler(
        event -> delegate.onTabClosing(TabWidget.this), ClickEvent.getType());
  } else {
    closeButton.setVisible(false);
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:27,代码来源:TabWidget.java


注:本文中的org.vectomatic.dom.svg.ui.SVGImage类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。