|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsemorg.gui.CompanyWindow
public class CompanyWindow
The window for editing new or existing company records.
Nested Class Summary | |
---|---|
(package private) class |
CompanyWindow.InputChangedListener
Inner class which provides a listener reacting on changes of the input in the CompanyWindow window. |
Field Summary | |
---|---|
private org.eclipse.swt.widgets.Button |
abortButton
|
private org.eclipse.swt.widgets.Combo |
annexCombo
|
private org.eclipse.swt.widgets.Button |
applyButton
|
private AssociationTabControl |
bookingsControl
The control widget to manage the association between Company and
Booking (and its subclasses). |
private org.eclipse.swt.widgets.Text |
cityText
|
private org.eclipse.swt.widgets.Combo |
countryCombo
|
private CalendarControl |
cpBirthDayCalendar
|
private org.eclipse.swt.widgets.Text |
cpDepartmentText
|
private org.eclipse.swt.widgets.Text |
cpEmailText
|
private org.eclipse.swt.widgets.Text |
cpFaxText
|
private org.eclipse.swt.widgets.Text |
cpFirstNameText
|
private org.eclipse.swt.widgets.Text |
cpMobileText
|
private org.eclipse.swt.widgets.Text |
cpNameText
|
private org.eclipse.swt.widgets.Text |
cpPhoneText
|
private org.eclipse.swt.widgets.Combo |
cpSalutationCombo
|
private org.eclipse.swt.widgets.Text |
cpTaskText
|
private org.eclipse.swt.widgets.Combo |
cpTitleCombo
|
private CalendarControl |
customerSinceCalendar
|
private org.eclipse.swt.widgets.Text |
emailText
|
private AssociationTabControl |
employeeControl
The control widget to manage the association employee between Client and Company . |
private org.eclipse.swt.widgets.Text |
faxText
|
private org.eclipse.swt.widgets.Text |
firstNameText
|
private Company |
input
Holds the data of the actual displayed data record. |
private boolean |
inputChanged
Is set to true if the input has been changed and not committed yet, otherwise it is set to false. |
private CompanyWindow.InputChangedListener |
inputChangedListener
Listener instance added to the most elements of the window. |
private boolean |
inputEditingEnabled
true if the editing of the input (i.e. the elements of the form) has been enabled, otherwise it is false. |
private org.eclipse.swt.widgets.Text |
memoText
|
private org.eclipse.swt.widgets.Text |
mobileText
|
private org.eclipse.swt.widgets.Text |
nameText
|
private org.eclipse.swt.widgets.Button |
newButton
|
private org.eclipse.swt.widgets.Button |
nextButton
The triangle-button with the apex to the right. |
private org.eclipse.swt.widgets.Label |
numberLabel
|
private org.eclipse.swt.widgets.Text |
numberText
|
private org.eclipse.swt.widgets.Button |
okButton
|
private org.eclipse.swt.widgets.Text |
phoneText
|
private org.eclipse.swt.widgets.Button |
prevButton
The triangle-button with the apex to the left. |
private org.eclipse.swt.widgets.Combo |
salutationCombo
|
private boolean |
settingInput
Is set to true if the data from the database (or corresponding from input ) is to be set into the window form, otherwise
false. |
private org.eclipse.swt.widgets.Shell |
shell
The editing window. |
private org.eclipse.swt.widgets.Text |
shortMessageText
|
private org.eclipse.swt.widgets.Text |
shortNameText
|
private org.eclipse.swt.widgets.Text |
streetText
|
private int |
titleBarHeight
|
private org.eclipse.swt.widgets.Combo |
titleCombo
|
private org.eclipse.swt.widgets.Text |
turnoverText
|
private org.eclipse.swt.widgets.Text |
zipCodeText
|
Constructor Summary | |
---|---|
private |
CompanyWindow(org.eclipse.swt.widgets.Shell parent)
Creates a CompanyWindow instance with the given shell as the
parent shell. |
|
CompanyWindow(org.eclipse.swt.widgets.Shell parent,
Company input,
ForeignKeyConstraintSelector caller)
Creates an instance of this class, sets the input and finally opens it. |
Method Summary | |
---|---|
protected boolean |
checkInput()
Checks if all obligatory attributes of a Company record are
entered into the window form and if the entered fees are correct float
numbers. |
protected void |
commitInputToDB()
Reads the data from the window form elements, sets the values to a Company instance and commits the changes / the new record into
the database. |
private boolean |
confirmClose()
Creates a message dialog if the data in the window form has been changed (or was entered newly) and these changes haven't been confirmed (e.g. by clicking the ok button) or discarded so far. |
private void |
createButtonListener(ForeignKeyConstraintSelector caller)
Adds a listener to several buttons of the window form. |
private boolean |
onSave()
Checks whether the input has been changed (i.e. inputChanged equals true) or not. |
private void |
setInput(Company company)
Loads a given client record into the window form of initialize the elements of the form the empty string/null if no data is given. |
private void |
setInputComponentsEnabled(boolean enabled)
According to the value of the given parameter (true/false) this method enables / disables the widgets of the window form. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private Company input
private boolean settingInput
input
) is to be set into the window form, otherwise
false. ModifyListener
from firing when the
data is load into the window form by using the .setText() methods of the
GUI elements.
private boolean inputChanged
private boolean inputEditingEnabled
private CompanyWindow.InputChangedListener inputChangedListener
private org.eclipse.swt.widgets.Shell shell
private int titleBarHeight
private final org.eclipse.swt.widgets.Label numberLabel
private final org.eclipse.swt.widgets.Text numberText
private final org.eclipse.swt.widgets.Text shortNameText
private final org.eclipse.swt.widgets.Combo salutationCombo
private final org.eclipse.swt.widgets.Combo titleCombo
private final org.eclipse.swt.widgets.Text firstNameText
private final org.eclipse.swt.widgets.Text nameText
private final org.eclipse.swt.widgets.Text streetText
private final org.eclipse.swt.widgets.Text zipCodeText
private final org.eclipse.swt.widgets.Text cityText
private final org.eclipse.swt.widgets.Combo countryCombo
private final org.eclipse.swt.widgets.Combo annexCombo
private final org.eclipse.swt.widgets.Text phoneText
private final org.eclipse.swt.widgets.Text mobileText
private final org.eclipse.swt.widgets.Text faxText
private final org.eclipse.swt.widgets.Text emailText
private final org.eclipse.swt.widgets.Combo cpSalutationCombo
private final org.eclipse.swt.widgets.Combo cpTitleCombo
private final org.eclipse.swt.widgets.Text cpFirstNameText
private final org.eclipse.swt.widgets.Text cpNameText
private final org.eclipse.swt.widgets.Text cpPhoneText
private final org.eclipse.swt.widgets.Text cpMobileText
private final org.eclipse.swt.widgets.Text cpFaxText
private final org.eclipse.swt.widgets.Text cpEmailText
private final org.eclipse.swt.widgets.Text cpDepartmentText
private final org.eclipse.swt.widgets.Text cpTaskText
private final CalendarControl customerSinceCalendar
private final CalendarControl cpBirthDayCalendar
private final org.eclipse.swt.widgets.Text turnoverText
private final org.eclipse.swt.widgets.Text shortMessageText
private final org.eclipse.swt.widgets.Text memoText
private AssociationTabControl employeeControl
Client
and Company
.
private AssociationTabControl bookingsControl
Company
and
Booking
(and its subclasses).
private final org.eclipse.swt.widgets.Button okButton
private final org.eclipse.swt.widgets.Button applyButton
private final org.eclipse.swt.widgets.Button newButton
private final org.eclipse.swt.widgets.Button abortButton
private final org.eclipse.swt.widgets.Button prevButton
private final org.eclipse.swt.widgets.Button nextButton
Constructor Detail |
---|
private CompanyWindow(org.eclipse.swt.widgets.Shell parent)
CompanyWindow
instance with the given shell as the
parent shell.
parent
- Shell instance used the as parent shell of the window.public CompanyWindow(org.eclipse.swt.widgets.Shell parent, Company input, ForeignKeyConstraintSelector caller)
parent
- the parent shell to which this window belongsinput
- the data object to be displayed in the windowcaller
- the ForeignKeyConstraintSelector
instance which
calls the constructor.Method Detail |
---|
private void setInput(Company company)
company
- object which contains the data to be displayed or
null if a completely new record is to be
edited.private void setInputComponentsEnabled(boolean enabled)
inputEditingEnabled
to the
value of the parameter to signal that editing of the input has been
enabled or not.
enabled
- if equals true the widgets are enabled
otherwise the widgets get disabled.private void createButtonListener(ForeignKeyConstraintSelector caller)
okButton
,
abortButton
, applyButton
, newButton
,
prevButton
, nextButton
.
caller
- ForeignKeyConstraintSelector
instance which called
the constructor which itself calls this method.protected boolean checkInput()
Company
record are
entered into the window form and if the entered fees are correct float
numbers.
Utility.isCorrectFloat(String)
protected void commitInputToDB()
Company
instance and commits the changes / the new record into
the database.
Furthermore the member input
is set to the new values.
private boolean confirmClose()
onSave()
.
private boolean onSave()
checkInput()
), secondly invokes the
method commitInputToDB()
to commit the changes and thirdly
updates the GUI by invoking the method setInput(Company)
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |