I want to see all the methods that I can use on a Generic Widget in Google Apps script, but I can't find anything unsubstantial.
4 回答
有两种方法可以查看所有公共方法。以下代码执行此操作
function test() {
var app = UiApp.getActiveApplication();
// Method 1
var functions1 = Object.keys(app);
// Method 2
var functions2 = [];
for (var f in app) {
functions2.push(f);
}
}
数组functions1
和functions2
包含任何对象的相同公共函数列表,也包含任何通用小部件。
你看到了吗?: http: //google-web-toolkit.googlecode.com/svn/javadoc/1.6/com/google/gwt/user/client/ui/Widget.html
我认为这是您正在寻找的链接。 https://developers.google.com/apps-script/class_widget
请记住,Apps 脚本是基于 Google 的 Web Toolkit(在 App 引擎服务中使用)构建的。您可以查看它以更好地了解事物的工作方式。但是,Apps Script 是另一项服务,您很快就会看到,每次在 Apps Script 中实现一个小部件时,它的属性和方法都会减少。
最后,您可以随时在http://code.google.com/p/google-apps-script-issues/上发布功能请求。如果其他人对其“加注”足够多,谷歌可能会执行您的请求。这是一个相当诚实的系统,他们确实根据它优先考虑他们的努力。
我不知道是否有人会有用,但如果您想节省一些时间,这里列出了您可以在 Google 的 Generic Widget 上使用的所有方法。随意填写任何方法的一些信息。
addKeyPressHandler,
setReadOnly,
setDialogTitle,
setStylePrimaryName,
addMouseDownHandler,
addBeforeSelectionHandler,
addSubmitCompleteHandler,
setModal, setGlassEnabled,
setAutoHideEnabled,
setWidgetPosition,
setPreviewingAllNativeEvents,
addSouth,
addKeyUpHandler,
setCellHorizontalAlignment,
addMouseMoveHandler,
setTabEnabled,
setWidgetLeftRight,
removeRow,
setLimit,
addStyleName,
getId,
showDatePicker,
setWidgetBottomHeight,
setDefaultValue,
setCommand,
setPopupPositionAndShow,
setWidgetLeftWidth,
setWidgetHorizontalPosition,
setStyleName,
setAlwaysShowScrollBars,
addMouseWheelHandler,
setHref,
addTab,
addSubmitHandler,
setItemSelected,
hideDatePicker,
remove,
addLoadHandler,
setItemText,
setVisibleRect,
addItem,
setLayoutData,
showDocsPicker,
clear,
insertRow,
setFormValue,
setUrl,
setWidgetVerticalPosition,
addEast,
setAction,
removeCell,
setCellHeight,
setId,
addWest,
addClickHandler,
setCharacterWidth,
setCaptionText,
setTabText,
setCellWidth,
addScrollHandler,
setScrollPosition,
setVisible,
setUserObject,
setVisibleLines,
setMaxLength,
setSelectionRange,
setMethod,
setSelectedIndex,
addMouseOverHandler,
addNorth,
setWordWrap,
removeItem,
addCloseHandler,
setStyleAttribute,
setCellPadding,
insertCell,
addChangeHandler,
setText,
setContentWidget,
setGlassStyleName,
resize,
setTarget,
setAccessKey,
addAutoHidePartner,
setTag,
setInitialView,
setSelectedItem,
addView,
setBorderWidth,
setSubMenu,
removeCells,
setCurrentMonth,
setTextAlignment,
setID,
addFocusHandler,
setVerticalAlignment,
setPixelSize,
setTabIndex,
selectTab,
setResource,
setWidgetTopHeight,
setFormat,
setStackText,
setVisibleLength,
addSeparator,
setTitle,
setVisibleItemCount,
setHeight,
setSpacing,
addMouseOutHandler,
toString,
addMouseUpHandler,
setPopupPosition,
setName,
setWidgetTopBottom,
setHorizontalScrollPosition,
setTargetHistoryToken,
setCellSpacing,
setPopupStyleName,
getTag,
addCell,
addStyleDependentName,
setDown,
addInitializeHandler,
setWidget,
setChecked,
add,
addKeyDownHandler,
setCursorPos,
getType,
setEnabled,
setState,
setWidth,
setUrlAndVisibleRect,
setFocus,
setDirection,
addErrorHandler,
addValueChangeHandler,
setSize,
addSelectionHandler,
addBlurHandler,
setMultiSelectEnabled,
setValue,
setHorizontalAlignment,
setEncoding,
setAutoSelectEnabled,
setAutoOpen,
setWidgetMinSize,
setCellVerticalAlignment,
setWidgetRightWidth,
setAnimationEnabled,
setSelected,
setHTML