fs.addNullableParam( Object.class, false );
return new FunctionSignature[] { fs };
}
private void invokeAddressBook( final Object arg ) throws Exception {
AddressBookArguments args = null;
if( arg instanceof AddressBookArgumentsObject ) {
final AddressBookArgumentsObject a = (AddressBookArgumentsObject) arg;
final int view = a.getView();
String viewArg = null;
final ContactObject co = a.getContactObject();
if( co != null ) {
co.update();
}
Contact c = a.getContact();
switch( view ) {
case AddressBookArgumentsConstructor.VIEW_NEW:
if( c == null ) {
// Create a new contact
try {
final ContactList contactList = (ContactList) PIM.getInstance().openPIMList( PIM.CONTACT_LIST,
PIM.READ_WRITE );
c = contactList.createContact();
} catch( final PIMException e ) {
throw e;
}
}
viewArg = AddressBookArguments.ARG_NEW;
break;
case AddressBookArgumentsConstructor.VIEW_COMPOSE:
viewArg = AddressBookArguments.ARG_COMPOSE;
break;
case AddressBookArgumentsConstructor.VIEW_DISPLAY:
viewArg = AddressBookArguments.ARG_VIEW;
break;
default:
throw new IllegalArgumentException();
}
if( c == null ) {
args = new AddressBookArguments( viewArg );
} else {
args = new AddressBookArguments( viewArg, c );
}
} else {
args = new AddressBookArguments();
}
Invoke.invokeApplication( Invoke.APP_TYPE_ADDRESSBOOK, args );
}