9910

          單飛

             :: 首頁 :: 聯系 :: 聚合  :: 管理

          #

          Bundle-NativeCode: lib/ICE_JNIRegistry.dll;osname=win32;processor=x86

          Bundle-NativeCode manifest allows you to use native libraries (DLLs) without having to set the java.library.path system property

          #Processor Aliases                      Description

          68k                                     # Motorola 68000 and up
          ARM                                     # Intel Strong ARM
          Alpha                                   # Compaq (ex DEC)
          Ignite psc1k                            # PTSC
          Mips                                    # SGI
          PArisc                                  # Hewlett Packard PA Risc
          PowerPC power ppc                       # Motorola/IBM Power PC
          Sparc                                   # SUN
          x86 pentium i386 i486 i586 i686         # Intel
          s390                                    # IBM System 390
          s390x                                  # IBM System 390 (64-bit)
          v850e                                   # NEC V850E
          x86-64 amd64 em64t x86_64               # 64 bit x86 architecture

          #OS Aliases                             Description

          AIX                                      # IBM
          DigitalUnix                              # Compaq
          embos                                    # Segger Embedded Software Solutions
          Epoc32 SymbianOS                         # Symbian OS
          FreeBSD                                  # Free BSD
          HPUX                                     # Hewlett Packard
          IRIX                                     # Sillicon Graphics
          Linux                                    # Open source
          MacOS "Mac OS"                   # Apple
          MacOSX "Mac OS X"              # Apple
          NetBSD                                   # Open source
          Netware                                  # Novell
          OpenBSD                                  # Open source
          OS2 OS/2                                 # IBM
          QNX procnto                              # QNX Neutrino 2.1
          Solaris                                  # Sun
          SunOS                                    # Sun
          VxWorks                                  # WindRiver Systems
          Windows95 "Windows 95" Win95 Win32       # Microsoft
          Windows98 "Windows 98" Win98 Win32       # Microsoft
          WindowsNT "Windows NT" WinNT Win32       # Microsoft
          WindowsCE "Windows CE" WinCE             # Microsoft
          Windows2000 "Windows 2000" Win2000 Win32 # Microsoft
          WindowsXP "Windows XP" WinXP Win32       # Microsoft
          Windows2003 "Windows 2003" "Windows Server 2003" Win2003 Win32 # Microsoft
          WindowsVista WinVista "Windows Vista" Win32 # Microsoft


          posted @ 2009-09-22 10:05 單飛 閱讀(341) | 評論 (0)編輯 收藏

          <#if num?exists>
           <#assign ndex = 1>
          <#else>
           <#assign index = 0>
           </#if>
          <u>${address?if_exists}</u>
          <n>${n?default('')}</n>
          posted @ 2009-09-21 13:53 單飛 閱讀(239) | 評論 (0)編輯 收藏

           
          
          MenuManager menuMgr = new MenuManager();
                  menuMgr.setRemoveAllWhenShown(
          true);
                  menuMgr.addMenuListener(
          new IMenuListener() {
                      
          public void menuAboutToShow(IMenuManager manager) {
                          manager.add(
          new Action("刪除"){
                              
          public void run(){
                                  
          boolean flag = MessageDialog.openConfirm(parentComposite.getShell(), "確認刪除嗎?""你確認要刪除嗎?");
                                  
          if(flag){
                                      removeSelectPage();    
                                  }

                                  
                              }

                          }
          );
                      }

                  }
          );
                  
          final Menu menu = menuMgr.createContextMenu(this);
                  
          this.setMenu(menu);
                  
                  tabFolder.addMenuDetectListener(
          new MenuDetectListener(){

                      
          public void menuDetected(MenuDetectEvent arg0) {
                          menu.setVisible(
          true);
                      }

                      
                  }
          );
                  tabFolder.addMouseListener(
          new MouseAdapter(){
                      
          public void mouseDown(MouseEvent mouseevent)
                      
          {
                          TabItem selectItem 
          = tabFolder.getItem(new Point(mouseevent.x,mouseevent.y));
                          tabFolder.setSelection(selectItem);
                      }

                  }
          );
          Unfortunately, there is no way to get the bounds of a TabItem on every
          platform (specifically, the Mac does not support it).  Therefore, at the
          lowest level, we can't get what you want.
          "Stéphane Fournier" <stephane.fournier@xxxxxxxxxxxxxxx> wrote in message
          news:dgdg2j$5p4$1@xxxxxxxxxxxxxxxxxxx
          > Hi,
          >
          > Does anyone know how to set a Popup Menu on a TabItem.
          > I found how to set a Menu on the TabFolder but in my case I need a popup
          > menu with a content related to the TabItem when right mouse click is
          > triggered (the TabItem could not be the selected tabItem for the
          TabFolder).
          >
          > Another way is to get a dynamic content for the Menu  set on the
          > TabFolder, but I need to listen to an event when mouse is moving over
          > the TabItems without selecting them....
          > My need is something close to the behavior of the CTabItem when the
          > mouse is over a not selected CTabItem ,a cross is displayed to close the
          > CTabItem without activating it...
          >
          > Which event can I listen to ?
          >
          > Thanks in advance,
          > Stephane.
          
          posted @ 2009-09-21 13:48 單飛 閱讀(657) | 評論 (0)編輯 收藏

               摘要: 前邊實現了一個表格的基本功能,但這并不夠好,能否為表格實現一些更好的功能呢?答案是肯定的。下邊我們來加入直接編輯的功能。 一、要實現這個功能必須提供一個實現ICellModifier的類。內容如下 import org.eclipse.jface.viewers.ICellModifier; import org.eclipse.jface.viewers.Table...  閱讀全文
          posted @ 2009-08-27 14:54 單飛 閱讀(560) | 評論 (0)編輯 收藏

              public static void hidePropertiesView() {
                  hideView("org.eclipse.ui.views.PropertySheet");
              }

              public static void hideView(final String theViewId) {
                  invokeOnDisplayThread(new Runnable() {
                      public void run() {
                          try {
                              IWorkbenchPage activePage = getActivePage();
                              IViewPart iviewpart = activePage.findView(theViewId);
                              activePage.hideView(iviewpart);
                          } catch (Exception ex) {
                              ex.printStackTrace();
                          }
                      }
                  });
              }

              public static void invokeOnDisplayThread(Runnable runnable) {
                  IWorkbench workbench = PlatformUI.getWorkbench();
                  IWorkbenchWindow windows[] = workbench.getWorkbenchWindows();
                  if (windows != null && windows.length > 0) {
                      Display display = windows[0].getShell().getDisplay();
                      display.syncExec(runnable);
                  } else {
                      runnable.run();
                  }
              }


          posted @ 2009-08-03 11:29 單飛 閱讀(671) | 評論 (0)編輯 收藏

          方法1:
          重寫創建按鈕的方法createButtonFromButtonBar

          方法2:
          等待窗口open()后調用:

          getButton(0).setText("確定");
          getButton(1).setText("取消");

          方法3:
          國際化操作:
          new Fragment Project;

          Manifest-Version: 1.0
          Bundle-ManifestVersion: 2
          Bundle-Name: Fragement Fragment
          Bundle-SymbolicName: org.eclipse.jface.fragement
          Bundle-Version: 1.0.0
          Fragment-Host: org.eclipse.jface;bundle-version="3.2.2"
          Bundle-Localization: plugin


          new org.eclipse.jface.fragment/src/org/eclipse/jface/messages_zh_CN.properties Files.

          cancel = \u53D6\u6D88
          ok = \u786E\u5B9A
          posted @ 2009-07-28 09:34 單飛 閱讀(801) | 評論 (0)編輯 收藏

          http://www.trustice.com/java/jnireg/index.shtml registry-3.1.3.zip

          public
           static void setProxy(String ip, int port) {
                  String topKeyName 
          = "HKCU";
                  String keyName 
          = "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings";
                  RegistryKey topKey 
          = Registry.getTopLevelKey(topKeyName);
                  RegistryUtil.setDWordCommand(topKey, keyName, 
          "ProxyEnable""1");
                  RegistryUtil.setStringCommand(topKey, keyName, 
          "ProxyServer", ip + ":" + port);
              }

              
          public static boolean isProxy() {
                  
          try {
                      RegistryKey registryKey 
          = Registry.openSubkey(Registry.HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings", RegistryKey.ACCESS_READ);
                      RegistryValue registryValue 
          = registryKey.getValue("ProxyEnable");
                      
          boolean proxyEnable = ((RegDWordValue) registryValue).getData() != 0;

                      System.out.println(
          "IE 是否啟用了代理設置: " + proxyEnable);

                      
          if (proxyEnable) {
                          registryValue 
          = registryKey.getValue("ProxyServer");
                          System.out.println(
          "IE 代理服務器是: " + new String(registryValue.getByteData()));
                          
          return true;
                      }

                  } 
          catch (NoSuchKeyException ne) {
                      ne.printStackTrace();
                  } 
          catch (RegistryException re) {
                      re.printStackTrace();
                  }
                  
          return false;
              }
          posted @ 2009-07-08 13:27 單飛 閱讀(262) | 評論 (0)編輯 收藏

          Bundle-NativeCode: lib/ICE_JNIRegistry.dll;osname=Win32;processor=x86


          posted @ 2009-07-08 10:07 單飛 閱讀(231) | 評論 (0)編輯 收藏

          for (int i = 0; i < COLUMNS.length; i++) {
                          TableColumn idColumn 
          = new TableColumn(table, SWT.LEFT);
                          cName 
          = StringUtils.getNotEmpty(COLUMNS[i]);
                          ColumnPixelData columnpixeldata 
          = new ColumnPixelData(COLUMNS_WIDTH[i]);
                          tableLayout.addColumnData(columnpixeldata);
                          idColumn.setText(cName);
                          idColumn.setResizable(
          true);
                          
          final String columnName = cName;
                          
          final Collator collator = Collator.getInstance();
                          idColumn.addSelectionListener(
          new SelectionListener() {
                              
          private boolean sortType = true;

                              
          public void widgetDefaultSelected(SelectionEvent e) {

                              }

                              
          public void widgetSelected(SelectionEvent e) {
                                  sortType 
          = !sortType;
                                  java.util.Collections.sort(input, 
          new Comparator<FElement>() {

                                      
          public int compare(FElement entry1, FElement entry2) {
                                          
          int rt = -1;
                                          
          if (COLUMNS[1].equals(columnName)) {
                                              rt 
          = collator.compare(entry1.getName(), entry2.getName());
                                          } 
          else if (COLUMNS[2].equals(columnName)) {
                                              rt 
          = collator.compare(StringUtils.getNotEmpty(entry1.getValueTxt()), StringUtils.getNotEmpty(entry2.getValueTxt()));
                                          } 
          else if (COLUMNS[3].equals(columnName)) {
                                              rt 
          = collator.compare(StringUtils.getNotEmpty(entry1.getDescription()), StringUtils.getNotEmpty(entry2.getDescription()));
                                          }
                                          
          if (sortType) {
                                              
          return (-1* rt;
                                          }

                                          
          return rt;
                                      }

                                  });
                                  options.setInput(input);
                                  options.refresh();

                              }

                          });
                      }

          這種方法的好處是短小精悍
          如果做架構設計就不如使用Annotation封裝一下,如果是剛入門就不妨每列增加一個Sorter而且還要增加正反兩個.
          posted @ 2009-07-07 14:45 單飛 閱讀(1012) | 評論 (0)編輯 收藏

          擴展Editor的Configuration
             <extension
                   
          point="org.eclipse.wst.sse.ui.editorConfiguration">
            
          <!-- associating an outline configuration to an input's content type -->
                
          <contentOutlineConfiguration
                    
          class="com.test.outline.OutlineConfiguration"
                    target
          ="org.eclipse.core.runtime.xml,org.eclipse.wst.html.core.htmlsource"/>        
             
          </extension>
          OutlineConfiguration.java

          import org.eclipse.jface.action.IMenuListener;
          import org.eclipse.jface.action.IMenuManager;
          import org.eclipse.jface.viewers.TreeViewer;
          import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
          import org.eclipse.wst.sse.ui.internal.IReleasable;
          import org.eclipse.wst.xml.ui.internal.contentoutline.XMLNodeActionManager;
          import org.eclipse.wst.xml.ui.views.contentoutline.XMLContentOutlineConfiguration;

          public class OutlineConfiguration extends XMLContentOutlineConfiguration {
              
              
          private class ActionManagerMenuListener implements IMenuListener, IReleasable {

                  
          public void menuAboutToShow(IMenuManager imenumanager) {
                      TestAction action 
          = new TestAction();
                      imenumanager.add(action);
                  }

                  
          public void release() {
                      fTreeViewer 
          = null;
                      
          if (fActionManager != null)
                          fActionManager.setModel(
          null);
                  }

                  
          private XMLNodeActionManager fActionManager;

                  
          private TreeViewer fTreeViewer;

                  
          public ActionManagerMenuListener(TreeViewer treeviewer) {
                      
          super();
                      fTreeViewer 
          = treeviewer;
                  }
              }

              
          private ActionManagerMenuListener fContextMenuFiller;

              
          public OutlineConfiguration() {
                  
          super();
              }
              @Override
              
          public IMenuListener getMenuListener(TreeViewer treeviewer) {
                  
          if (fContextMenuFiller == null)
                      fContextMenuFiller 
          = new ActionManagerMenuListener(treeviewer);
                  
          return fContextMenuFiller;
              }
          }


          import org.eclipse.jface.action.Action;

          public class TestAction extends Action {
              
          public TestAction(){
                  
          super("Test");
              }
          }

          這樣Outline的Menu就是你自己定義的了.


          參考資料:
          http://www.eclipse.org/webtools/wst/components/sse/designs/EditorConfiguration.html



          posted @ 2009-06-03 10:04 單飛 閱讀(298) | 評論 (0)編輯 收藏

          僅列出標題
          共12頁: 上一頁 1 2 3 4 5 6 7 8 9 下一頁 Last 
          主站蜘蛛池模板: 宜君县| 普安县| 广河县| 萨嘎县| 金平| 昭觉县| 巴中市| 余姚市| 嘉峪关市| 普兰店市| 德州市| 中卫市| 大连市| 滁州市| 平江县| 丰顺县| 安乡县| 阜宁县| 鄂伦春自治旗| 龙岩市| 搜索| 藁城市| 青川县| 宁都县| 易门县| 龙岩市| 石棉县| 和林格尔县| 鹤庆县| 利辛县| 三亚市| 通州区| 长治市| 光泽县| 长丰县| 河源市| 长汀县| 东明县| 安图县| 鹰潭市| 枣强县|