本文整理汇总了Java中org.eclipse.swt.browser.BrowserFunction类的典型用法代码示例。如果您正苦于以下问题:Java BrowserFunction类的具体用法?Java BrowserFunction怎么用?Java BrowserFunction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BrowserFunction类属于org.eclipse.swt.browser包,在下文中一共展示了BrowserFunction类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: register
import org.eclipse.swt.browser.BrowserFunction; //导入依赖的package包/类
@Override
public final boolean register(final Browser browser, final IDesignationListener<? super T> listener) {
browserFunction = new BrowserFunction(browser, getCallbackName()) {
@Override
public Object function(final Object[] arguments) {
super.function(arguments);
final T result = createResult(arguments);
getBrowser().getDisplay().asyncExec(new Runnable() {
@Override
public void run() {
listener.onDesignation(result);
}
});
return null;
}
};
return browser.execute(getJsStartFunctionName() + "('" + getCallbackName() + "');");
}
开发者ID:jo-source,项目名称:jo-widgets,代码行数:19,代码来源:AbstractDesignationCallback.java
示例2: open
import org.eclipse.swt.browser.BrowserFunction; //导入依赖的package包/类
private boolean open( RepositoryMeta repositoryMeta, boolean relogin, String errorMessage ) {
new BrowserFunction( browser, "closeWindow" ) {
@Override public Object function( Object[] arguments ) {
browser.dispose();
dialog.close();
dialog.dispose();
return true;
}
};
controller.setCurrentRepository( repositoryMeta );
controller.setRelogin( relogin );
while ( !dialog.isDisposed() ) {
if ( !display.readAndDispatch() ) {
display.sleep();
}
}
return result;
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:22,代码来源:RepositoryDialog.java
示例3: addMapBrowserFunctions
import org.eclipse.swt.browser.BrowserFunction; //导入依赖的package包/类
private void addMapBrowserFunctions() {
new BrowserFunction(mapBrowser, "getTreedataById"){
@Override
public Object function( Object[] arguments ) {
return getTreedataById(arguments);
}
};
}
开发者ID:moovida,项目名称:STAGE,代码行数:9,代码来源:TreeSlicesViewerEntryPoint.java
示例4: BrowserFunctionHandle
import org.eclipse.swt.browser.BrowserFunction; //导入依赖的package包/类
private BrowserFunctionHandle(final String functionName, final BrowserFunction browserFunction) {
this.functionName = functionName;
this.browserFunction = browserFunction;
}
开发者ID:jo-source,项目名称:jo-widgets,代码行数:5,代码来源:BrowserImpl.java
示例5: addChartBrowserFunction
import org.eclipse.swt.browser.BrowserFunction; //导入依赖的package包/类
private void addChartBrowserFunction( final Browser chartBrowser ) {
new BrowserFunction(chartBrowser, "getTreeAndSlicesData"){
@Override
public Object function( Object[] arguments ) {
String treeId = arguments[0].toString();
JSONObject treeObject = id2TreeJsonMap.get(treeId);
if (treeObject != null) {
// tree data
JSONObject treeObj = new JSONObject();
double minP = treeObject.getDouble(JSON_TREE_MIN_P);
treeObj.put(JSON_TREE_MIN_P, minP);
double maxP = treeObject.getDouble(JSON_TREE_MAX_P);
treeObj.put(JSON_TREE_MAX_P, maxP);
if (treeObject.has(JSON_TREE_DIAM)) {
double diam = treeObject.getDouble(JSON_TREE_DIAM);
treeObj.put(JSON_TREE_DIAM, diam);
}
double progressive = treeObject.getDouble(JSON_TREE_PROGRESSIVE);
treeObj.put(JSON_TREE_PROGRESSIVE, progressive);
double height = treeObject.getDouble(JSON_TREE_HEIGHT);
treeObj.put(JSON_TREE_HEIGHT, height);
if (treeObject.has(JSON_TREE_ID_MATCHED)) {
String matchedTreeId = treeObject.getString(JSON_TREE_ID_MATCHED);
treeObj.put(JSON_TREE_ID_MATCHED, matchedTreeId);
for( String dir : JSON_DIRECTIONS ) {
treeObj.put(JSON_TREE_PROGRESSIVE_MATCHED + dir,
treeObject.getDouble(JSON_TREE_PROGRESSIVE_MATCHED + dir));
}
double heightMatched = treeObject.getDouble(JSON_TREE_HEIGHT_MATCHED);
treeObj.put(JSON_TREE_HEIGHT_MATCHED, heightMatched);
}
// slice data
JSONObject slicesObj = treeObject.getJSONObject(JSON_TREE_SLICES);
JSONArray profileDataArray = slicesObj.getJSONArray(chartBrowser.getData().toString());
Object[] returnObjs = {treeObj.toString(), profileDataArray.toString()};
return returnObjs;
}
return null;
}
};
}
开发者ID:moovida,项目名称:STAGE,代码行数:44,代码来源:TreeSlicesViewerEntryPoint.java
注:本文中的org.eclipse.swt.browser.BrowserFunction类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论