当前位置: 首页>>代码示例>>Java>>正文


Java LocationEvent类代码示例

本文整理汇总了Java中org.eclipse.swt.browser.LocationEvent的典型用法代码示例。如果您正苦于以下问题:Java LocationEvent类的具体用法?Java LocationEvent怎么用?Java LocationEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


LocationEvent类属于org.eclipse.swt.browser包,在下文中一共展示了LocationEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createUI_10_SearchInternal

import org.eclipse.swt.browser.LocationEvent; //导入依赖的package包/类
private void createUI_10_SearchInternal(final Composite parent) {

		try {

			_browser = new Browser(parent, SWT.NONE);
			GridDataFactory.fillDefaults().grab(true, true).applyTo(_browser);

		} catch (final SWTError e) {
			StatusUtil.showStatus("Could not instantiate Browser: " + e.getMessage(), e);//$NON-NLS-1$
			return;
		}

		_browser.addLocationListener(new LocationAdapter() {
			@Override
			public void changing(final LocationEvent event) {
				SearchMgr.onBrowserLocation(event);
			}
		});

	}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:21,代码来源:SearchView.java

示例2: onBrowser_LocationChanging

import org.eclipse.swt.browser.LocationEvent; //导入依赖的package包/类
private void onBrowser_LocationChanging(final LocationEvent event) {

		final String location = event.location;

		final String[] locationParts = location.split(HREF_TOKEN);

		if (locationParts.length > 1) {

			// finalize loading of the browser page and then start the action
			_browser.getDisplay().asyncExec(new Runnable() {
				@Override
				public void run() {
					onBrowser_LocationChanging_Runnable(locationParts);
				}
			});
		}

		// prevent to load a new url
		if (location.equals(PAGE_ABOUT_BLANK) == false) {

			// about:blank is the initial page

			event.doit = false;
		}
	}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:26,代码来源:RawDataView.java

示例3: openBrowserInEditor

import org.eclipse.swt.browser.LocationEvent; //导入依赖的package包/类
private void openBrowserInEditor(LocationEvent event) {
    URL url;
    try {
        url = new URL(event.location);
    } catch (MalformedURLException ignored) {
        return;
    }
    IWorkbenchBrowserSupport support = PlatformUI.getWorkbench().getBrowserSupport();
    try {
        IWebBrowser newBrowser = support.createBrowser(browserId);
        browserId = newBrowser.getId();
        newBrowser.openURL(url);
        return;
    } catch (PartInitException e) {
        FindbugsPlugin.getDefault().logException(e, "Can't open external browser");
    }
}
 
开发者ID:OpenNTF,项目名称:FindBug-for-Domino-Designer,代码行数:18,代码来源:BugInfoView.java

示例4: createPartControl

import org.eclipse.swt.browser.LocationEvent; //导入依赖的package包/类
@Override
public void createPartControl(Composite parent){
	browser = new Browser(parent, SWT.NONE);
	browser.addLocationListener(new LocationAdapter() {
		
		@Override
		public void changed(LocationEvent arg0){
			String text = getText(arg0.location);
			System.out.println(text);
		}
		
	});
	// browser.setUrl("http://ch.oddb.org");
	browser.setUrl("http://santesuisse.oddb.org/");
	
}
 
开发者ID:elexis,项目名称:elexis-3-core,代码行数:17,代码来源:ODDBView.java

示例5: initURI

import org.eclipse.swt.browser.LocationEvent; //导入依赖的package包/类
protected URI initURI(LocationEvent event){
	String loc= event.location;
	if ("about:blank".equals(loc)) { //$NON-NLS-1$
		/*
		 * Using the Browser.setText API triggers a location change to "about:blank".
		 * remove this code once https://bugs.eclipse.org/bugs/show_bug.cgi?id=130314 is fixed
		 */
		//input set with setText
		handler.handleTextSet();
		return null;
	}

	event.doit= false;

	if (loc.startsWith("about:")) { //$NON-NLS-1$
		// Relative links should be handled via head > base tag.
		// If no base is available, links just won't work.
		return null;
	}

	URI uri;
	try {
		uri= new URI(loc);
	} catch (URISyntaxException e) {
		// try it with a file (workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=237903 ):
		File file= new File(loc);
		if (! file.exists()) {
			log.warn("Could not handle location"+loc, e);
			return null;
		}
		uri= file.toURI();
	}
	return uri;

}
 
开发者ID:cplutte,项目名称:bts,代码行数:36,代码来源:XtextElementLinks.java

示例6: SwtInterceptingBrowser

import org.eclipse.swt.browser.LocationEvent; //导入依赖的package包/类
public SwtInterceptingBrowser(final Browser browser, final Display display, final Shell shell) {
    this.browser = browser;
    this.display = display;

    this.browser.addLocationListener(new LocationAdapter() {
        @Override
        public void changing(LocationEvent locationEvent) {
            super.changing(locationEvent);
            final String newValue = locationEvent.location;

            lock.lock();
            try {
                if (redirectUriString != null && newValue != null && newValue.startsWith(redirectUriString)) {
                    // Do not load this new location, as we are only interested in the authorization code
                    locationEvent.doit = false;

                    response = UserAgentImpl.extractResponseFromRedirectUri(newValue);
                    responseReceived.signal();
                }
            }
            finally {
                lock.unlock();
            }
        }
    });

    shell.addListener(SWT.Close, new Listener() {
        @Override
        public void handleEvent(Event event) {
            lock.lock();
            try {
                response = "error=cancelled&error_description=The browser window was closed by the user.";
                responseReceived.signal();
            } finally {
                lock.unlock();
            }
        }
    });
}
 
开发者ID:Microsoft,项目名称:oauth2-useragent,代码行数:40,代码来源:SwtInterceptingBrowser.java

示例7: fireLocationEvent

import org.eclipse.swt.browser.LocationEvent; //导入依赖的package包/类
/**
 * Fire event
 */
private void fireLocationEvent(){
    LocationEvent event = new LocationEvent(root);
    event.location = this.location;
    for (LocationListener listener : listeners) {
        listener.changed(event);
    }
}
 
开发者ID:prasser,项目名称:swtbrowser,代码行数:11,代码来源:HTMLBrowser.java

示例8: fireOnLocationChange

import org.eclipse.swt.browser.LocationEvent; //导入依赖的package包/类
/**
 * Fires an on location change event.
 * 
 * @param swtEvent
 * @return true, if a veto occurred
 */
private boolean fireOnLocationChange(final LocationEvent swtEvent) {
    if (locationListeners.size() > 0) {
        final IBrowserLocationEvent event = new BrowserLocationEvent(swtEvent);
        final VetoHolder vetoHolder = new VetoHolder();
        for (final IBrowserLocationListener listener : new LinkedList<IBrowserLocationListener>(locationListeners)) {
            listener.onLocationChange(event, vetoHolder);
            if (vetoHolder.hasVeto()) {
                return true;
            }
        }
    }
    return false;
}
 
开发者ID:jo-source,项目名称:jo-widgets,代码行数:20,代码来源:BrowserImpl.java

示例9: fireLocationChanged

import org.eclipse.swt.browser.LocationEvent; //导入依赖的package包/类
private void fireLocationChanged(final LocationEvent swtEvent) {
    if (locationListeners.size() > 0) {
        final IBrowserLocationEvent event = new BrowserLocationEvent(swtEvent);
        for (final IBrowserLocationListener listener : new LinkedList<IBrowserLocationListener>(locationListeners)) {
            listener.locationChanged(event);
        }
    }
}
 
开发者ID:jo-source,项目名称:jo-widgets,代码行数:9,代码来源:BrowserImpl.java

示例10: changing

import org.eclipse.swt.browser.LocationEvent; //导入依赖的package包/类
@Override
public void changing(LocationEvent event) {
	EPlanElement node = getTargetNode(event);
	if (node != null) {
		selectTemporalNode(node);
	}
	event.doit = false;
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:9,代码来源:TemporalNodeBrowserListener.java

示例11: getTargetNode

import org.eclipse.swt.browser.LocationEvent; //导入依赖的package包/类
/**
 * Utility function to look up the target for a given hyperlink event.
 * Relies on the unique id for the target being put into the href of
 * the hyperlink.  As a backup, checks the link label as a print name.
 * @param e
 * @return the temporal node targeted by the hyperlink, if any
 */
private EPlanElement getTargetNode(LocationEvent e) {
	EPlanElement node = null;
	String href = e.location;
	if (href != null) {
		String uniqueId = PlanPrinter.getUniqueIdFromHref(href);
		node = identifiableRegistry.getIdentifiable(EPlanElement.class, uniqueId);
	}
	if (node == null) {
		String printName = e.location;
		node = getNodeByPrintName(plan, printName);
	}
	return node;
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:21,代码来源:TemporalNodeBrowserListener.java

示例12: createPartControl

import org.eclipse.swt.browser.LocationEvent; //导入依赖的package包/类
@Override
public void createPartControl(Composite parent){
	browser = new Browser(parent, SWT.NONE);
	browser.addLocationListener(new LocationAdapter() {
		
		@Override
		public void changed(LocationEvent arg0){
			String text = browser.getText();
			// System.out.println(text);
		}
		
	});
	browser.setUrl("http://www.compendium.ch/search/de"); //$NON-NLS-1$
	
}
 
开发者ID:elexis,项目名称:elexis-3-core,代码行数:16,代码来源:KompendiumView.java

示例13: changed

import org.eclipse.swt.browser.LocationEvent; //导入依赖的package包/类
/** 
 * Sets the location to text control when web browser changes site. 
 * Sets the browser enable when it has changed.
 * @see org.eclipse.swt.browser.LocationListener#changed(org.eclipse.swt.browser.LocationEvent)
 * @param event event.
 */
public void changed(LocationEvent event) {
    if (event.top) {
        String url = event.location;
        locationText.setText(url);
        locationText.redraw();
    } 
    getButton(IDialogConstants.OK_ID).setEnabled(true);
}
 
开发者ID:d-case,项目名称:d-case_editor,代码行数:15,代码来源:WebBrowserDialog.java

示例14: changed

import org.eclipse.swt.browser.LocationEvent; //导入依赖的package包/类
public void changed(LocationEvent event) {
	tx_addr.setText(mozillaBrowser.getUrl());
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:4,代码来源:XulToolBar.java

示例15: changed

import org.eclipse.swt.browser.LocationEvent; //导入依赖的package包/类
@Override
public void changed(LocationEvent arg0) {
	getCookies();
}
 
开发者ID:BiglySoftware,项目名称:BiglyBT,代码行数:5,代码来源:ExternalLoginCookieListener.java


注:本文中的org.eclipse.swt.browser.LocationEvent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。