コード例 #1
0
  private void registerKeywordSnippet(String keyword, String description) {
    KeywordProposal proposal = new KeywordProposal();
    proposal.keyword = keyword;
    proposal.description = description;
    proposal.image = imageHelper.getImage(keyword + ".png");

    InputStream templateStream = null;
    try {
      templateStream = this.getClass().getResourceAsStream(keyword + ".txt");
      proposal.pattern = IOUtils.toString(templateStream);
    } catch (IOException e) {
      log.error(e);
    } finally {
      IOUtils.closeQuietly(templateStream);
    }

    keywordSnippets.put(keyword, proposal);
  }
 protected void updateEditorImage(XtextEditor xtextEditor) {
   Severity severity = getSeverity(xtextEditor);
   if (severity == previousSeverity) return;
   previousSeverity = severity;
   if (severity != null && severity != Severity.INFO) {
     ImageDescriptor descriptor =
         severity == Severity.ERROR
             ? XtextPluginImages.DESC_OVR_ERROR
             : XtextPluginImages.DESC_OVR_WARNING;
     DecorationOverlayIcon decorationOverlayIcon =
         new DecorationOverlayIcon(defaultImage, descriptor, IDecoration.BOTTOM_LEFT);
     Image decoratedImage = imageHelper.getImage(decorationOverlayIcon);
     if (xtextEditor.getTitleImage() != decoratedImage) {
       scheduleUpdateEditorJob(decoratedImage);
     }
   } else {
     scheduleUpdateEditorJob(defaultImage);
   }
 }
コード例 #3
0
 protected Image _image(EObject e) {
   return imageHelper.getImage("Package.gif");
 }
コード例 #4
0
 protected Image _image(Type e) {
   return imageHelper.getImage("Type.gif");
 }
コード例 #5
0
 protected Image _image(Method e) {
   return imageHelper.getImage("Method.gif");
 }
コード例 #6
0
 protected Image _image(Attribute e) {
   return imageHelper.getImage("Attribute.gif");
 }