public class GralViewFileContent extends GralWidgetBase
GralWidgetBase.GralWidgComposite, GralWidgetBase.TimeOrderCreateImplWidget
Modifier and Type | Field and Description |
---|---|
(package private) GralUserAction |
actionFind
Action for Key F3 for view command.
|
(package private) GralUserAction |
actionOnSetInvisible |
GralUserAction |
actionOpenView
Action for Key F3 for view command.
|
GralUserAction |
actionQuickView
Action for Key crl-Q for quick view command.
|
(package private) GralUserAction |
actionSave |
(package private) GralUserAction |
actionSaveTextAsISO8859_1_unix |
(package private) GralUserAction |
actionSaveTextAsUTF8unix |
(package private) GralUserAction |
actionSaveTextAsWindows |
(package private) GralUserAction |
actionSetEditable
Action for Key F3 for view command.
|
(package private) GralUserAction |
actionSetHexView
Action for Key F3 for view command.
|
(package private) GralUserAction |
actionSetTextViewISO8859_1
Action for Key F3 for view command.
|
(package private) GralUserAction |
actionSetTextViewUTF8
Action for Key F3 for view command.
|
private static java.nio.charset.Charset |
ascii7 |
(package private) boolean |
bEditable |
private GralButton |
btnCase |
private GralButton |
btnFind |
private GralButton |
btnQuickview |
private GralButton |
btnWholeword |
(package private) boolean |
bVisible |
private int |
cursorPos |
private java.nio.charset.Charset |
encodingContent |
private static byte[] |
endl_0a |
private static byte[] |
endl_0d0a |
(package private) FileRemote |
file |
private char |
format
The current choiced view format.
|
private StringFormatter |
formatterHex
Instance to prepare the text especially for hex view.
|
(package private) GralMng |
gralMng |
private static java.nio.charset.Charset |
iso8859_1 |
(package private) LogMessage |
log |
(package private) int |
nrQuickview |
private java.nio.ByteBuffer |
tmpReadTransmissionBuffer
A buffer to get bytes from the file using the java.nio.Channel mechanism.
|
private byte[] |
uContent
The gotten bytes from bytebuffer.
|
(package private) GralTextFieldUser_ifc |
userKeys |
private static java.nio.charset.Charset |
utf8 |
static java.lang.String |
version
Version, history and license.
|
private GralTextBox |
widgContent
The widget to show content.
|
private GralTextField |
widgFindText |
private GralTextBox |
widgQuickView |
private GralTextField |
widgShowInfo |
private GralWindow |
windView
The window of this functionallity.
|
private int |
zContent
Number of read bytes.
|
_cdata, _wdgPos, bVisibleState, name, pixSize, sVersion
Constructor and Description |
---|
GralViewFileContent(GralPos refPosP,
java.lang.String posName) |
Modifier and Type | Method and Description |
---|---|
(package private) void |
closeQuickView() |
boolean |
createImplWidget_Gthread()
This operation is called to create the implementation widget appearance.
|
(package private) void |
detectEncoding() |
GralWidgetBase_ifc |
getFocusedWidget()
Returns the widget which is in focus of a panel or comprehensive widget.
|
boolean |
isInFocus()
Returns true if this widget is the focused one.
|
boolean |
isVisible()
Returns whether the widget is visible or not.
|
(package private) void |
openQuickView(FileRemote src) |
(package private) void |
presentContent() |
(package private) void |
presentContentHex() |
(package private) void |
presentContentText(java.nio.charset.Charset charset) |
void |
quickView()
This routine will be called whenever a file is selected newly, it checks quickview.
|
void |
removeImplWidget_Gthread()
Removes the implementation widget, maybe to re-create with changed properties
or also if the GralWidget itself should be removed.
|
(package private) void |
saveTextAs(java.nio.charset.Charset encoding,
byte[] lineEnd) |
void |
setFocus()
Sets the focus to the widget. .
|
void |
setFocus(int delay,
int latest) |
void |
setFocusedWidget(GralWidgetBase_ifc widg)
If this widget is a comprehensive widget or a panel, it sets one of the content as focused.
|
boolean |
setVisible(boolean visible)
Sets this widget visible on graphic or invisible.
|
(package private) void |
syncContentFromWidg() |
(package private) void |
syncHexFromWidg() |
(package private) void |
syncTextFromWidg(java.nio.charset.Charset charset) |
(package private) void |
view(FileRemote file)
Reads the current (last selected) file in the binary content buffer,
detects its encoding, shows it.
|
checkImplWidgetCreation, createImplWidget, getImplAccess, getName, gralMng, hasFocus, pos, remove, resizePostPreparation, setFocused, toString, toString
public static final java.lang.String version
final GralMng gralMng
final LogMessage log
private GralWindow windView
private GralTextBox widgContent
private GralTextField widgFindText
private GralTextField widgShowInfo
private GralButton btnFind
private GralButton btnWholeword
private GralButton btnCase
private GralButton btnQuickview
boolean bVisible
boolean bEditable
int nrQuickview
private GralTextBox widgQuickView
FileRemote file
private final java.nio.ByteBuffer tmpReadTransmissionBuffer
private int zContent
private final byte[] uContent
private java.nio.charset.Charset encodingContent
private char format
private int cursorPos
private static java.nio.charset.Charset ascii7
private static java.nio.charset.Charset utf8
private static java.nio.charset.Charset iso8859_1
private static byte[] endl_0a
private static byte[] endl_0d0a
private final StringFormatter formatterHex
public GralUserAction actionQuickView
GralUserAction actionFind
public GralUserAction actionOpenView
GralUserAction actionSetTextViewUTF8
GralUserAction actionSetHexView
GralUserAction actionSetTextViewISO8859_1
GralUserAction actionSetEditable
GralUserAction actionSave
GralUserAction actionSaveTextAsUTF8unix
GralUserAction actionSaveTextAsWindows
GralUserAction actionSaveTextAsISO8859_1_unix
GralUserAction actionOnSetInvisible
GralTextFieldUser_ifc userKeys
public GralViewFileContent(GralPos refPosP, java.lang.String posName)
void view(FileRemote file)
src
- The path which is selected as source. It may be a directory or a file.public void quickView()
void detectEncoding()
void presentContent() throws java.io.IOException
java.io.IOException
void presentContentHex() throws java.io.IOException
java.io.IOException
void presentContentText(java.nio.charset.Charset charset) throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
void syncContentFromWidg()
void syncHexFromWidg()
void syncTextFromWidg(java.nio.charset.Charset charset)
void saveTextAs(java.nio.charset.Charset encoding, byte[] lineEnd)
void openQuickView(FileRemote src)
void closeQuickView()
public void setFocus()
GralWidgetBase_ifc
public void setFocus(int delay, int latest)
public boolean isInFocus()
GralWidgetBase_ifc
public boolean isVisible()
GralWidgetBase_ifc
isVisible
in interface GralWidgetBase_ifc
isVisible
in class GralWidgetBase
public void setFocusedWidget(GralWidgetBase_ifc widg)
GralWidgetBase_ifc
widg
- The sub widget which should be focused.
It influences for example the current tab of a tabbed panel,
or influences which widget of a comprehensive widget is first focused.
On a panel it determines which widget should get the focus if the panel gets the focus.public GralWidgetBase_ifc getFocusedWidget()
GralWidgetBase_ifc
public boolean setVisible(boolean visible)
GralWidgetBase_ifc
GralWindow
, its the visibility of the whole window.
Note that a window which is invisible is not shown in the task bar of the operation system.
Note that an application can have more as one window.
Note that a dialog window can be set to invisible if it is not need yet instead destroy and build newly.setVisible
in interface GralWidgetBase_ifc
setVisible
in class GralWidgetBase
public boolean createImplWidget_Gthread() throws java.lang.IllegalStateException
GralWidgetBase
GralWidget
by the default behavior.
Or it should be overridden in instances which are not derived from GralWidget itself,
on instances of comprehensive widgets.
This implementation is only called in GralWidget.createImplWidget_Gthread()
for composite widgets.createImplWidget_Gthread
in class GralWidgetBase
java.lang.IllegalStateException
- if called though the GralMng is not implemented.public void removeImplWidget_Gthread()
GralWidgetBase
GralMng.runGraphicThread()
and hence package private.removeImplWidget_Gthread
in class GralWidgetBase