<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    子非魚

    BlogJava 首頁 新隨筆 聯系 聚合 管理
      21 Posts :: 0 Stories :: 1 Comments :: 0 Trackbacks

    2008年4月12日 #


    eclipse瘦身后發現jboss server view找不到

    原因: org.jboss.ide.eclipse.as.feature中定義:

     <requires>
              ...
              <import plugin="org.eclipse.wst.server.ui.doc.user"/>
              ...
    </requires>

    該doc插件包在瘦身時被干掉了,導致jbossideplugin未正常加載,恢復該包即可
    posted @ 2011-09-15 18:40 子非魚 閱讀(279) | 評論 (0)編輯 收藏

         摘要:   閱讀全文
    posted @ 2009-03-29 13:27 子非魚| 編輯 收藏

         摘要:   閱讀全文
    posted @ 2009-03-28 11:54 子非魚 閱讀(903) | 評論 (1)編輯 收藏

         摘要: 內存溢出與JVM參數設置  閱讀全文
    posted @ 2009-03-28 10:09 子非魚| 編輯 收藏

         摘要: 轉自 http://topic.csdn.net/u/20080929/02/4e0ef626-98ee-4d6d-96ed-fe40afe8290b.html  閱讀全文
    posted @ 2009-03-28 09:18 子非魚| 編輯 收藏

    轉自:http://lemon.javaeye.com/blog/51480
            http://m.tkk7.com/fhawk/archive/2007/01/16/28993.html
    利用IKeyBindingService接口為Action綁定快捷鍵:

    1、
    設置commands extension

       <extension
               
    point = "org.eclipse.ui.commands">
               
    <!-- activeKeyConfiguration項用來說明所綁定快捷鍵的初始設置 -->
               
    <activeKeyConfiguration value="org.eclipse.ui.defaultAcceleratorConfiguration"/>
               
    <!-- 如果快捷鍵設置有多套,可以添加多個類別 -->
               
    <category
                   
    name="intelliPlatform.Category1"
                   description
    ="Test description"
                   id
    ="intelliPlatform.Category1"/>
               
    <!-- 其中id為這個command的ID,相關的action通過這個ID標志找到這個command -->
               
    <command
                 
    name="intelliPlatform.command.DataSource"
                 category
    ="intelliPlatform.Category1"
                 description
    ="數據源配置"
                 id
    ="com.longtop.intelliplatform.ide.project.commands.DataSource"/>
            
    <!-- 具體的快捷鍵設置,其中command指定實際的coomand的ID -->
            
    <keyBinding
                 
    command="com.longtop.intelliplatform.ide.project.commands.DataSource"
                 configuration
    ="org.eclipse.ui.defaultAcceleratorConfiguration"
                 keySequence
    ="Ctrl+Shift+D"/>
       
    </extension>
     以上是設置了plugin.xml中command extension,并指定了keybinding,在keybinding中
     的keysequence中的字符串是設置的快捷鍵。 

    ------------

    在具體的Action配置中,只要在其屬性definitionId設置成command的ID即可,示例如下:
    <action
     
    label="Sample Action"
     icon
    ="icons/sample.gif"
     class
    ="cli.bacchus.portal.ui.actions.BacchusAction"
     tooltip
    ="Hello, Eclipse world"
     menubarPath
    ="sampleMenu/sampleGroup"
     toolbarPath
    ="sampleGroup"
     id
    ="bacchus.portal.ui.actions.BacchusAction"
     definitionId
    ="com.longtop.intelliplatform.ide.project.commands.datesource">
    </action>

    注意:當給相關的action設置完definitionID后,必須保證其中設置的command是有的,而且是正確的,否則有可能導致該action顯示不出來。
    更具體的信息請參考eclipse開發參考中關于擴展點org.eclipse.ui.commands的詳細描述。

    ------------

    2、
     建立Acion,在此建立的action可以是實現IAction接口的任何類。比較方便的是繼承
     org.eclipse.jface.Action,然后在新類中覆蓋父類的run() 方法.

     public class CopyAction extends Action{
       
    public CopyAction(){
        setId(
    "org.example.copyaction");
        setActionDefinitionId(
    "com.longtop.intelliplatform.ide.project.commands.DataSource");
       }

     }

    3、
    在創建CopyAction的instance之后,將copyActionInstance用IKeyBindingService綁定到
    指定的command。
    獲得IKeyBinddingservice的一種簡單方式為:
    IKeyBindingService keyBindingService = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart().getSite().getKeyBindingService();
    keyBindingService.registerAction(copyActionInstance);


    注意:
    1、action的definitionid和command定義的id必須一致。
    2、當指定的keySequence與系統默認的沖突時,如:在窗體的菜單欄中
    指定了Edit->Copy(默認的快捷鍵為Ctrl+C),若將上面的keySequence改為
    M1+C(Ctrl+C)則系統默認的快捷鍵(Ctrl+C)將更改為Ctrl+Insert。即RCP默認
    的為用戶指定的優先,系統動態更新。
    3、IKeyBindingService指定的快捷鍵是有作用范圍的。




    為主菜單綁定快捷鍵

    主菜單的快捷鍵即為 Alt + 菜單名稱中帶下劃線的字母
    定義主菜單快捷鍵只要在主菜單lable中確定的字母前面加上&字符即可
    如:
    plugin.properties  menulabel = &Intelliplatform
    plugin_zh.properties menulabel = 平臺(&I)
    (注意:在該label引用的properties國際化文件中加,直接在plugin.xml中加好像無效,此處存疑)
    posted @ 2008-10-06 15:18 子非魚| 編輯 收藏

    JAVA中HashMap的成員遍歷  
    方法一:  
            Set   entries;  
            entries=map.keySet(); 
            Iterator   iter=entries.iterator();  
            while(iter.hasNext()){  
                  Object   obj=iter.next();  
                  System.out.println(obj+":"+map.get(obj));      
            }            

       
        方法二:      
            Set   entries;  
            entries=map.entrySet();
            Iterator   iter=entries.iterator();  
            while(iter.hasNext())  
            {  
                  System.out.println(iter.next()+"   ");      
            }  

    另外,JAVA中 interface和class都可以作為對變量的聲明。


        public static void copyDirtoDest(String srcDir, String toDir) {
            Copy copyDir 
    = new Copy();
            copyDir.setOverwrite(
    true);
            copyDir.setProject(
    new Project());
            FileSet fileSet 
    = new FileSet();
            fileSet.setDir(
    new File(srcDir));
            copyDir.addFileset(fileSet);
            File dest 
    = new File(toDir);

            copyDir.setTodir(dest);
            copyDir.execute();
        }


        
    public static void copyFiletoDestDir(String srcFile, String destDir) {
            Copy copy 
    = new Copy();
            copy.setProject(
    new Project());
            copy.setFile(
    new File(srcFile));
            copy.setTodir(
    new File(destDir));
            copy.execute();
        }


        
    public static void makeDir(String dir) {
            Mkdir mkdir 
    = new Mkdir();
            mkdir.setProject(
    new Project());
            mkdir.setDir(
    new File(dir));
            mkdir.execute();
        }


        
    public static void copyFiletoDestandRename(String srcFile, String destFile) {
            Copy copyTask 
    = new Copy();
            copyTask.setProject(
    new Project());
            copyTask.setFile(
    new File(srcFile));
            copyTask.setTofile(
    new File(destFile));
            copyTask.execute();
        }


        
    public static void moveFiletoDest(String srcFile, String destDir) {
            Move move 
    = new Move();
            move.setProject(
    new Project());
            move.setFile(
    new File(srcFile));
            move.setTodir(
    new File(destDir));
            move.execute();
        }


    驗證文件夾名稱是否符合java包名規范
    //弱驗證(只要能被java支持的名稱,如中文名稱)
    IStatus val = JavaConventions.validatePackageName(folder);                 
    if (val.getSeverity() == IStatus.ERROR) {
         
    return false;
    }
     
    /**
         * 強驗證:是否是嚴格符合命名規范的包名,標識:以字母開頭,字母與數字的組合,字母必須都是小寫。
         * 
    @param str1
         * 
    @return
         
    */

        
    public static boolean isPackageName(String str1){
            String regex 
    = "^[a-z][a-z[\\d]]*";  
            Pattern p 
    = Pattern.compile(regex);
            Matcher m 
    = p.matcher(str1);        
            
    return  m.matches();
        }


    hibernate3 hql 參數亂碼問題
    Hql中有中文參數(如from test as c where c.name='張三')的話被翻譯成sql的時候會出現亂碼,解決方法:
    在Spring的配制文件applicationContext.xml文件中添加以下代碼:
        <property name="hibernateProperties">
            
    <props>
                     
                
    <prop key="hibernate.query.factory_class">
                    org.hibernate.hql.classic.ClassicQueryTranslatorFactory
                
    </prop>
            
    </props>
        
    </property>

    list轉Array
    (IAction[]) list.toArray(new IAction[0]);
    (IAction[]) list.toArray(new IAction[list.size()]);
    posted @ 2008-04-12 23:07 子非魚| 編輯 收藏

    主站蜘蛛池模板: 亚洲性久久久影院| 亚洲欧洲久久av| 67194在线午夜亚洲| 亚洲一区二区三区免费观看| 亚洲av午夜成人片精品网站 | 亚洲精品无码不卡在线播放| 亚洲免费网站观看视频| 亚洲人成在线中文字幕| 成年免费大片黄在线观看岛国| 亚洲国产精品成人综合久久久| 国产成人免费网站| 亚洲AV香蕉一区区二区三区| 热久久精品免费视频| 麻豆一区二区三区蜜桃免费| 亚洲国产精品自产在线播放| 国产高清对白在线观看免费91| 亚洲精品卡2卡3卡4卡5卡区| 精品熟女少妇av免费久久| 中文字幕免费在线看| 亚洲人成网站在线播放vr| 免费一级不卡毛片| 亚洲视频在线观看免费视频| 色妞WWW精品免费视频| 粉色视频在线观看www免费| 国产综合亚洲专区在线| 国产免费一区二区三区在线观看| 久久亚洲熟女cc98cm| 日韩中文无码有码免费视频| 一个人看的免费观看日本视频www 一个人看的免费视频www在线高清动漫 | 亚洲伊人精品综合在合线| 蜜桃精品免费久久久久影院| 思思久久99热免费精品6| 亚洲大片在线观看| 在线a人片天堂免费观看高清| 亚洲AV无码久久精品狠狠爱浪潮 | 国产精品免费看香蕉| 免费久久人人爽人人爽av| 亚洲一级大黄大色毛片| 亚洲AV无码乱码精品国产| 99久久人妻精品免费二区| 另类小说亚洲色图|