亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb

首頁 > 學院 > 開發設計 > 正文

Eclipse 修改注釋的 date time 日期時間格式,即${date}變量格式

2019-11-11 04:20:13
字體:
來源:轉載
供稿:網友

http://blog.csdn.net/zollty/article/details/46459621

Eclipse 修改注釋的 date time 日期時間格式,即${date}變量格式

找到eclipse安裝目錄下面的plugins目錄,搜索 org.eclipse.text ,找到一個jar包,例如我找到的jar包為:org.eclipse.text_3.5.300.v20130515-1451.jar然后打開它,找到這個類: org.eclipse.jface.text.templates.GlobalTemplateVariables我們重寫這個類就行了。(可反編譯,也可以找到源碼,源碼下載地址為:http://Git.eclipse.org/c/platform/eclipse.platform.text.git,下載zip包) PS:如果嫌下載源碼包麻煩,我這里貼出這個文件的源碼,可以直接用(注:這個類很簡單,無多少依賴,所有版本通用,無需擔心jar包的版本問題)

[java] view plain copy PRint?/*******************************************************************************  * Copyright (c) 2000, 2006 IBM Corporation and others.  * All rights reserved. This program and the accompanying materials  * are made available under the terms of the Eclipse Public License v1.0  * which accompanies this distribution, and is available at  * http://www.eclipse.org/legal/epl-v10.html  *  * Contributors:  *     IBM Corporation - initial API and implementation  *     Sebastian Davids: sdavids@gmx.de - see bug 25376  *******************************************************************************/  package org.eclipse.jface.text.templates;    import com.ibm.icu.text.DateFormat;  import com.ibm.icu.util.Calendar;    /**  * Global variables which are available in any context.  * <p>  * Clients may instantiate the classes contained within this class.  * </p>  *  * @since 3.0  */  public class GlobalTemplateVariables {        /** The type of the selection variables. */      public static final String SELECTION= "selection"; //$NON-NLS-1$        /**      * The cursor variable determines the cursor placement after template edition.      */      public static class Cursor extends SimpleTemplateVariableResolver {            /** Name of the cursor variable, value= {@value} */          public static final String NAME= "cursor"; //$NON-NLS-1$            /**          * Creates a new cursor variable          */          public Cursor() {              super(NAME, TextTemplateMessages.getString("GlobalVariables.variable.description.cursor")); //$NON-NLS-1$              setEvaluationString(""); //$NON-NLS-1$          }      }        /**      * The Word selection variable determines templates that work on a full      * lines selection.      */      public static class WordSelection extends SimpleTemplateVariableResolver {            /** Name of the word selection variable, value= {@value} */          public static final String NAME= "word_selection"; //$NON-NLS-1$            /**          * Creates a new word selection variable          */          public WordSelection() {              super(NAME, TextTemplateMessages.getString("GlobalVariables.variable.description.selectedWord")); //$NON-NLS-1$          }          protected String resolve(TemplateContext context) {              String selection= context.getVariable(SELECTION);              if (selection == null)                  return ""; //$NON-NLS-1$              return selection;          }      }        /**      * The line selection variable determines templates that work on selected      * lines.      */      public static class LineSelection extends SimpleTemplateVariableResolver {            /** Name of the line selection variable, value= {@value} */          public static final String NAME= "line_selection"; //$NON-NLS-1$            /**          * Creates a new line selection variable          */          public LineSelection() {              super(NAME, TextTemplateMessages.getString("GlobalVariables.variable.description.selectedLines")); //$NON-NLS-1$          }          protected String resolve(TemplateContext context) {              String selection= context.getVariable(SELECTION);              if (selection == null)                  return ""; //$NON-NLS-1$              return selection;          }      }        /**      * The dollar variable inserts an escaped dollar symbol.      */      public static class Dollar extends SimpleTemplateVariableResolver {          /**          * Creates a new dollar variable          */          public Dollar() {              super("dollar", TextTemplateMessages.getString("GlobalVariables.variable.description.dollar")); //$NON-NLS-1$ //$NON-NLS-2$              setEvaluationString("$"); //$NON-NLS-1$          }      }        /**      * The date variable evaluates to the current date.      */      public static class Date extends SimpleTemplateVariableResolver {          /**          * Creates a new date variable          */          public Date() {              super("date", TextTemplateMessages.getString("GlobalVariables.variable.description.date")); //$NON-NLS-1$ //$NON-NLS-2$          }          protected String resolve(TemplateContext context) {              return DateFormat.getDateInstance().format(new java.util.Date());          }      }        /**      * The year variable evaluates to the current year.      */      public static class Year extends SimpleTemplateVariableResolver {          /**          * Creates a new year variable          */          public Year() {              super("year", TextTemplateMessages.getString("GlobalVariables.variable.description.year")); //$NON-NLS-1$ //$NON-NLS-2$          }          protected String resolve(TemplateContext context) {              return Integer.toString(Calendar.getInstance().get(Calendar.YEAR));          }      }        /**      * The time variable evaluates to the current time.      */      public static class Time extends SimpleTemplateVariableResolver {          /**          * Creates a new time variable          */          public Time() {              super("time", TextTemplateMessages.getString("GlobalVariables.variable.description.time")); //$NON-NLS-1$ //$NON-NLS-2$          }            /**          * {@inheritDoc}          */          protected String resolve(TemplateContext context) {              return DateFormat.getTimeInstance().format(new java.util.Date());          }      }        /**      * The user variable evaluates to the current user.      */      public static class User extends SimpleTemplateVariableResolver {          /**          * Creates a new user name variable          */          public User() {              super("user", TextTemplateMessages.getString("GlobalVariables.variable.description.user")); //$NON-NLS-1$ //$NON-NLS-2$          }            /**          * {@inheritDoc}          */          protected String resolve(TemplateContext context) {              return System.getProperty("user.name"); //$NON-NLS-1$          }      }  }  自行拿去修改就行了。改一下Date Time Year就行了,例如,我修改的結果如下:[java] view plain copy print?/*******************************************************************************  * Copyright (c) 2000, 2006 IBM Corporation and others.  * All rights reserved. This program and the accompanying materials  * are made available under the terms of the Eclipse Public License v1.0  * which accompanies this distribution, and is available at  * http://www.eclipse.org/legal/epl-v10.html  *  * Contributors:  *     IBM Corporation - initial API and implementation  *     Sebastian Davids: sdavids@gmx.de - see bug 25376  *******************************************************************************/  package org.eclipse.jface.text.templates;    import java.text.SimpleDateFormat;  import java.util.Calendar;    /**  * Global variables which are available in any context.  * <p>  * Clients may instantiate the classes contained within this class.  * </p>  *  * @since 3.0  */  public class GlobalTemplateVariables {        /** The type of the selection variables. */      public static final String SELECTION= "selection"; //$NON-NLS-1$        /**      * The cursor variable determines the cursor placement after template edition.      */      public static class Cursor extends SimpleTemplateVariableResolver {            /** Name of the cursor variable, value= {@value} */          public static final String NAME= "cursor"; //$NON-NLS-1$            /**          * Creates a new cursor variable          */          public Cursor() {              super(NAME, TextTemplateMessages.getString("GlobalVariables.variable.description.cursor")); //$NON-NLS-1$              setEvaluationString(""); //$NON-NLS-1$          }      }        /**      * The word selection variable determines templates that work on a full      * lines selection.      */      public static class WordSelection extends SimpleTemplateVariableResolver {            /** Name of the word selection variable, value= {@value} */          public static final String NAME= "word_selection"; //$NON-NLS-1$            /**          * Creates a new word selection variable          */          public WordSelection() {              super(NAME, TextTemplateMessages.getString("GlobalVariables.variable.description.selectedWord")); //$NON-NLS-1$          }          protected String resolve(TemplateContext context) {              String selection= context.getVariable(SELECTION);              if (selection == null)                  return ""; //$NON-NLS-1$              return selection;          }      }        /**      * The line selection variable determines templates that work on selected      * lines.      */      public static class LineSelection extends SimpleTemplateVariableResolver {            /** Name of the line selection variable, value= {@value} */          public static final String NAME= "line_selection"; //$NON-NLS-1$            /**          * Creates a new line selection variable          */          public LineSelection() {              super(NAME, TextTemplateMessages.getString("GlobalVariables.variable.description.selectedLines")); //$NON-NLS-1$          }          protected String resolve(TemplateContext context) {              String selection= context.getVariable(SELECTION);              if (selection == null)                  return ""; //$NON-NLS-1$              return selection;          }      }        /**      * The dollar variable inserts an escaped dollar symbol.      */      public static class Dollar extends SimpleTemplateVariableResolver {          /**          * Creates a new dollar variable          */          public Dollar() {              super("dollar", TextTemplateMessages.getString("GlobalVariables.variable.description.dollar")); //$NON-NLS-1$ //$NON-NLS-2$              setEvaluationString("$"); //$NON-NLS-1$          }      }        /**      * The date variable evaluates to the current date.      */      public static class Date extends SimpleTemplateVariableResolver {          /**          * Creates a new date variable          */          public Date() {              super("date", TextTemplateMessages.getString("GlobalVariables.variable.description.date")); //$NON-NLS-1$ //$NON-NLS-2$          }          protected String resolve(TemplateContext context) {  //          return DateFormat.getDateInstance().format(new java.util.Date());              final SimpleDateFormat df = new SimpleDateFormat(TextTemplateMessages.getString("GlobalVariables.variable.format.date"));               return df.format(new java.util.Date());           }      }        /**      * The year variable evaluates to the current year.      */      public static class Year extends SimpleTemplateVariableResolver {          /**          * Creates a new year variable          */          public Year() {              super("year", TextTemplateMessages.getString("GlobalVariables.variable.description.year")); //$NON-NLS-1$ //$NON-NLS-2$          }          protected String resolve(TemplateContext context) {  //          return Integer.toString(Calendar.getInstance().get(Calendar.YEAR));              return Integer.toString(Calendar.getInstance().get(Calendar.YEAR));            }      }        /**      * The time variable evaluates to the current time.      */      public static class Time extends SimpleTemplateVariableResolver {          /**          * Creates a new time variable          */          public Time() {              super("time", TextTemplateMessages.getString("GlobalVariables.variable.description.time")); //$NON-NLS-1$ //$NON-NLS-2$          }            /**          * {@inheritDoc}          */          protected String resolve(TemplateContext context) {              final SimpleDateFormat df = new SimpleDateFormat(TextTemplateMessages.getString("GlobalVariables.variable.format.time"));              return df.format(new java.util.Date());               //return DateFormat.getTimeInstance().format(new java.util.Date());          }      }        /**      * The user variable evaluates to the current user.      */      public static class User extends SimpleTemplateVariableResolver {          /**          * Creates a new user name variable          */          public User() {              super("user", TextTemplateMessages.getString("GlobalVariables.variable.description.user")); //$NON-NLS-1$ //$NON-NLS-2$          }            /**          * {@inheritDoc}          */          protected String resolve(TemplateContext context) {              return System.getProperty("user.name"); //$NON-NLS-1$          }      }  }  我改成了使用

import Java.text.SimpleDateFormat;import java.util.Calendar;

并且從properties文件中讀取format格式,可以借鑒。

我提供編譯好的class文件供大家下載(下載下面的圖片,把jpg后綴 改成rar后綴,然后打開),替換到原文件即可。
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb
精品国产精品三级精品av网址| 岛国av在线不卡| 国产成人精品一区二区| 伊人久久免费视频| 国产欧美韩国高清| 亚洲第一视频网| 98精品国产自产在线观看| 欧美激情一级欧美精品| 久久久久久久91| 久久久视频免费观看| 久久久久久综合网天天| 这里只有精品在线播放| 欧日韩不卡在线视频| 久久精品视频网站| 亚洲电影免费观看| 久久综合国产精品台湾中文娱乐网| 久久久久久久色| 久久精品亚洲精品| 国产日韩欧美在线播放| 欧美黑人极品猛少妇色xxxxx| 自拍偷拍亚洲一区| 尤物99国产成人精品视频| 日韩中文综合网| 久久久久久国产精品久久| 欧美另类69精品久久久久9999| 欧美成人精品在线视频| 亚洲成人精品在线| 伊人久久久久久久久久| 久久久亚洲影院你懂的| 精品视频—区二区三区免费| 91精品在线影院| 久久影院资源网| 中文字幕亚洲欧美一区二区三区| 亚洲精品456在线播放狼人| 96pao国产成视频永久免费| 高清一区二区三区四区五区| 精品视频9999| 一区二区三区四区视频| 日韩禁在线播放| 亚洲一区二区中文字幕| 国产精国产精品| 日韩av在线天堂网| 亚洲国产成人久久| 国产成人亚洲综合青青| 成人黄色免费片| 亚洲精品av在线播放| 亚洲人午夜精品| 久热精品视频在线观看| 国产97人人超碰caoprom| 精品国产一区二区在线| 精品国产一区二区三区久久| 久久久久久久久国产精品| 日韩av电影中文字幕| 亚洲国产精品人久久电影| 欧美日韩午夜剧场| 日韩中文理论片| 亚洲黄在线观看| 91国产美女视频| 成人午夜激情网| 亚洲欧美福利视频| 欧美精品免费在线| 日韩精品在线视频观看| 国产精品久久久久国产a级| 国产精品第2页| 福利一区福利二区微拍刺激| 一个人看的www欧美| 性色av香蕉一区二区| 日本久久久a级免费| 色综合导航网站| 国产午夜精品全部视频播放| 久久99热精品这里久久精品| 中文字幕日本欧美| 国产精品男女猛烈高潮激情| 欧美激情亚洲国产| 日韩欧美在线国产| 国产精品91久久久久久| 久久精品美女视频网站| 精品香蕉在线观看视频一| 精品久久久久久电影| 欧洲精品毛片网站| 丝袜亚洲欧美日韩综合| 欧美大尺度电影在线观看| 按摩亚洲人久久| 国产精品成人v| 日韩av在线资源| 欧美日韩午夜视频在线观看| 色偷偷偷亚洲综合网另类| 欧美精品videos另类日本| 成人黄色生活片| 91亚洲精品在线| 欧美一区视频在线| 欧美黑人又粗大| 国产精品色视频| 欧美黄色免费网站| 日韩av在线一区| 成人久久久久爱| 91精品国产色综合久久不卡98口| 久久亚洲春色中文字幕| 国产精品久久久一区| 欧美一级片在线播放| 亚洲欧美精品一区二区| 最新亚洲国产精品| 欧美国产视频日韩| 国产在线视频欧美| 91在线精品视频| 亚洲精品一区二区网址| 91精品国产99久久久久久| 国内精品久久久久久久| 国产精品影片在线观看| 国产欧美一区二区白浆黑人| 久久久999精品| 永久免费看mv网站入口亚洲| 91免费福利视频| 亚洲男人天堂久| 国产一区二区三区直播精品电影| 欧美色视频日本版| 裸体女人亚洲精品一区| 欧洲日韩成人av| 在线日韩中文字幕| 久久激情视频久久| 国产精品亚洲视频在线观看| 中文字幕亚洲一区二区三区五十路| 亚洲区bt下载| 日韩有码在线播放| 亚洲男人天堂视频| 亚洲欧美日韩天堂一区二区| 欧美午夜女人视频在线| 亚洲国产成人久久综合一区| 亚洲视频999| 欧美寡妇偷汉性猛交| 2025国产精品视频| 国内精品小视频在线观看| 日韩性生活视频| 欧美精品videosex极品1| 中文字幕亚洲欧美日韩2019| 亚洲国产精品人人爽夜夜爽| 91探花福利精品国产自产在线| 26uuu另类亚洲欧美日本一| 欧美在线国产精品| 日韩国产一区三区| 2019精品视频| 精品久久久久久电影| 欧美极品少妇xxxxⅹ免费视频| 欧美成年人视频| 成人情趣片在线观看免费| 亚洲精品美女在线观看| 国产精品久久久久久久久久| 日韩av网址在线| 黑人巨大精品欧美一区免费视频| 欧美大学生性色视频| 伦伦影院午夜日韩欧美限制| 国产成人在线视频| 国产精品美女在线观看| 日韩女在线观看| 日av在线播放中文不卡| 久久久999国产精品| 国产免费久久av| 久久久久久国产精品三级玉女聊斋| 日韩国产精品视频| 91久久精品国产91性色| 亚洲成人激情小说| 国产精品三级在线| 国产精品福利在线观看| 欧美激情亚洲另类|