Kaydet (Commit) f4dc5247 authored tarafından Xisco Fauli's avatar Xisco Fauli

fdo#38820: bye bye java agenda wizard

Hasta la vista, baby!

Change-Id: Idb6b5f383667960918a8f1b9db653edbfc89c232
üst 0e34f7e9
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
package com.sun.star.wizards.agenda;
import com.sun.star.wizards.common.HelpIds;
public interface AgendaWizardDialogConst {
/**
* These are event method names, used with reflection
* to call the methods under these names uppon
* events.
*/
final String LISTPAGEDESIGN_ACTION_PERFORMED = "pageDesignChanged";
final String TXTTEMPLATENAME_TEXT_CHANGED = "templateTitleChanged";
final String BTNTEMPLATEPATH_ACTION_PERFORMED = "saveAs";
final String BTNINSERT_ACTION_PERFORMED = "insertRow";
final String BTNREMOVE_ACTION_PERFORMED = "removeRow";
final String BTNUP_ACTION_PERFORMED = "rowUp";
final String BTNDOWN_ACTION_PERFORMED = "rowDown";
final String INFO_IMAGE_URL = "private:resource/dbu/image/19205";
/* ====================================
* Help IDs
* ====================================
*/
final int HID = 41051;
/*
* "HID:(hid)" - the dialog
* "HID:(hid+1) - the help button
* "HID:(hid+2)" - the back button
* "HID:(hid+3)" - the next button
* "HID:(hid+4)" - the create button
* "HID:(hid+5)" - the cancel button
*/
final String LISTPAGEDESIGN_HID = HelpIds.getHelpIdString((HID + 6));
final String CHKMINUTES_HID = HelpIds.getHelpIdString((HID + 7));
final String TXTTIME_HID = HelpIds.getHelpIdString((HID + 8));
final String TXTDATE_HID = HelpIds.getHelpIdString((HID + 9));
final String TXTTITLE_HID = HelpIds.getHelpIdString((HID + 10));
final String CBLOCATION_HID = HelpIds.getHelpIdString((HID + 11));
final String CHKMEETINGTITLE_HID = HelpIds.getHelpIdString((HID + 12));
final String CHKREAD_HID = HelpIds.getHelpIdString((HID + 13));
final String CHKBRING_HID = HelpIds.getHelpIdString((HID + 14));
final String CHKNOTES_HID = HelpIds.getHelpIdString((HID + 15));
final String CHKCONVENEDBY_HID = HelpIds.getHelpIdString((HID + 16));
final String CHKPRESIDING_HID = HelpIds.getHelpIdString((HID + 17));
final String CHKNOTETAKER_HID = HelpIds.getHelpIdString((HID + 18));
final String CHKTIMEKEEPER_HID = HelpIds.getHelpIdString((HID + 19));
final String CHKATTENDEES_HID = HelpIds.getHelpIdString((HID + 20));
final String CHKOBSERVERS_HID = HelpIds.getHelpIdString((HID + 21));
final String CHKRESOURCEPERSONS_HID = HelpIds.getHelpIdString((HID + 22));
final String TXTTEMPLATENAME_HID = HelpIds.getHelpIdString((HID + 23));
final String TXTTEMPLATEPATH_HID = HelpIds.getHelpIdString((HID + 24));
final String BTNTEMPLATEPATH_HID = HelpIds.getHelpIdString((HID + 25));
final String OPTCREATEAGENDA_HID = HelpIds.getHelpIdString((HID + 26));
final String OPTMAKECHANGES_HID = HelpIds.getHelpIdString((HID + 27));
final String BTNINSERT_HID = HelpIds.getHelpIdString((HID + 28));
final String BTNREMOVE_HID = HelpIds.getHelpIdString((HID + 29));
final String BTNUP_HID = HelpIds.getHelpIdString((HID + 30));
final String BTNDOWN_HID = HelpIds.getHelpIdString((HID + 31));
final int LAST_HID = HID + 32;
/*
* 32 : scroll bar
* 33 - 35 first topics row
* 36 - 38 second
* 39 - 41
* 42 - 44
* 45 - 47
* total 5 rows / 3 controls.
*/
}
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
package com.sun.star.wizards.agenda;
import com.sun.star.wizards.common.ConfigGroup;
import com.sun.star.wizards.common.ConfigSet;
import com.sun.star.wizards.common.PropertyNames;
/**
* CGAgenda means Configuration Group Agenda.
* This object encapsulates a OOo configuration group, used
* to save the state of the agenda wizard for reloading uppon
* next start.
*/
public class CGAgenda extends ConfigGroup
{
/** step 1 - design*/
public int cp_AgendaType;
/** step 1 - include minutes*/
public boolean cp_IncludeMinutes;
/** step 2 - title */
public String cp_Title = PropertyNames.EMPTY_STRING;
/** step 2 - date */
public String cp_Date;
/** step 2 - time */
public String cp_Time;
/** step 2 - location */
public String cp_Location = PropertyNames.EMPTY_STRING;
/** step 3 - show meeting type */
public boolean cp_ShowMeetingType;
/** step 3 - show read */
public boolean cp_ShowRead;
/** step 3 - show bring */
public boolean cp_ShowBring;
/** step 3 - show notes */
public boolean cp_ShowNotes;
/** step 4 - show called by */
public boolean cp_ShowCalledBy;
/** step 4 - show facilitator */
public boolean cp_ShowFacilitator;
/** step 4 - show notes taker */
public boolean cp_ShowNotetaker;
/** step 4 - show time keeper */
public boolean cp_ShowTimekeeper;
/** step 4 - show attendees */
public boolean cp_ShowAttendees;
/** step 4 - show observers */
public boolean cp_ShowObservers;
/** step 4 - show resource persons */
public boolean cp_ShowResourcePersons;
/** page 6 - template title */
public String cp_TemplateName;
/** page 6 - template url */
public String cp_TemplatePath;
/** page 6 - how to proceed */
public int cp_ProceedMethod;
/** page 5 - topics ( a set )*/
public ConfigSet cp_Topics = new ConfigSet(CGTopic.class);
}
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
package com.sun.star.wizards.agenda;
import com.sun.star.beans.PropertyValue;
import com.sun.star.wizards.common.ConfigGroup;
import com.sun.star.wizards.common.Indexable;
import com.sun.star.wizards.common.PropertyNames;
/**
* CGTopic means: Configuration Group Topic.
* This object encapsulates a configuration group with topic information.
* Since the topics gui conftrol uses its own data model, there is
* also code here to convert from the data model to CGTopic object (the constructor)
* and vice versa (setDataToRow method - used when loading the last session...)
*/
public class CGTopic extends ConfigGroup implements Indexable {
/** sort order */
public int cp_Index;
/** topic name */
public String cp_Topic;
/** responsible */
public String cp_Responsible;
/** time */
public String cp_Time;
public CGTopic() {}
/**
* create a new CGTopic object with data from the given row.
* the row object is a PropertyValue array, as used
* by the TopicsControl's data model.
* @param row PropertyValue array as used by the TopicsControl data model.
*/
public CGTopic( Object row) {
PropertyValue[] pv = (PropertyValue[])row;
String num = (String)pv[0].Value;
cp_Index = Integer.valueOf(num.substring(0,num.length() - 1)).intValue();
cp_Topic = (String)pv[1].Value;
cp_Responsible = (String)pv[2].Value;
cp_Time = (String)pv[3].Value;
}
/**
* copies the data in this CGTopic object
* to the given row.
* @param row the row object (PropertyValue array) to
* copy the data to.
*/
public void setDataToRow(Object row) {
PropertyValue[] pv = (PropertyValue[])row;
pv[0].Value = PropertyNames.EMPTY_STRING + cp_Index + ".";
pv[1].Value = cp_Topic;
pv[2].Value = cp_Responsible;
pv[3].Value = cp_Time;
}
public int getIndex() {
return cp_Index;
}
}
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
package com.sun.star.wizards.agenda;
import com.sun.star.beans.XPropertyAccess;
import com.sun.star.comp.loader.FactoryHelper;
import com.sun.star.lang.XInitialization;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.lang.XServiceInfo;
import com.sun.star.lang.XSingleServiceFactory;
import com.sun.star.lang.XTypeProvider;
import com.sun.star.registry.XRegistryKey;
import com.sun.star.task.XJob;
import com.sun.star.task.XJobExecutor;
import com.sun.star.uno.Type;
import com.sun.star.wizards.common.PropertyNames;
/**
* This class capsulates the class, that implements the minimal component, a factory for
* creating the service (<CODE>__getServiceFactory</CODE>).
*/
public class CallWizard {
/**
* Gives a factory for creating the service. This method is called by the
* <code>JavaLoader</code>
*
* <p></p>
*
* @param stringImplementationName The implementation name of the component.
* @param xMSF The service manager, who gives access to every known service.
* @param xregistrykey Makes structural information (except regarding tree
* structures) of a single registry key accessible.
*
* @return Returns a <code>XSingleServiceFactory</code> for creating the component.
*
* @see com.sun.star.comp.loader.JavaLoader
*/
public static XSingleServiceFactory __getServiceFactory(String stringImplementationName, XMultiServiceFactory xMSF, XRegistryKey xregistrykey) {
XSingleServiceFactory xsingleservicefactory = null;
if (stringImplementationName.equals(WizardImplementation.class.getName())) {
xsingleservicefactory = FactoryHelper.getServiceFactory(WizardImplementation.class, WizardImplementation.__serviceName, xMSF, xregistrykey);
}
return xsingleservicefactory;
}
/**
* This class implements the component. At least the interfaces XServiceInfo,
* XTypeProvider, and XInitialization should be provided by the service.
*/
public static class WizardImplementation implements XInitialization, XTypeProvider, XServiceInfo, XJobExecutor {
/**
* The constructor of the inner class has a XMultiServiceFactory parameter.
*
* @param xmultiservicefactoryInitialization A special service factory could be
* introduced while initializing.
*/
public WizardImplementation(XMultiServiceFactory xmultiservicefactoryInitialization) {
xmultiservicefactory = xmultiservicefactoryInitialization;
if (xmultiservicefactory != null) {
}
}
/**
* Execute Wizard
*
* @param str only valid parameter is 'start' at the moment.
*/
public void trigger(String str) {
try {
if (str.equalsIgnoreCase(PropertyNames.START)) {
AgendaWizardDialogImpl aw = new AgendaWizardDialogImpl(xmultiservicefactory);
if (!AgendaWizardDialogImpl.running) {
aw.startWizard();
}
}
}
catch (Exception ex) {
ex.printStackTrace();
}
}
//*******************************************
/**
* The service name, that must be used to get an instance of this service.
*/
private static final String __serviceName = "com.sun.star.wizards.agenda.CallWizard";
/**
* The service manager, that gives access to all registered services.
*/
private XMultiServiceFactory xmultiservicefactory;
/**
* This method is a member of the interface for initializing an object directly
* after its creation.
*
* @param object This array of arbitrary objects will be passed to the component
* after its creation.
*
* @throws com.sun.star.uno.Exception Every exception will not be handled, but
* will be passed to the caller.
*/
public void initialize(Object[] object) throws com.sun.star.uno.Exception {
}
/**
* This method returns an array of all supported service names.
*
* @return Array of supported service names.
*/
public java.lang.String[] getSupportedServiceNames() {
String[] stringSupportedServiceNames = new String[1];
stringSupportedServiceNames[0] = __serviceName;
return (stringSupportedServiceNames);
}
/**
* This method returns true, if the given service will be supported by the
* component.
*
* @param stringService Service name.
*
* @return True, if the given service name will be supported.
*/
public boolean supportsService(String stringService) {
boolean booleanSupportsService = false;
if (stringService.equals(__serviceName)) {
booleanSupportsService = true;
}
return (booleanSupportsService);
}
/**
* This method returns an array of bytes, that can be used to unambiguously
* distinguish between two sets of types, e.g. to realise hashing functionality
* when the object is introspected. Two objects that return the same ID also
* have to return the same set of types in getTypes(). If an unique
* implementation Id cannot be provided this method has to return an empty
* sequence. Important: If the object aggregates other objects the ID has to be
* unique for the whole combination of objects.
*
* @return Array of bytes, in order to distinguish between two sets.
*/
public byte[] getImplementationId() {
byte[] byteReturn = {
};
try {
byteReturn = (PropertyNames.EMPTY_STRING + this.hashCode()).getBytes();
} catch (Exception exception) {
System.err.println(exception);
}
return (byteReturn);
}
/**
* Return the class name of the component.
*
* @return Class name of the component.
*/
public java.lang.String getImplementationName() {
return (WizardImplementation.class.getName());
}
/**
* Provides a sequence of all types (usually interface types) provided by the
* object.
*
* @return Sequence of all types (usually interface types) provided by the
* service.
*/
public com.sun.star.uno.Type[] getTypes() {
Type[] typeReturn = {
};
try {
typeReturn = new Type[] { new Type(XPropertyAccess.class), new Type(XJob.class), new Type(XJobExecutor.class), new Type(XTypeProvider.class), new Type(XServiceInfo.class), new Type(XInitialization.class)};
} catch (Exception exception) {
System.err.println(exception);
}
return (typeReturn);
}
}
}
RegistrationClassName: com.sun.star.wizards.agenda.CallWizard
UNO-Type-Path:
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
package com.sun.star.wizards.agenda;
public interface TemplateConsts
{
public final static String FILLIN_TITLE = "<title>";
public final static String FILLIN_DATE = "<date>";
public final static String FILLIN_TIME = "<time>";
public final static String FILLIN_LOCATION = "<location>";
/**
* section name <b>prefix</b> for sections that contain items.
* this is also used as table name prefix, since each items section
* must contain a table whos name is identical name to the section's name.
*/
public final static String SECTION_ITEMS = "AGENDA_ITEMS";
/**
* the name of the section which contains the topics.
*/
public final static String SECTION_TOPICS = "AGENDA_TOPICS";
/**
* the name of the parent minutes section.
*/
public final static String SECTION_MINUTES_ALL = "MINUTES_ALL";
/**
* the name of the child nimutes section.
* This section will be duplicated for each topic.
*/
public final static String SECTION_MINUTES = "MINUTES"; //public final static String AGENDA_ITEM = "AGENDA_ITEM";
/**
* taged headings and names.
* These will be searched in item tables (in the template) and will be
* replaced with resource strings.
*
* headings...
*/
public final static String FILLIN_MEETING_TYPE = "<meeting-type>";
public final static String FILLIN_BRING = "<bring>";
public final static String FILLIN_READ = "<read>";
public final static String FILLIN_NOTES = "<notes>";
/**
* names...
*/
public final static String FILLIN_CALLED_BY = "<called-by>";
public final static String FILLIN_FACILITATOR = "<facilitator>";
public final static String FILLIN_PARTICIPANTS = "<attendees>";
public final static String FILLIN_NOTETAKER = "<notetaker>";
public final static String FILLIN_TIMEKEEPER = "<timekeeper>";
public final static String FILLIN_OBSERVERS = "<observers>";
public final static String FILLIN_RESOURCE_PERSONS = "<resource-persons>";
/**
* Styles (paragraph styles) used for agenda items.
* headings styles
*
*/
public final static String STYLE_MEETING_TYPE = "MeetingType";
public final static String STYLE_BRING = "Bring";
public final static String STYLE_READ = "Read";
public final static String STYLE_NOTES = "Notes";
/**
* names styles
*/
public final static String STYLE_CALLED_BY = "CalledBy";
public final static String STYLE_FACILITATOR = "Facilitator";
public final static String STYLE_PARTICIPANTS = "Attendees";
public final static String STYLE_NOTETAKER = "Notetaker";
public final static String STYLE_TIMEKEEPER = "Timekeeper";
public final static String STYLE_OBSERVERS = "Observers";
public final static String STYLE_RESOURCE_PERSONS = "ResourcePersons";
/**
* Styles (paragraph styles) used for the <b>text</b> of agenda items
* The agenda wizard creates fill-in fields with the given styles...)
*
* headings fields styles
*/
public final static String STYLE_MEETING_TYPE_TEXT = "MeetingTypeText";
public final static String STYLE_BRING_TEXT = "BringText";
public final static String STYLE_READ_TEXT = "ReadText";
public final static String STYLE_NOTES_TEXT = "NotesText";
/**
* names field styles
*/
public final static String STYLE_CALLED_BY_TEXT = "CalledByText";
public final static String STYLE_FACILITATOR_TEXT = "FacilitatorText";
public final static String STYLE_PARTICIPANTS_TEXT = "AttendeesText";
public final static String STYLE_NOTETAKER_TEXT = "NotetakerText";
public final static String STYLE_TIMEKEEPER_TEXT = "TimekeeperText";
public final static String STYLE_OBSERVERS_TEXT = "ObserversText";
public final static String STYLE_RESOURCE_PERSONS_TEXT = "ResourcePersonsText";
/**
* Fillins for the topic table.
* These strings will be searched inside the topic table as
* part of detecting its structure.
*/
public final static String FILLIN_TOPIC_NUMBER = "<num>";
public final static String FILLIN_TOPIC_TOPIC = "<topic>";
public final static String FILLIN_TOPIC_RESPONSIBLE = "<responsible>";
public final static String FILLIN_TOPIC_TIME = "<topic-time>";
/**
* fillins for minutes.
* These will be searched in the minutes section and will be replaced
* with the appropriate data.
*/
public final static String FILLIN_MINUTES_TITLE = "<minutes-title>";
public final static String FILLIN_MINUTES_LOCATION = "<minutes-location>";
public final static String FILLIN_MINUTES_DATE = "<minutes-date>";
public final static String FILLIN_MINUTES_TIME = "<minutes-time>";
/**
* Minutes-topic fillins
* These will be searched in the minutes-child-section, and
* will be replaced with topic data.
*/
public final static String FILLIN_MINUTE_NUM = "<mnum>";
public final static String FILLIN_MINUTE_TOPIC = "<mtopic>";
public final static String FILLIN_MINUTE_RESPONSIBLE = "<mresponsible>";
public final static String FILLIN_MINUTE_TIME = "<mtime>";
public final static String FILLIN_DATETITLE = "#datetitle#";
public final static String FILLIN_TIMETITLE = "#timetitle#";
public final static String FILLIN_LOCATIONTITLE = "#locationtitle#";
public final static String FILLIN_TOPICS = "#topics#";
public final static String FILLIN_NUM = "#num.#";
public final static String FILLIN_TOPIC = "#topicheader#";
public final static String FILLIN_RESPONSIBLE = "#responsibleheader#";
public final static String FILLIN_TIME_HEADER = "#timeheader#";
public final static String FILLIN_ADDITIONAL_INFORMATION = "#additional-information#";
public final static String FILLIN_MINUTES_FOR = "#minutes-for#";
public final static String FILLIN_DISCUSSION = "#discussion#";
public final static String FILLIN_CONCLUSION = "#conclusion#";
public final static String FILLIN_TO_DO = "#to-do#";
public final static String FILLIN_RESPONSIBLE_PARTY = "#responsible-party#";
public final static String FILLIN_DEADLINE = "#deadline#";
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment