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 单飞 阅读(333) | 评论 (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 单飞 阅读(230) | 评论 (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 单飞 阅读(651) | 评论 (0)编辑 收藏

     摘要: 前边实现了一个表格的基本功能,但这并不够好,能否为表格实现一些更好的功能呢?答案是肯定的。下边我们来加入直接编辑的功能。 一、要实现这个功能必须提供一个实现ICellModifier的类。内容如下 import org.eclipse.jface.viewers.ICellModifier; import org.eclipse.jface.viewers.Table...  阅读全文
posted @ 2009-08-27 14:54 单飞 阅读(552) | 评论 (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 单飞 阅读(662) | 评论 (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 单飞 阅读(790) | 评论 (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 单飞 阅读(254) | 评论 (0)编辑 收藏

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


posted @ 2009-07-08 10:07 单飞 阅读(215) | 评论 (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 单飞 阅读(1003) | 评论 (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 单飞 阅读(291) | 评论 (0)编辑 收藏

仅列出标题
共12页: 上一页 1 2 3 4 5 6 7 8 9 下一页 Last