📄 xhistorylayout.java
字号:
/****************************************************************
* XBrowser - eXtended web Browser *
* *
* Copyright (c) 2000-2001 Armond Avanes *
* Refer to ReadMe & License files for more information *
* *
* *
* By: Armond Avanes *
* Armond555@yahoo.com & Armond333@yahoo.com *
* http://xbrowser.sourceforge.net/ *
*****************************************************************/
package xbrowser.screen;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import xbrowser.*;
import xbrowser.util.*;
import xbrowser.widgets.*;
import xbrowser.history.*;
public class XHistoryLayout extends XFrame
{
public XHistoryLayout()
{
setTitle( XRepository.getResourceManager().getProperty(this, "Title") );
XHistoryTable history_table = new XHistoryTable();
getContentPane().setLayout( new BorderLayout() );
getContentPane().add(new JScrollPane(history_table), BorderLayout.CENTER);
getContentPane().add(getButtonsPanel(history_table),BorderLayout.SOUTH);
setIconImage( buildImageIcon(this, "image.FrameIcon").getImage() );
setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE);
pack();
Dimension size = getSize();
size.height = 350;
setSize(size);
}
private JPanel getButtonsPanel(XHistoryTable history_table)
{
JPanel pnl = new JPanel(new FlowLayout(FlowLayout.RIGHT));
JButton btn_close = buildButton(new CloseAction());
pnl.add(buildButton(history_table.goToPageAction));
pnl.add(buildButton(history_table.addToBookmarksAction));
pnl.add(buildButton(history_table.deleteAction));
pnl.add(buildButton(new ClearHistoryAction()));
pnl.add(buildButton(new SearchHistoryAction()));
pnl.add(buildButton(history_table.copyAction));
pnl.add(btn_close);
getRootPane().setDefaultButton(btn_close);
return pnl;
}
private class ClearHistoryAction extends XDefaultAction
{
public ClearHistoryAction()
{
super(XHistoryLayout.this, "ClearHistory", null);
}
public void actionPerformed(ActionEvent e)
{
XRepository.getHistoryManager().clearHistory();
}
}
private class SearchHistoryAction extends XDefaultAction
{
public SearchHistoryAction()
{
super(XHistoryLayout.this, "SearchHistory", null);
}
public void actionPerformed(ActionEvent e)
{
XRepository.getScreenManager().getFindLayout2(XFindLayout2.SEARCH_HISTORY).setVisible(true);
}
}
private class CloseAction extends XDefaultAction
{
public CloseAction()
{
super(XHistoryLayout.this, "Close", null);
}
public void actionPerformed(ActionEvent e)
{
setVisible(false);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -