Skip to main content



      Home
Home » Language IDEs » PHP Development Tools (PDT) » Steps to build your own customized "Internal Web Browser"
Steps to build your own customized "Internal Web Browser" [message #879019] Wed, 30 May 2012 07:29
Eclipse UserFriend
How to build the plug-in for ignoring mouse wheel scrolling in the location bar of the Internal Web Browser.

01. Install(unzip) Eclipse Classic 3.7.2
02. Start eclipse with new workspace
03. Open perspective "Plug-in Development"
04. Click "Plug-ins" next to Package Explorer
05. Select org.eclipse.ui.browser (3.3.101.v20111019-1723)
06. Right-click and select "Import As"->"Source Project"
07. Go back to Package Explorer
08. Expand org.eclipse.ui.browser project
09. Open src/org.eclipse.ui.internal.browser/BrowserViewer.java
10. Goto line 719 and make sure the code
    private ToolBar createLocationBar(Composite parent) {
        combo = new Combo(parent, SWT.DROP_DOWN);

        updateHistory();

        combo.addSelectionListener(new SelectionAdapter() {
            public void widgetSelected(SelectionEvent we) {
                try {

11. Insert customizing code after "updateHistory();"
    private ToolBar createLocationBar(Composite parent) {
        combo = new Combo(parent, SWT.DROP_DOWN);

        updateHistory();

        // begin customizing
        final String MOUSE_SCROLLED = "adhoc.mouseScrolled";
        combo.addMouseWheelListener(new MouseWheelListener() {
            public void mouseScrolled(MouseEvent e) {
                if (!combo.getListVisible()) {
                    combo.setData(MOUSE_SCROLLED, Boolean.TRUE);
                }
            }
        });
        combo.addKeyListener(new KeyListener() {
            public void keyReleased(KeyEvent e) {
            }
            public void keyPressed(KeyEvent e) {
                if (Boolean.TRUE.equals(combo.getData(MOUSE_SCROLLED))) {
                    switch (e.keyCode) {
                    case SWT.ARROW_DOWN:
                    case SWT.ARROW_UP:
                    case SWT.PAGE_DOWN:
                    case SWT.PAGE_UP:
                        e.doit = false;
                        break;
                    }
                    combo.setData(MOUSE_SCROLLED, null);
                }
            }
        });
        // end customizing

        combo.addSelectionListener(new SelectionAdapter() {
            public void widgetSelected(SelectionEvent we) {
                try {

12. Fix errors
12-a. Hit Ctrl+Shift+O
12-b. Choose org.eclipse.swt.events.KeyEvent
12-c. Choose org.eclipse.swt.events.MouseWheelListener
12-d. Choose org.eclipse.swt.events.KeyListener
13. Save it and close the editor
14. Execute export wizard (menu/File->Export)
15. Expand "Plug-in Development"
16. Select "Deployable plug-ins and fragments" and click "Next"
17. Enter your output directory in the "Directory" box and click "Finish"
18. Make sure {your output directory}/plugins/org.eclipse.ui.browser_3.3.101.v20111019-1723.jar existed
19. Exit eclipse
20. Backup eclipse/plugins/org.eclipse.ui.browser_3.3.101.v20111019-1723.jar
21. Copy new org.eclipse.ui.browser_3.3.101.v20111019-1723.jar to eclipse/plugins
22. Start eclipse (no need any options such as "-clean")

That's all.

Here is a binary file.
http://sourceforge.jp/downloads/users/1/1200/org.eclipse.ui.browser_3.3.101.v20111019-1723.jar

I'm not interested in this issue but it seems there is no browser having this behaviour. At least IE8, Firefox12 and Chrome21 disallowed mouse scrolling in the address bar since it is not a combo-box(control/widget).
It hurts user interface indeed.
Previous Topic:xdebug path mapping problem
Next Topic:setting eclipse for web development
Goto Forum:
  


Current Time: Sat Jul 05 11:25:45 EDT 2025

Powered by FUDForum. Page generated in 0.24527 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top