/*
* Copyright (c) 2000-2017 TeamDev Ltd. All rights reserved.
* TeamDev PROPRIETARY and CONFIDENTIAL.
* Use is subject to license terms.
*/
package com.teamdev.jxbrowser.chromium.demo;
import com.teamdev.jxbrowser.chromium.Browser;
import com.teamdev.jxbrowser.chromium.BrowserPreferences;
import com.teamdev.jxbrowser.chromium.EditorCommand;
import com.teamdev.jxbrowser.chromium.SavePageType;
import com.teamdev.jxbrowser.chromium.demo.resources.Resources;
import com.teamdev.jxbrowser.chromium.events.*;
import com.teamdev.jxbrowser.chromium.swing.BrowserView;
import javax.swing.*;
import javax.swing.event.MenuEvent;
import javax.swing.event.MenuListener;
import java.awt.*;
import java.awt.event.*;
import java.io.File;
/**
* @author TeamDev Ltd.
*/
public class ToolBar extends JPanel {
private static final String RUN_JAVASCRIPT = "Run JavaScript...";
private static final String CLOSE_JAVASCRIPT = "Close JavaScript Console";
private static final String DEFAULT_URL = "about:blank";
private JButton backwardButton;
private JButton forwardButton;
private JButton refreshButton;
private JButton stopButton;
private JMenuItem consoleMenuItem;
private final JTextField addressBar;
private final BrowserView browserView;
public ToolBar(BrowserView browserView) {
this.browserView = browserView;
addressBar = createAddressBar();
setLayout(new GridBagLayout());
add(createActionsPane(), new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST,
GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
add(addressBar, new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0,
GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(4, 0, 4, 5), 0, 0));
add(createMenuButton(), new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0,
GridBagConstraints.LINE_END, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 5), 0, 0));
}
public void didJSConsoleClose() {
consoleMenuItem.setText(RUN_JAVASCRIPT);
}
private JPanel createActionsPane() {
backwardButton = createBackwardButton(browserView.getBrowser());
forwardButton = createForwardButton(browserView.getBrowser());
refreshButton = createRefreshButton(browserView.getBrowser());
stopButton = createStopButton(browserView.getBrowser());
JPanel actionsPanel = new JPanel();
actionsPanel.add(backwardButton);
actionsPanel.add(forwardButton);
actionsPanel.add(refreshButton);
actionsPanel.add(stopButton);
return actionsPanel;
}
private JTextField createAddressBar() {
final JTextField result = new JTextField(DEFAULT_URL);
result.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
browserView.getBrowser().loadURL(result.getText());
}
});
browserView.getBrowser().addLoadListener(new LoadAdapter() {
@Override
public void onStartLoadingFrame(StartLoadingEvent event) {
if (event.isMainFrame()) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
refreshButton.setEnabled(false);
stopButton.setEnabled(true);
}
});
}
}
@Override
public void onProvisionalLoadingFrame(final ProvisionalLoadingEvent event) {
if (event.isMainFrame()) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
result.setText(event.getURL());
result.setCaretPosition(result.getText().length());
Browser browser = event.getBrowser();
forwardButton.setEnabled(browser.canGoForward());
backwardButton.setEnabled(browser.canGoBack());
}
});
}
}
@Override
public void onFinishLoadingFrame(final FinishLoadingEvent event) {
if (event.isMainFrame()) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
refreshButton.setEnabled(true);
stopButton.setEnabled(false);
}
});
}
}
});
return result;
}
private static JButton createBackwardButton(final Browser browser) {
return createButton("Back", new AbstractAction() {
public void actionPerformed(ActionEvent e) {
browser.goBack();
}
});
}
private static JButton createForwardButton(final Browser browser) {
return createButton("Forward", new AbstractAction() {
public void actionPerformed(ActionEvent e) {
browser.goForward();
}
});
}
private static JButton createRefreshButton(final Browser browser) {
return createButton("Refresh", new AbstractAction() {
public void actionPerformed(ActionEvent e) {
browser.reload();
}
});
}
private static JButton createStopButton(final Browser browser) {
return createButton("Stop", new AbstractAction() {
public void actionPerformed(ActionEvent e) {
browser.stop();
}
});
}
private static JButton createButton(String caption, Action action) {
ActionButton button = new ActionButton(caption, action);
String imageName = caption.toLowerCase();
button.setIcon(Resources.getIcon(imageName + ".png"));
button.setRolloverIcon(Resources.getIcon(imageName + "-selected.png"));
return button;
}
private JComponent createMenuButton() {
final JPopupMenu popupMenu = new JPopupMenu();
popupMenu.add(createConsoleMenuItem());
popupMenu.add(createGetHTMLMenuItem());
popupMenu.add(createPopupsMenuItem());
popupMenu.add(createUploadFileMenuItem());
popupMenu.add(createDownloadFileMenuItem());
popupMenu.add(createJavaScriptDialogsMenuItem());
popupMenu.add(createPDFViewerMenuItem());
popupMenu.add(createFlashMenuItem());
popupMenu.add(createGoogleMapsMenuItem());
popupMenu.add(createHTML5VideoMenuItem());
popupMenu.add(createZoomInMenuItem());
popupMenu.add(createZoomOutMenuItem());
popupMenu.add(createActualSizeMenuItem());
popupMenu.add(createSaveWebPageMenuItem());
popupMenu.add(createClearCacheMenuItem());
popupMenu.add(createPreferencesSubMenu());
popupMenu.add(createExecuteCommandSubMenu());
popupMenu.add(createPrintMenuItem());
popupMenu.addSeparator();
popupMenu.add(createMoreMenuItem());
popupMenu.addSeparator();
popupMenu.add(createAboutMenuItem());
final ActionButton button = new ActionButton("Preferences", null);
button.setIcon(Resources.getIcon("gear.png"));
button.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) {
if ((e.getModifiers() & InputEvent.BUTTON1_MASK) != 0) {
popupMenu.show(e.getComponent(), 0, button.getHeight());
} else {
popupMenu.setVisible(false);
}
}
});
return button;
}
private Component createPrintMenuItem() {
JMenuItem menuItem = new JMenuItem("Print...");
menuItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
没有合适的资源?快使用搜索试试~ 我知道了~
jxbrowser6.14 破解版 全系统都支持+demo
共1691个文件
class:1435个
java:141个
png:29个
5星 · 超过95%的资源 需积分: 40 410 下载量 66 浏览量
2017-11-10
15:37:37
上传
评论 11
收藏 36.73MB ZIP 举报
温馨提示
里面有2个类是破解类,其他的jar包如果不放心我的可以去官方下载,支持所有的操作系统,6.14是最后一个支持Linux32的版本了,现在免费开放给大家,别人都是破解jar,我直接吧破解代码给你,下载导入eclipse就可以跑,直接不需要license文件。
资源推荐
资源详情
资源评论
收起资源包目录
jxbrowser6.14 破解版 全系统都支持+demo (1691个子文件)
Browser.class 76KB
MessageType.class 40KB
LightWeightWidget.class 29KB
LightWeightWidgetView.class 25KB
NetworkService$a.class 21KB
HeavyWeightWidget.class 19KB
JSContext.class 18KB
HeavyWeightWidget.class 16KB
IPC.class 15KB
ToolBar.class 15KB
NetError.class 13KB
PrintDialog.class 13KB
PrintDialog.class 13KB
DOMFactory.class 12KB
BrowserKeyEvent$KeyCode.class 12KB
PaperSize.class 11KB
Document.class 10KB
NativeKeyCodes.class 10KB
Node.class 10KB
NativeKeyCodes.class 10KB
ao.class 10KB
Browser$c.class 10KB
DialogHandlerDelegate.class 9KB
SocketChannel.class 8KB
BrowserPreferences.class 8KB
CursorType.class 8KB
ay.class 8KB
ay.class 8KB
LightWeightWidget.class 8KB
DefaultDialogHandler.class 7KB
CursorType.class 7KB
MutableDownloadItem.class 7KB
Certificate.class 7KB
BrowserView.class 7KB
ai.class 7KB
DefaultDialogHandler.class 7KB
LightWeightWidget$k.class 7KB
BrowserView.class 7KB
FileUtil.class 7KB
DragAndDropSupport$a.class 6KB
ChromiumProcess.class 6KB
Browser$e.class 6KB
EventTarget.class 6KB
DataMessage.class 6KB
PrintDialogModel.class 6KB
JSObject.class 6KB
PrintDialog$a.class 6KB
al.class 6KB
CommonMessage.class 6KB
LightWeightPopup.class 6KB
LightWeightPopup.class 6KB
ForwardMouseEventsSample.class 6KB
FXUtil.class 6KB
EditorCommand.class 6KB
NetworkService.class 6KB
TabbedPane.class 6KB
ax.class 6KB
DragAndDropSupport.class 5KB
Server.class 5KB
j.class 5KB
Notification.class 5KB
HttpHeadersExImpl.class 5KB
XPathResult.class 5KB
bj.class 5KB
BrowserContext.class 5KB
SelectDialog.class 5KB
JSConsole.class 5KB
ChromiumProfileLock.class 5KB
MemoryChannelWriter.class 4KB
BrowserMouseEvent$BrowserMouseEventBuilder.class 4KB
Environment.class 4KB
Element.class 4KB
TabContent.class 4KB
JxBrowserDemo.class 4KB
LightWeightWidget$d.class 4KB
DefaultNetworkDelegate.class 4KB
MemoryChannelReader.class 4KB
SpellCheckerService.class 4KB
UploadDataUtils.class 4KB
ExternalChromiumProcessLinux.class 4KB
ContextMenuParams.class 4KB
PrintSettings.class 4KB
MultipartFormData.class 4KB
ProtocolService$a.class 4KB
Dialog.class 4KB
HttpStatus.class 4KB
AboutDialog.class 4KB
TabCaption$TabCaptionComponent.class 4KB
DragAndDropSupport.class 4KB
BrowserMouseEvent.class 4KB
ChromiumExtractor.class 4KB
m.class 4KB
ad.class 4KB
JSFunction.class 4KB
ProtocolService.class 4KB
MultipartFormDataParser.class 4KB
ZoomService.class 4KB
HttpHeadersImpl.class 4KB
bu.class 4KB
ExternalChromiumProcess.class 4KB
共 1691 条
- 1
- 2
- 3
- 4
- 5
- 6
- 17
陕西小伙伴网络科技有限公司
- 粉丝: 127
- 资源: 39
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 软件仿真多机串行通信.doc
- Python大作业:音乐播放软件(爬虫+可视化+数据分析+数据库)
- 课程设计-python爬虫-爬取日报,爬取日报文章后存储到本地,附带源代码+课程设计报告
- 软件和信息技术服务行业投资与前景预测.pptx
- 课程设计-基于SpringBoot + Mybatis+python爬虫NBA球员数据爬取可视化+源代码+文档+sql+效果图
- 软件品质管理系列二项目策划规范.doc
- 基于TensorFlow+PyQt+GUI的酒店评论情感分析,支持分析本地数据文件和网络爬取数据分析+源代码+文档说明+安装教程
- 软件定义无线电中的模拟电路测试技术.pptx
- 软件开发协议(作为技术开发合同附件).doc
- 软件开发和咨询行业技术趋势分析.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
- 4
- 5
- 6
前往页