Package xtwm.plugins
Class DesktopPager
- java.lang.Object
-
- jexer.TWidget
-
- xtwm.plugins.PluginWidget
-
- xtwm.plugins.DesktopPager
-
- All Implemented Interfaces:
java.lang.Comparable<TWidget>
public class DesktopPager extends PluginWidget
DesktopPager is a simple desktop pager in the style of classic X11 virtual desktop pagers like OLWM and AfterStep.
-
-
Field Summary
-
Fields inherited from class xtwm.plugins.PluginWidget
app, loadOnStartup, pluginEnabled
-
-
Constructor Summary
Constructors Constructor Description DesktopPager()
No-argument constructor that is intended only for use by XTWMApplication.loadPlugin().DesktopPager(TWidget parent)
Public constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getApplicationCommand()
Get the command line to execute if this is an "Application" plugin.java.lang.String
getMenuMnemonic()
Get the translated menu label for this plugin.java.lang.String
getPluginDescription()
Get the translated full description for this plugin.java.lang.String
getPluginName()
Get the translated short name for this plugin.TWidget
getPluginSettingsEditor(TWidget parent)
Get an interface for editing the plugin settings.int
getPreferredHeight()
Get the desired height when rendering this plugin.int
getPreferredWidth()
Get the desired width when rendering this plugin.TWindow
getWindow(XTWMApplication application)
Get the window that will be used for this plugin when isWindowed() is true.java.lang.String
getWindowTitle()
Get the translated window title for this plugin.void
initialize(XTWMApplication app)
Initialize the plugin.boolean
isApplication()
See if this is an "Application" plugin.boolean
isOnAllDesktops()
Whether or not this plugin should be on all desktops when loaded as a widget at startup.boolean
isResizable()
Check if widget should be in a resizable window.boolean
isWidget()
See if this is a "Widget" plugin.void
onResize(TResizeEvent resize)
Handle window/screen resize events.void
refreshDesktops()
Refresh the buttons to match the number of desktops.-
Methods inherited from class xtwm.plugins.PluginWidget
closeFromMenu, getOption, getOption, isLoadOnStartup, isPluginEnabled, isWindowed, makeDataFile, onMenu, setLoadOnStartup, setOption, setPluginEnabled
-
Methods inherited from class jexer.TWidget
activate, activate, activate, activateAll, addButton, addCalendar, addCheckBox, addCheckBox, addComboBox, addDirectoryList, addDirectoryList, addDirectoryList, addDirectoryList, addEditor, addField, addField, addField, addField, addImage, addImage, addLabel, addLabel, addLabel, addLabel, addLabel, addLabel, addList, addList, addList, addList, addPanel, addPasswordField, addPasswordField, addPasswordField, addProgressBar, addRadioGroup, addRadioGroup, addSpinner, addSplitPane, addTable, addTable, addText, addText, addTreeViewWidget, addTreeViewWidget, close, compareTo, doRepaint, draw, drawBox, drawBox, drawBoxShadow, drawChildren, fileOpenBox, fileOpenBox, fileOpenBox, fileOpenBox, fileSaveBox, getAbsoluteX, getAbsoluteY, getActiveChild, getApplication, getAttrXY, getChildren, getClipboard, getCursorAbsoluteX, getCursorAbsoluteY, getCursorX, getCursorY, getHeight, getLayoutManager, getParent, getScreen, getTheme, getWidth, getWindow, getX, getY, handleEvent, hasChild, hLineXY, inputBox, inputBox, inputBox, isAbsoluteActive, isActive, isCursorVisible, isDrawable, isEchoKeystrokes, isEnabled, isVisible, messageBox, messageBox, mouseWouldHit, onCommand, onIdle, onKeypress, onMouseDoubleClick, onMouseDown, onMouseMotion, onMouseUp, putAll, putAttrXY, putAttrXY, putCharXY, putCharXY, putCharXY, putStringXY, putStringXY, remove, remove, remove, remove, removeAll, resetTabOrder, setActive, setCursorVisible, setCursorX, setCursorY, setDimensions, setEchoKeystrokes, setEchoKeystrokes, setEnabled, setHeight, setLayoutManager, setParent, setupForTWindow, setVisible, setWidth, setWindow, setX, setY, splitHorizontal, splitVertical, switchWidget, toPrettyString, toPrettyString, toString, vLineXY
-
-
-
-
Constructor Detail
-
DesktopPager
public DesktopPager(TWidget parent)
Public constructor.- Parameters:
parent
- parent widget
-
DesktopPager
public DesktopPager()
No-argument constructor that is intended only for use by XTWMApplication.loadPlugin().
-
-
Method Detail
-
onResize
public void onResize(TResizeEvent resize)
Handle window/screen resize events.
-
getMenuMnemonic
public java.lang.String getMenuMnemonic()
Get the translated menu label for this plugin.- Specified by:
getMenuMnemonic
in classPluginWidget
- Returns:
- a mnemonic string that will be populated in the menu
-
getPluginName
public java.lang.String getPluginName()
Get the translated short name for this plugin.- Specified by:
getPluginName
in classPluginWidget
- Returns:
- a short name, e.g. "DesktopPager"
-
getPluginDescription
public java.lang.String getPluginDescription()
Get the translated full description for this plugin.- Specified by:
getPluginDescription
in classPluginWidget
- Returns:
- a short name, e.g. "A desktop pager allowing one to change the active desktop by clicking."
-
initialize
public void initialize(XTWMApplication app)
Initialize the plugin. Since plugins are required to have a no-argument constructor, this method is called to provide a hook for the plugin to perform initialization. Subclasses that override initialize should call super.initialize() to set the XTWMApplication reference.- Overrides:
initialize
in classPluginWidget
- Parameters:
app
- the application that will be using this plugin
-
isApplication
public boolean isApplication()
See if this is an "Application" plugin.- Specified by:
isApplication
in classPluginWidget
- Returns:
- true if this plugin should be listed the Application | Programs menu
-
getApplicationCommand
public java.lang.String getApplicationCommand()
Get the command line to execute if this is an "Application" plugin.- Specified by:
getApplicationCommand
in classPluginWidget
- Returns:
- a command line
-
isWidget
public boolean isWidget()
See if this is a "Widget" plugin.- Specified by:
isWidget
in classPluginWidget
- Returns:
- true if this plugin should be available in the Application | Widgets meny and the Panel | "Switch to" dialog
-
getWindowTitle
public java.lang.String getWindowTitle()
Get the translated window title for this plugin.- Specified by:
getWindowTitle
in classPluginWidget
- Returns:
- the title for the window when this widget is opened in the Application | Widgets menu, or null if this widget should have no title for its window.
-
isOnAllDesktops
public boolean isOnAllDesktops()
Whether or not this plugin should be on all desktops when loaded as a widget at startup.- Overrides:
isOnAllDesktops
in classPluginWidget
- Returns:
- true if this plugin should be on all desktops
-
getPluginSettingsEditor
public TWidget getPluginSettingsEditor(TWidget parent)
Get an interface for editing the plugin settings.- Overrides:
getPluginSettingsEditor
in classPluginWidget
- Parameters:
parent
- parent widget- Returns:
- a widget that has settings
-
getPreferredWidth
public int getPreferredWidth()
Get the desired width when rendering this plugin.- Specified by:
getPreferredWidth
in classPluginWidget
- Returns:
- the width
-
getPreferredHeight
public int getPreferredHeight()
Get the desired height when rendering this plugin.- Specified by:
getPreferredHeight
in classPluginWidget
- Returns:
- the height
-
isResizable
public boolean isResizable()
Check if widget should be in a resizable window.- Overrides:
isResizable
in classPluginWidget
- Returns:
- true if the widget should be resizable when in a window
-
getWindow
public TWindow getWindow(XTWMApplication application)
Get the window that will be used for this plugin when isWindowed() is true. The plugin will be reparented inside this window.- Overrides:
getWindow
in classPluginWidget
- Parameters:
application
- the application- Returns:
- the window
-
refreshDesktops
public void refreshDesktops()
Refresh the buttons to match the number of desktops.
-
-