本文整理汇总了Java中javafx.scene.web.WebHistory类的典型用法代码示例。如果您正苦于以下问题:Java WebHistory类的具体用法?Java WebHistory怎么用?Java WebHistory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WebHistory类属于javafx.scene.web包,在下文中一共展示了WebHistory类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: goBack
import javafx.scene.web.WebHistory; //导入依赖的package包/类
public void goBack(){
final WebHistory history = webEngine.getHistory();
ObservableList<WebHistory.Entry> entryList = history.getEntries();
int currentIndex = history.getCurrentIndex();
Platform.runLater(new Runnable() {
@Override
public void run() {
try {
history.go(-1);
}catch(Exception e){
webEngine.loadContent(body);
}
}
});
}
开发者ID:ashoknailwal,项目名称:desktop-gmail-client,代码行数:16,代码来源:ZoomInMailView.java
示例2: HTMLView
import javafx.scene.web.WebHistory; //导入依赖的package包/类
public HTMLView() {
viewport = ToolBarContainer.createDefaultContainer(Orientation.RIGHT);
webView = new WebView();
viewport.setContent(webView);
VLToolBar bar = new VLToolBar();
Button openInBrowser = FXUIUtils.createButton("open-in-browser", "Open in External Browser", true);
Button prevPage = FXUIUtils.createButton("prev", "Previous Page", false);
WebHistory history = webView.getEngine().getHistory();
prevPage.setOnAction((event) -> {
history.go(-1);
});
bar.add(prevPage);
Button nextPage = FXUIUtils.createButton("next", "Next Page", false);
nextPage.setOnAction((event) -> {
history.go(1);
});
bar.add(nextPage);
openInBrowser.setOnAction((event) -> {
try {
URI uri = ProjectHTTPDServer.getURI(fileHandler.getCurrentFile().toPath());
if (uri != null)
Desktop.getDesktop().browse(uri);
else
Desktop.getDesktop().open(fileHandler.getCurrentFile());
} catch (IOException e) {
e.printStackTrace();
}
});
bar.add(openInBrowser);
history.currentIndexProperty().addListener((ob, o, n) -> {
nextPage.setDisable(n.intValue() == history.getEntries().size() - 1);
prevPage.setDisable(n.intValue() == 0);
});
viewport.getToolBarPanel().add(bar);
}
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:36,代码来源:HTMLView.java
示例3: addButtonsAvailabilityListeners
import javafx.scene.web.WebHistory; //导入依赖的package包/类
private void addButtonsAvailabilityListeners(JButton backButton, JButton forwardButton) {
Platform.runLater(() -> myEngine.getLoadWorker().stateProperty().addListener((ov, oldState, newState) -> {
if (newState == Worker.State.SUCCEEDED) {
final WebHistory history = myEngine.getHistory();
boolean isGoBackAvailable = history.getCurrentIndex() > 0;
boolean isGoForwardAvailable = history.getCurrentIndex() < history.getEntries().size() - 1;
ApplicationManager.getApplication().invokeLater(() -> {
backButton.setEnabled(isGoBackAvailable);
forwardButton.setEnabled(isGoForwardAvailable);
});
}
}));
}
开发者ID:medvector,项目名称:educational-plugin,代码行数:14,代码来源:StudyBrowserWindow.java
示例4: goBack
import javafx.scene.web.WebHistory; //导入依赖的package包/类
public String goBack() {
final WebHistory history = webEngine.getHistory();
ObservableList<WebHistory.Entry> entryList = history.getEntries();
int currentIndex = history.getCurrentIndex();
// Out("currentIndex = "+currentIndex);
// Out(entryList.toString().replace("],","]\n"));
if (currentIndex > 0) {
Platform.runLater(() -> {
history.go(-1);
});
}
return entryList.get(currentIndex > 0 ? currentIndex - 1 : currentIndex).getUrl();
}
开发者ID:bcgov,项目名称:sbc-qsystem,代码行数:14,代码来源:FInfoDialogWeb.java
示例5: goForward
import javafx.scene.web.WebHistory; //导入依赖的package包/类
public String goForward() {
final WebHistory history = webEngine.getHistory();
ObservableList<WebHistory.Entry> entryList = history.getEntries();
int currentIndex = history.getCurrentIndex();
// Out("currentIndex = "+currentIndex);
// Out(entryList.toString().replace("],","]\n"));
if (currentIndex < entryList.size() - 1) {
Platform.runLater(() -> {
history.go(1);
});
}
return entryList
.get(currentIndex < entryList.size() - 1 ? currentIndex + 1 : currentIndex)
.getUrl();
}
开发者ID:bcgov,项目名称:sbc-qsystem,代码行数:16,代码来源:FInfoDialogWeb.java
示例6: goBack
import javafx.scene.web.WebHistory; //导入依赖的package包/类
public String goBack() {
final WebHistory history = webEngine.getHistory();
ObservableList<WebHistory.Entry> entryList = history.getEntries();
int currentIndex = history.getCurrentIndex();
// Out("currentIndex = "+currentIndex);
// Out(entryList.toString().replace("],","]\n"));
Platform.runLater(() -> {
history.go(-1);
});
return entryList.get(currentIndex > 0 ? currentIndex - 1 : currentIndex).getUrl();
}
开发者ID:bcgov,项目名称:sbc-qsystem,代码行数:12,代码来源:BrowserFX.java
示例7: goForward
import javafx.scene.web.WebHistory; //导入依赖的package包/类
public String goForward() {
final WebHistory history = webEngine.getHistory();
ObservableList<WebHistory.Entry> entryList = history.getEntries();
int currentIndex = history.getCurrentIndex();
// Out("currentIndex = "+currentIndex);
// Out(entryList.toString().replace("],","]\n"));
Platform.runLater(() -> {
history.go(1);
});
return entryList
.get(currentIndex < entryList.size() - 1 ? currentIndex + 1 : currentIndex)
.getUrl();
}
开发者ID:bcgov,项目名称:sbc-qsystem,代码行数:14,代码来源:BrowserFX.java
示例8: getCurrentURL
import javafx.scene.web.WebHistory; //导入依赖的package包/类
@SuppressWarnings("restriction")
public String getCurrentURL() {
//history = engine.getHistory();
ObservableList<WebHistory.Entry> entryList = history.getEntries();
int currentIndex = history.getCurrentIndex();
String txt = null;
if (currentIndex >=0 ) {
txt = entryList.get(currentIndex).getUrl();
//System.out.println("currentIndex is " + currentIndex + " url is " + txt);
//Platform.runLater(() -> { history.go(0);} );
}
return txt;
}
开发者ID:mars-sim,项目名称:mars-sim,代码行数:14,代码来源:BrowserJFX.java
示例9: goBack
import javafx.scene.web.WebHistory; //导入依赖的package包/类
public String goBack()
{
final WebHistory history = engine.getHistory();
ObservableList<WebHistory.Entry> entryList=history.getEntries();
int currentIndex=history.getCurrentIndex();
// Out("currentIndex = "+currentIndex);
// Out(entryList.toString().replace("],","]\n"));
Platform.runLater(new Runnable() { public void run() { history.go(-1); } });
return entryList.get(currentIndex>0?currentIndex-1:currentIndex).getUrl();
}
开发者ID:BitcoinAuthenticator,项目名称:Wallet,代码行数:12,代码来源:OneNameControllerDisplay.java
示例10: goForward
import javafx.scene.web.WebHistory; //导入依赖的package包/类
public String goForward()
{
final WebHistory history=engine.getHistory();
ObservableList<WebHistory.Entry> entryList=history.getEntries();
int currentIndex=history.getCurrentIndex();
// Out("currentIndex = "+currentIndex);
// Out(entryList.toString().replace("],","]\n"));
Platform.runLater(new Runnable() { public void run() { history.go(1); } });
return entryList.get(currentIndex<entryList.size()-1?currentIndex+1:currentIndex).getUrl();
}
开发者ID:BitcoinAuthenticator,项目名称:Wallet,代码行数:12,代码来源:OneNameControllerDisplay.java
示例11: getHistory
import javafx.scene.web.WebHistory; //导入依赖的package包/类
/**
* @return the history
*/
public WebHistory getHistory() {
return history;
}
开发者ID:goxr3plus,项目名称:JavaFX-Web-Browser,代码行数:7,代码来源:WebBrowserTabController.java
示例12: setHistory
import javafx.scene.web.WebHistory; //导入依赖的package包/类
/**
* @param history
* the history to set
*/
public void setHistory(WebHistory history) {
this.history = history;
}
开发者ID:goxr3plus,项目名称:JavaFX-Web-Browser,代码行数:8,代码来源:WebBrowserTabController.java
注:本文中的javafx.scene.web.WebHistory类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论