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


Java WebView.setContextMenuEnabled方法代码示例

本文整理汇总了Java中javafx.scene.web.WebView.setContextMenuEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java WebView.setContextMenuEnabled方法的具体用法?Java WebView.setContextMenuEnabled怎么用?Java WebView.setContextMenuEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javafx.scene.web.WebView的用法示例。


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

示例1: UARTPanel

import javafx.scene.web.WebView; //导入方法依赖的package包/类
public UARTPanel()
{
	WebView view = new WebView();
	view.setContextMenuEnabled(false);
	webEngine = view.getEngine();
	
	messageQueue = new LinkedList<>();
	
	valueDisplayOptions = new LinkedHashMap<>();
	populateDisplayOptions();
	
	ObservableValue<State> property = webEngine.getLoadWorker().stateProperty();
	OnLoadListener.register(this::onLoad, property);
	
	String content = "<html><head></head><body " + styleString() + "></body></html>";
	webEngine.loadContent(content);
	
	HBox controlPane = createControlPane();
	
	this.setCenter(view);
	this.setBottom(controlPane);
}
 
开发者ID:dhawal9035,项目名称:WebPLP,代码行数:23,代码来源:UARTPanel.java

示例2: ConsolePane

import javafx.scene.web.WebView; //导入方法依赖的package包/类
public ConsolePane()
{
	WebView view = new WebView();
	view.setContextMenuEnabled(false);
	webEngine = view.getEngine();
	
	messageQueue = new LinkedList<>();
	
	ObservableValue<State> property = webEngine.getLoadWorker().stateProperty();
	OnLoadListener.register(this::onLoad, property);
	
	String content = "<html><head></head><body></body></html>";
	webEngine.loadContent(content);
	
	ConsolePaneEventHandler eventHandler = new ConsolePaneEventHandler();
	EventRegistry.getGlobalRegistry().register(eventHandler);
	
	this.setCenter(view);
}
 
开发者ID:dhawal9035,项目名称:WebPLP,代码行数:20,代码来源:ConsolePane.java

示例3: createView

import javafx.scene.web.WebView; //导入方法依赖的package包/类
private void createView() {
	webView = new WebView();
       webView.setContextMenuEnabled(false);
	webEngine = webView.getEngine();
	webEngine.documentProperty().addListener(new ChangeListener<Document>() {
		@Override
		public void changed(ObservableValue<? extends Document> prop, Document oldDoc, Document newDoc) {
			logger.debug("WebView loaded dataviewer with id : [{}]", udID);
			if (enableFireBug)
				enableFirebug(webEngine);
		}
	});
	String urlToLoad = getUrlToLoad() + udID;
	logger.debug("Loading: [{}]", urlToLoad);
	webEngine.load(urlToLoad);

	setStyle("-fx-background-color: white;");
	setCenter(webView);
	setTop(topMenu = new TopMenu(plotData, latestConfig, this));
}
 
开发者ID:jasrodis,项目名称:javafx-dataviewer,代码行数:21,代码来源:DataViewer.java

示例4: getWebView

import javafx.scene.web.WebView; //导入方法依赖的package包/类
protected WebView getWebView() {
    if (engine == null) {
        webView = new WebView();
        webView.setContextMenuEnabled(false);
        engine = webView.getEngine();
    }
    return webView;
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:9,代码来源:SamplePage.java

示例5: Editor

import javafx.scene.web.WebView; //导入方法依赖的package包/类
public Editor() {
	WebView view = new WebView();
	view.setFontSmoothingType(FontSmoothingType.GRAY); // looks better than colored (LCD) blurring IMO

	// caching with SPEED hint is awful on Linux and or low power machines (see issue #24)
	// caching with QUALITY hint is indistinguishable from no caching as far as I can tell
	// to to remove potential problems it's probably not worth enabling caching at all
	view.setCache(false);

	pageLoaded = false;
	bridge = new Bridge(this);

	engine = view.getEngine();
	engine.setJavaScriptEnabled(true);

	// these error messages seem useless because they only warn about re-using web cache directories
	// which means that opening multiple instances of Simulizer gives error messages because both are trying to access
	// ~/.simulizer.GuiMode$App and ~/.simulizer.Simulizer
	//engine.setOnError((errorEvent) -> UIUtils.showErrorDialog("Editor JS Error", errorEvent.toString()));

	// making it so calling alert() from javascript outputs to the console
	engine.setOnAlert((event) -> System.out.println("javascript alert: " + event.getData()));

	mode = Mode.EDIT_MODE;

	// javascript does not have access to the outside clipboard
	view.setContextMenuEnabled(false);

	// handle copy and paste and other key-combinations manually
	getEventManager().addEventFilter(KeyEvent.KEY_PRESSED, this::handleKeyEvent);

	getContentPane().getChildren().add(view);
}
 
开发者ID:mbway,项目名称:Simulizer,代码行数:34,代码来源:Editor.java

示例6: CodeEditor

import javafx.scene.web.WebView; //导入方法依赖的package包/类
public CodeEditor()
{
	webView = new WebView();
	aceEditor = new AceEditor();
	
	codeBodyProperty = aceEditor.getBodyProperty();
	acePageContentsProperty = aceEditor.getPage();
	
	initializeEngineEvents();
	
	webView.getEngine().loadContent(aceEditor.getPage().get());
	
	// Add interface to access Java model from Javascript
	JSObject jsObject = (JSObject) webView.getEngine().executeScript("window");
	jsObject.setMember("javaContentModel", this);
	
	acePageContentsProperty.addListener((observable, old, newValue) -> 
	{
		System.out.println("Loaded:\n" + newValue);
		webView.getEngine().loadContent(newValue);
	});
	
	codeBodyProperty.addListener(
			(observable, old, newValue) -> System.out.println("CodeProperty changed"));
	
	webView.setContextMenuEnabled(false);
	//TODO create custom context menu (right click menu)
	
	// TODO: move this to a js file
	aceEditor.addCustomJavascriptRoutine(() -> "editor.on(\"change\", function() {"
			+ "javaContentModel.updateTextFromJavascript(editor.getValue());"
			+ "});");

	setOnKeyReleased(event -> {
		System.out.println("key released");
		getBreakPoints();
	});

	setCenter(webView);
	this.accessibleRoleProperty().set(AccessibleRole.TEXT_AREA);
}
 
开发者ID:dhawal9035,项目名称:WebPLP,代码行数:42,代码来源:CodeEditor.java


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