当前位置: 首页>>代码示例>>Java>>正文


Java JsArrayMixed类代码示例

本文整理汇总了Java中com.google.gwt.core.client.JsArrayMixed的典型用法代码示例。如果您正苦于以下问题:Java JsArrayMixed类的具体用法?Java JsArrayMixed怎么用?Java JsArrayMixed使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


JsArrayMixed类属于com.google.gwt.core.client包,在下文中一共展示了JsArrayMixed类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setUp

import com.google.gwt.core.client.JsArrayMixed; //导入依赖的package包/类
@Before
public void setUp() {
  MockitoAnnotations.initMocks(this);
  when(dataObject.getSource()).thenReturn(source);
  doReturn("AccountName").when(gitHubUser).getName();
  doReturn("AccountLogin").when(gitHubUser).getLogin();
  when(gitHubAuthenticatorRegistry.getAuthenticator(eq("github")))
      .thenReturn(gitHubAuthenticator);
  presenter =
      spy(
          new GithubImporterPagePresenter(
              view,
              gitHubAuthenticatorRegistry,
              gitHubClientService,
              dtoFactory,
              appContext,
              locale,
              oAuthServiceClient,
              notificationManager));
  doReturn(Collections.singletonList(gitHubUser))
      .when(presenter)
      .toOrgList(nullable(JsArrayMixed.class));
  doReturn(Collections.emptyList()).when(presenter).toRepoList(nullable(JsArrayMixed.class));
  presenter.setUpdateDelegate(updateDelegate);
  presenter.init(dataObject);
}
 
开发者ID:eclipse,项目名称:che,代码行数:27,代码来源:GithubImporterPagePresenterTest.java

示例2: draw

import com.google.gwt.core.client.JsArrayMixed; //导入依赖的package包/类
private void draw() {
	JsArrayMixed dataArray = JsonUtils.unsafeEval("[['Mon',20,28,38,45],['Tue',31,38,55,66],['Wed',50,55,77,80],['Thu',77,77,66,50],['Fri',68,66,22,15]]");

	// Prepare the data
	DataTable dataTable = ChartHelper.arrayToDataTable(dataArray, true);

	// Set options
	CandlestickChartOptions options = CandlestickChartOptions.create();
	BackgroundColor bgColor = BackgroundColor.create();
	bgColor.setStroke("#2196f3");
	bgColor.setFill("#90caf9");
	bgColor.setStrokeWidth(2);
	
	
	
	options.setLegend(Legend.create(LegendPosition.NONE));
	options.setFallingColor(bgColor);
	options.setRisingColor(bgColor);

	// Draw the chart
	chart.draw(dataTable, options);
}
 
开发者ID:GwtMaterialDesign,项目名称:gwt-material-demo,代码行数:23,代码来源:MaterialCandleStick.java

示例3: draw

import com.google.gwt.core.client.JsArrayMixed; //导入依赖的package包/类
private void draw() {
	JsArrayMixed dataArray = JsonUtils
			.unsafeEval("[['Month', 'Bolivia', 'Ecuador', 'Madagascar', 'Papua  Guinea', 'Rwanda', 'Average'],['2004/05', 165, 938, 522, 998, 450, 614.6],['2005/06', 135, 1120, 599, 1268, 288, 682],['2006/07', 157, 1167, 587, 807, 397, 623],['2007/08', 139, 1110, 615, 968, 215, 609.4],['2008/09', 136, 691, 629, 1026, 366, 569.6]]");

	// Prepare the data
	DataTable dataTable = ChartHelper.arrayToDataTable(dataArray);

	// Set options
	ComboChartOptions options = ComboChartOptions.create();
	options.setFontName("Tahoma");
	options.setTitle("Monthly Coffee Production by Country");
	options.setHAxis(HAxis.create("Cups"));
	options.setVAxis(VAxis.create("Month"));
	options.setSeriesType(SeriesType.BARS);
	ComboChartSeries series = ComboChartSeries.create();
	series.setType(SeriesType.LINE);
	options.setSeries(5, series);

	// Draw the chart
	chart.draw(dataTable, options);
}
 
开发者ID:GwtMaterialDesign,项目名称:gwt-material-demo,代码行数:22,代码来源:MaterialComboCharts.java

示例4: getAsMap

import com.google.gwt.core.client.JsArrayMixed; //导入依赖的package包/类
public List<Record> getAsMap() {
	ArrayList<Record> res = new ArrayList<com.gbourquet.yaph.client.utils.Record>();

	String[] columns = new String[columnsIdx.size()];
	for (Entry<String, Integer> e : columnsIdx.entrySet())
		columns[e.getValue()] = e.getKey();

	for (int r = 0; r < size(); r++) {
		HashMap<String, String> rowObject = new HashMap<String, String>();

		JsArrayMixed row = rows.get(r);
		for (int c = 0; c < row.length(); c++)
			rowObject.put(columns[c], row.getString(c));

		Record record = new Record();
		record.setProperties(rowObject);

		res.add(record);
	}

	return res;
}
 
开发者ID:guiguib,项目名称:yaph,代码行数:23,代码来源:SQLiteResult.java

示例5: addViewPortChangeHandler

import com.google.gwt.core.client.JsArrayMixed; //导入依赖的package包/类
@Override
public HandlerRegistration addViewPortChangeHandler(ViewPortChangeHandler handler) {
    if (!viewPortHandlerAdded) {
        viewPortHandlerAdded = true;
        this.codeMirror.on(this.editorOverlay, VIEWPORT_CHANGE, new EventHandlers.EventHandlerMixedParameters() {

            @Override
            public void onEvent(final JsArrayMixed param) {
                final int from = Double.valueOf(param.getNumber(0)).intValue();
                final int to = Double.valueOf(param.getNumber(1)).intValue();
                fireViewPortChangeEvent(from, to);
            }
        });
    }
    return addHandler(handler, ViewPortChangeEvent.TYPE);
}
 
开发者ID:codenvy-legacy,项目名称:plugin-editor-codemirror,代码行数:17,代码来源:CodeMirrorEditorWidget.java

示例6: addGutterClickHandler

import com.google.gwt.core.client.JsArrayMixed; //导入依赖的package包/类
@Override
public HandlerRegistration addGutterClickHandler(GutterClickHandler handler) {
    if (!gutterClickHandlerAdded) {
        gutterClickHandlerAdded = true;
        this.editorOverlay.on(GUTTER_CLICK, new EventHandlers.EventHandlerMixedParameters() {

            @Override
            public void onEvent(final JsArrayMixed params) {
                // param 0 is codemirror instance
                final int line = Double.valueOf(params.getNumber(1)).intValue();
                final String gutterId = params.getString(2);
                // param 3 is click event
                final JsMouseEvent event = params.getObject(3).cast();
                fireGutterClickEvent(line, gutterId, event);
            }
        });
    }
    return addHandler(handler, GutterClickEvent.TYPE);
}
 
开发者ID:codenvy-legacy,项目名称:plugin-editor-codemirror,代码行数:20,代码来源:CodeMirrorEditorWidget.java

示例7: showCompletionProposals

import com.google.gwt.core.client.JsArrayMixed; //导入依赖的package包/类
public void showCompletionProposals() {
     if (! editorWidget.getEditorOverlay().hasShowHint()) {
         // no support for hints
         return;
     }
     final CMHintFunctionOverlay hintAuto = CMHintFunctionOverlay.createFromName(editorWidget.getCodeMirror(), "auto");
     final CMHintResultsOverlay result = hintAuto.apply(editorWidget.getEditorOverlay());
     if (result != null) {
         final List<String> proposals = new ArrayList<>();
         final JsArrayMixed list = result.getList();
         int nonStrings = 0;
         //jsarray aren't iterable
         for (int i = 0; i < list.length(); i++) {
             if (result.isString(i)) {
                 proposals.add(result.getCompletionItemAsString(i));
             } else {
                 nonStrings++;
             }
         }
         LOG.info("CM Completion returned " + list.length() + " items, of which " + nonStrings + " were not strings.");

         showCompletionProposals(proposals, result.getFrom(), result.getTo());
     }
}
 
开发者ID:codenvy-legacy,项目名称:plugin-editor-codemirror,代码行数:25,代码来源:ShowCompletion.java

示例8: toJso

import com.google.gwt.core.client.JsArrayMixed; //导入依赖的package包/类
public JsArrayMixed toJso(List<Object> args) {
    JsArrayMixed result = (JsArrayMixed) JavaScriptObject.createArray();
    for (Object o : args) {
        if (o == null) {
            result.push((JavaScriptObject) null);
        } else if (o instanceof String) {
            result.push((String) o);
        } else if (o instanceof Date) {
            result.push(JsDate.create(((Date) o).getTime()));
        } else if (o instanceof Double) {
            result.push(((Double) o).doubleValue());
        } else {
            throw new IllegalArgumentException("Don't know how to handle "
                    + o);
        }
    }
    return result;
}
 
开发者ID:salk31,项目名称:RedQueryBuilder,代码行数:19,代码来源:JsList.java

示例9: test

import com.google.gwt.core.client.JsArrayMixed; //导入依赖的package包/类
protected void test(String json, String sql, JsArrayMixed args, String msg) throws Throwable {
    RootPanel.get().getElement().setAttribute("id", "rqb");

    try {
        if (json != null) {
            conf = (JsConfiguration) JsonUtils.unsafeEval(json);
            addHandlers(conf);
        }
        builder = RedQueryBuilder.configure(conf, sql, args);
        assertTrue(builder != null);
        if (msg != null) {
            fail("Was expecting the error message: " + msg);
        }
    } catch (Throwable th) {
        if (msg != null) {
            assertEquals(msg, th.getMessage());
        } else {
            throw th;
        }
    }
}
 
开发者ID:salk31,项目名称:RedQueryBuilder,代码行数:22,代码来源:AbstractTest.java

示例10: getArray

import com.google.gwt.core.client.JsArrayMixed; //导入依赖的package包/类
public final native JsArrayMixed getArray(Object id) /*-{
    var r = this[id];
    if (Object.prototype.toString.call(r) == '[object Array]') {
        return r;
    }
    return null;
}-*/;
 
开发者ID:liraz,项目名称:gwt-backbone,代码行数:8,代码来源:JsObject.java

示例11: all

import com.google.gwt.core.client.JsArrayMixed; //导入依赖的package包/类
/**
 * @see #all(ArrayOf)
 * @deprecated use {@link PromiseProvider#all2(Promise[])}
 */
@Deprecated
public static final JsPromise<JsArrayMixed> all(final Promise<?>... promises) {
  final JsArrayOf<Promise<?>> promisesArray = JavaScriptObject.createArray().cast();
  for (final Promise<?> promise : promises) {
    promisesArray.push(promise);
  }
  return all(promisesArray);
}
 
开发者ID:eclipse,项目名称:che,代码行数:13,代码来源:Promises.java

示例12: all

import com.google.gwt.core.client.JsArrayMixed; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public Promise<JsArrayMixed> all(Promise<?>... promises) {
  final JsArrayOf<Promise<?>> promisesArray = JavaScriptObject.createArray().cast();
  for (final Promise<?> promise : promises) {
    promisesArray.push(promise);
  }
  return all(promisesArray);
}
 
开发者ID:eclipse,项目名称:che,代码行数:10,代码来源:JsPromiseProvider.java

示例13: toOrgList

import com.google.gwt.core.client.JsArrayMixed; //导入依赖的package包/类
protected List<GitHubUser> toOrgList(JsArrayMixed arg) {
  List<GitHubUser> organizations =
      dtoFactory.createListDtoFromJson(arg.getObject(1).toString(), GitHubUser.class);
  organizations.add(dtoFactory.createDtoFromJson(arg.getObject(0).toString(), GitHubUser.class));
  return organizations;
}
 
开发者ID:eclipse,项目名称:che,代码行数:7,代码来源:GithubImporterPagePresenter.java

示例14: add

import com.google.gwt.core.client.JsArrayMixed; //导入依赖的package包/类
@Override
public void add(int index, JavaScriptObject element) {
	JsArrayMixed args = JavaScriptObject.createArray().cast();
	args.push(index);
	args.push(0);
	args.push(element);
	splice.apply(data, args);
}
 
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:9,代码来源:JsArrayList.java

示例15: remove

import com.google.gwt.core.client.JsArrayMixed; //导入依赖的package包/类
@Override
public JavaScriptObject remove(int index) {
	JavaScriptObject res = data.<JsArrayMixed> cast().getObject(index);
	if(res != null){
		JsArrayMixed args = JavaScriptObject.createArray().cast();
		args.push(index);
		args.push(1);
		splice.apply(data, args);
	}
	return res;
}
 
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:12,代码来源:JsArrayList.java


注:本文中的com.google.gwt.core.client.JsArrayMixed类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。