// Template for an Office Calc add-in Java implementation file.
/** You can find more *informationonthefollowingwebpage: *https://api.libreoffice.org/
*/ import com.sun.star.comp.loader.FactoryHelper; import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.lang.XSingleServiceFactory; import com.sun.star.registry.XRegistryKey; import com.sun.star.lib.uno.helper.WeakBase; import com.sun.star.lang.XServiceInfo; import com.sun.star.lang.XServiceName; import com.sun.star.sheet.XAddIn; import com.sun.star.lang.Locale; import org.openoffice.sheet.addin.XCalcAddins;
/** This outer class provides an inner class to implement the service *description,amethodtoinstantiatethe *componentondemand(__getServiceFactory()),andamethodtogive *informationaboutthecomponent(__writeRegistryServiceInfo()).
*/ publicclass CalcAddins {
/** This inner class provides the component as a concrete implementation *oftheservicedescription.Itimplementstheneededinterfaces. *@implementsXCalcAddins,XAddIn,XServiceName,XServiceInfo,XTypeProvider
*/ publicstaticclass _CalcAddins extends WeakBase implements
XCalcAddins,
XAddIn,
XServiceName,
XServiceInfo
{
/** The component will be registered under this name.
*/ privatestaticfinal String __serviceName = "org.openoffice.sheet.addin.CalcAddins";
public String getDisplayFunctionName(String stringProgrammaticName) {
String stringReturn = "";
switch( this.getFunctionID( stringProgrammaticName ) ) { /** TO DO: *Assignthenameofeachofyourmethods.
*/ case shortGETMYFIRSTVALUE:
stringReturn = "getMyFirstValue"; break; case shortGETMYSECONDVALUE:
stringReturn = "getMySecondValue"; break;
}
return stringReturn;
}
public String getProgrammaticCategoryName(String p1) { return"Add-In";
}
public String getDisplayCategoryName(String p1) { return"Add-In";
}
public String getFunctionDescription(String stringProgrammaticName) {
String stringReturn = "";
switch( this.getFunctionID( stringProgrammaticName ) ) { /** TO DO: *Enteradescriptionforeachofyourmethodsthatofficeuserswillunderstand.
*/ case shortGETMYFIRSTVALUE:
stringReturn = "This is your first method."; break; case shortGETMYSECONDVALUE:
stringReturn = "This is your second method."; break;
}
return stringReturn;
}
public String getArgumentDescription(String stringProgrammaticFunctionName,int intArgument) {
String stringReturn = "";
switch( this.getFunctionID( stringProgrammaticFunctionName ) ) { /** TO DO: *Enteradescriptionforeveryargumentofeverymethod.Makethemsothatofficeuserswillunderstand.
*/ case shortGETMYFIRSTVALUE: switch( intArgument ) { case0:
stringReturn = "(internal)"; break;
} break; case shortGETMYSECONDVALUE: switch( intArgument ) { case0:
stringReturn = "(internal)"; break; case1:
stringReturn = "You can add this value."; break;
} break;
} return stringReturn;
}
public String getProgrammaticFuntionName(String p1) { return"";
}
// Implement methods from interface XLocalizable public Locale getLocale() { return aFuncLoc;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.