public class NoticeView
extends org.eclipse.ui.part.ViewPart
CTabFolder
to
display multiple tabs. Each of these may show
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
ALL_IDS
Key for to store the array with item IDs in the @
settings |
private org.eclipse.jface.action.Action |
clearAction
Action to clear the tab contents
|
static java.lang.String |
COLCOUNT_SETTINGS |
private org.eclipse.jface.dialogs.IDialogSettings |
colCountSettings
Stores the number of columns of a table tab
|
private static java.lang.String |
DEFAULT_TITLE |
private static java.lang.String |
DEFAULT_TYPE |
private static java.lang.String |
EXPORT_FILE_NAME_PREFIX
Default name of the file which is used to save exported data.
|
private org.eclipse.jface.action.Action |
exportAction
Action to export the tab contents
|
static java.lang.String |
ID
ID of the view as specified by the extension.
|
private org.eclipse.ui.IMemento |
memento
Stores the setting of the tab folder.
|
private org.eclipse.jface.action.Action |
newTabAction
Action to create an new tab
|
private NoticeComposite |
noticeComp
The NoticeComposite instance shown by a CTabItem.
|
private org.eclipse.jface.dialogs.IDialogSettings |
settings
Store the contents of the tabs.
|
private org.eclipse.swt.custom.CTabFolder |
tabFolder
Contains the tabs of the view
|
private static java.lang.String |
TITLE_SETTINGS |
private org.eclipse.jface.dialogs.IDialogSettings |
titleSettings
Stores the titles of the tabs.The key is a randomly generated String as
it is done by
UUID.randomUUID() . |
private static java.lang.String |
TYPE_SETTINGS |
private org.eclipse.jface.dialogs.IDialogSettings |
typeSettings
Store the types of the tabs.
|
Constructor and Description |
---|
NoticeView() |
Modifier and Type | Method and Description |
---|---|
private void |
clearList()
Deletes all data in a
NoticeList . |
private void |
clearTable()
Deletes all data in a
NoticeTable . |
private void |
clearText()
Deletes all data in a
NoticeText . see comment:
getActItemContents() |
private void |
contributeToActionBars()
Creates the toolbar of the view
|
private java.lang.String |
createID() |
void |
createPartControl(org.eclipse.swt.widgets.Composite parent)
Initialises the
CTabFolder of the view and creates the tabs. |
void |
createTab()
Overloading @
createTab(String, String, String, String) . |
private void |
createTab(java.lang.String id,
java.lang.String title,
java.lang.String type,
java.lang.String colCount)
Creates a new tab, registering the tab with its settings.
|
private void |
deleteActItemContents()
Deletes the contents of the selected tab
|
private void |
export()
Create a file dialog to export the data displayed by the actually visible
tab item.
|
private void |
fillLocalToolBar(org.eclipse.jface.action.IToolBarManager manager)
Create the toolbar
|
private java.lang.String |
getActItemContents()
Gets the contents of the selected tab as a String.
|
void |
init(org.eclipse.ui.IViewSite site,
org.eclipse.ui.IMemento memento) |
private void |
makeActions()
Create the actions of the view's toolbar.
|
private void |
renameTab(org.eclipse.swt.custom.CTabItem item)
Changes the item title and stores it in the settings.
|
void |
saveState(org.eclipse.ui.IMemento memento)
Saves the IDs of the tabs in an
IMemento . |
void |
setFocus() |
private void |
storeAllItemIDs()
Saves all item titles in an array and stores it in the settings.
|
checkSite, getViewSite, init, setContentDescription, setInitializationData, setPartName
addPartPropertyListener, addPropertyListener, dispose, firePartPropertyChanged, firePropertyChange, getAdapter, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getPartProperties, getPartProperty, getSite, getTitle, getTitleImage, getTitleToolTip, removePartPropertyListener, removePropertyListener, setPartProperty, setSite, setTitle, setTitleImage, setTitleToolTip, showBusy
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static final java.lang.String ID
private static final java.lang.String EXPORT_FILE_NAME_PREFIX
private static final java.lang.String ALL_IDS
settings
private static final java.lang.String DEFAULT_TITLE
private static final java.lang.String DEFAULT_TYPE
private static final java.lang.String TYPE_SETTINGS
private static final java.lang.String TITLE_SETTINGS
public static final java.lang.String COLCOUNT_SETTINGS
private NoticeComposite noticeComp
NoticeText
, NoticeList
or
NoticeTable
.private org.eclipse.jface.action.Action clearAction
private org.eclipse.jface.action.Action exportAction
private org.eclipse.jface.action.Action newTabAction
private org.eclipse.jface.dialogs.IDialogSettings settings
private org.eclipse.jface.dialogs.IDialogSettings typeSettings
NoticeView
.private org.eclipse.jface.dialogs.IDialogSettings titleSettings
UUID.randomUUID()
.private org.eclipse.jface.dialogs.IDialogSettings colCountSettings
private org.eclipse.swt.custom.CTabFolder tabFolder
private org.eclipse.ui.IMemento memento
public void init(org.eclipse.ui.IViewSite site, org.eclipse.ui.IMemento memento) throws org.eclipse.ui.PartInitException
init
in interface org.eclipse.ui.IViewPart
init
in class org.eclipse.ui.part.ViewPart
org.eclipse.ui.PartInitException
public void saveState(org.eclipse.ui.IMemento memento)
IMemento
. This is done
creating an comma separated String of them. This String is split when
it's read.saveState
in interface org.eclipse.ui.IPersistable
saveState
in interface org.eclipse.ui.IViewPart
saveState
in class org.eclipse.ui.part.ViewPart
public void createPartControl(org.eclipse.swt.widgets.Composite parent)
CTabFolder
of the view and creates the tabs.
The titles and types of the tabs are read from
IDialogSettings
.createPartControl
in interface org.eclipse.ui.IWorkbenchPart
createPartControl
in class org.eclipse.ui.part.WorkbenchPart
private void contributeToActionBars()
private void fillLocalToolBar(org.eclipse.jface.action.IToolBarManager manager)
manager
- IToolBarManager
, the toolbar managerprivate void makeActions()
private void export()
public void setFocus()
setFocus
in interface org.eclipse.ui.IWorkbenchPart
setFocus
in class org.eclipse.ui.part.WorkbenchPart
private java.lang.String createID()
String
, a pseudo random ID.public void createTab()
createTab(String, String, String, String)
. The method is
called to create a new tab at runtime.private void createTab(java.lang.String id, java.lang.String title, java.lang.String type, java.lang.String colCount)
id
- String
, id that is used to store the title and
the type of the tab in the settings.title
- String
, the title to be shown on the tab.type
- String
, the type of the tab. May be text, list or
table.colCount
- String
, number of columns to create if the tab
type is a table.private void renameTab(org.eclipse.swt.custom.CTabItem item)
item
- CTabItem
the item that has to be renamedprivate void storeAllItemIDs()
private java.lang.String getActItemContents()
export()
String
, the contents of the selected item or
null
if empty.private void clearText()
NoticeText
. see comment:
getActItemContents()
private void clearList()
NoticeList
.private void clearTable()
NoticeTable
.private void deleteActItemContents()