本文整理匯總了Java中org.stjs.javascript.jquery.Event類的典型用法代碼示例。如果您正苦於以下問題:Java Event類的具體用法?Java Event怎麽用?Java Event使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Event類屬於org.stjs.javascript.jquery包,在下文中一共展示了Event類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: render
import org.stjs.javascript.jquery.Event; //導入依賴的package包/類
@Override
public void render() {
final AbstractWebPage that = this;
$(window).load((Event event, Element element) -> {
$(CONTAINER_ID).addClass(Appearance.STYLE_SCOPE_CLASS)
.append((Element)$("<table/>").css("border", "3px solid #42B4E6")
.append((Element)$("<tr/>")
.append((Element)$("<td/>")
.append((Element)$("<div></div>").attr("id", MENU_ID.substring(1)))
.append((Element)$("<h1></div>").attr("id", TITLE_ID.substring(1)))
.append((Element)$("<div></div>").attr("id", CONTENT_ID.substring(1)))
)
)
);
MenuBuilder.build($(MENU_ID));
that.onLoad();
return true;
});
}
示例2: onInputKeyDown
import org.stjs.javascript.jquery.Event; //導入依賴的package包/類
private void onInputKeyDown(Event event) {
if(event.keyCode == 13) {
String msg = (String) $(input).val();
if(author == null) {
author = msg;
}
Data data = new Data();
data.setAuthor(author);
data.setMessage(msg);
input.val("");
connection.push(data);
input.attr("disabled", "disabled");
if(myName == null) {
myName = msg;
}
}
}
示例3: createGui
import org.stjs.javascript.jquery.Event; //導入依賴的package包/類
private void createGui() {
final ChatWebPage that = this;
$(TITLE_ID).text("Chat WebPage").addClass(HEADING);
$(CONTENT_ID).append(content = $("<div id=\"chatContent\"></div>"));
$(CONTENT_ID).append(input = $("<input id=\"chatInput\" type=\"text\"></input>"));
$(CONTENT_ID).append(status = $("<div id=\"chatStatus\"></div>"));
input.keydown(new EventHandler() {
@Override
public boolean onEvent(Event event, Element THIS) {
that.onInputKeyDown(event);
return true;
}
});
}
示例4: init
import org.stjs.javascript.jquery.Event; //導入依賴的package包/類
public void init(AdminDescription desc) {
final Admin that = this;
this.desc = desc;
$("#datasources").tabs(new TabsOptions<NetxiliaJQuery>() {
{
select = new UIEventHandler<TabsUI<NetxiliaJQuery>>() {
public boolean onEvent(Event event, TabsUI<NetxiliaJQuery> ui, Element THIS) {
if (ui.index < that.desc.datasources.$length()) {
that.viewDatasource(that.desc.datasources.$get(ui.index));
} else {
that.newDatasource();
}
return false;
}
};
}
});
$("#datasources").tabs("select", 0);
that.viewDatasource(that.desc.datasources.$get(0));
$("#createAdminForm").validate();
}
示例5: add
import org.stjs.javascript.jquery.Event; //導入依賴的package包/類
public void add(String combination, Function1<Event, Boolean> handler, boolean propagate) {
Array<String> keys = $castArray(combination.toLowerCase().split("+"));
int metaCode = 0, code = 0;
for (int k : keys) {
String key = keys.$get(k);
if (meta.$get(key) != null) {
metaCode += meta.$get(key);
} else if (special_keys.$get(key) != null) {
code = special_keys.$get(key);
} else {
code = charCodeAt(key.toUpperCase(), 0);
}// the upper case letter
}
Handler h = new Handler(handler, propagate, combination, metaCode * 1000 + code);
this.handlers.$put(metaCode * 1000 + code, h);
}
示例6: _mouseStart
import org.stjs.javascript.jquery.Event; //導入依賴的package包/類
@Override
@SuppressWarnings("unchecked")
protected void _mouseStart(Event event) {
final ThreeColumn<FullJQuery> that = this;
this.position = event.pageX;
if (this.handleLeft != null && this.handleLeft.get(0) == event.target) {
this.incrementer = new Callback1<Integer>() {
public void $invoke(Integer i) {
that.incrLeft(i);
}
};
} else if (this.handleRight != null && this.handleRight.get(0) == event.target) {
this.incrementer = new Callback1<Integer>() {
public void $invoke(Integer i) {
that.incrRight(i);
}
};
}
this.resizeMask = (FullJQuery) $("<div class='ui-resizable-mask'></div>").appendTo(this.col1);
}
示例7: render
import org.stjs.javascript.jquery.Event; //導入依賴的package包/類
@Override
public void render() {
final TestWebPage that = this;
$(window).load(new EventHandler() {
@Override
public boolean onEvent(Event event, Element element) {
that.onLoad();
return true;
}
});
}
示例8: createGui
import org.stjs.javascript.jquery.Event; //導入依賴的package包/類
private void createGui() {
final ChatWebPage that = this;
$(TITLE_ID).text("Chat WebPage").addClass(HEADING_STYLE);
$(CONTENT_ID).append(content = $("<div id=\"chatContent\"></div>"));
$(CONTENT_ID).append(input = $("<input id=\"chatInput\" type=\"text\"></input>"));
$(CONTENT_ID).append(status = $("<div id=\"chatStatus\"></div>"));
input.keydown((Event event, Element THIS) -> {
that.onInputKeyDown(event);
return true;
});
}
示例9: onLoad
import org.stjs.javascript.jquery.Event; //導入依賴的package包/類
@Override
public void onLoad() {
$(TITLE_ID).text("JQuery UI WebPage").addClass(HEADING_STYLE);
ButtonOptions buttonOptions = new ButtonOptions();
buttonOptions.label = ((Date)getModel().$get(MY_MODEL_KEY)).toGMTString();
$("#" + MY_CONTENT_ID).button(buttonOptions).click((Event ev, Element THIS) -> {
alert("clicked :-)");
return true;
});
}
示例10: onLoad
import org.stjs.javascript.jquery.Event; //導入依賴的package包/類
@Override
public void onLoad() {
$(TITLE_ID).text("Gui WebPage").addClass(HEADING);
ButtonOptions buttonOptions = new ButtonOptions();
buttonOptions.label = ((Date)getModel().$get(MY_MODEL_KEY)).toGMTString();
$("#" + MY_CONTENT_ID).button(buttonOptions).click(new EventHandler() {
@Override
public boolean onEvent(Event ev, Element THIS) {
alert("clicked :-)");
return true;
}
});
}
示例11: render
import org.stjs.javascript.jquery.Event; //導入依賴的package包/類
@Override
public void render() {
final AbstractWebPage that = this;
$(window).load(new EventHandler() {
@Override
public boolean onEvent(Event event, Element element) {
MenuBuilder.build($(MENU_ID));
that.onLoad();
return true;
}
});
}
示例12: render
import org.stjs.javascript.jquery.Event; //導入依賴的package包/類
@Override
public void render() {
ButtonOptions buttonOptions = new ButtonOptions();
buttonOptions.label = "Click me";
$(CONTAINER_ID)
.append((JQuery) $("<h1>I'm a Knorxx Framework application!</h1>"))
.append($("<div>").button(buttonOptions).click((Event event, Element elmnt) -> {
alert("Hello Knorxx!");
return true;
}));
}
示例13: moveMode
import org.stjs.javascript.jquery.Event; //導入依賴的package包/類
private void moveMode(Shortcuts sh, String key, final Callback0 f) {
final Sheet that = this;
sh.add(key, new Function1<Event, Boolean>() {
@Override
public Boolean $invoke(Event p1) {
if (that.editMode() && !that.editingContext.defaultEditor && that.captureSelection == null) {
return true;
}
f.$invoke();
return false;
}
}, true);
}
示例14: addInternal
import org.stjs.javascript.jquery.Event; //導入依賴的package包/類
private void addInternal(String combination, final Callback0 handler, boolean propagate) {
add(combination, new Function1<Event, Boolean>() {
@Override
public Boolean $invoke(Event p1) {
handler.$invoke();
return false;
}
}, propagate);
}
示例15: handleEvent
import org.stjs.javascript.jquery.Event; //導入依賴的package包/類
public boolean handleEvent(Event e) {
// if (e.keyCode == 17) {
// e.preventDefault();
// return;
// }
int code = e.keyCode;
int metaCode = 0;
if (e.ctrlKey) {
metaCode += CTRL;
}
if (e.shiftKey) {
metaCode += SHIFT;
}
if (e.altKey) {
metaCode += ALT;
}
// if(e.metaKey) metaCode += mask.META;
Handler h = this.handlers.$get(metaCode * 1000 + code);
if (h == null) {
h = this.defaultHandler;
}
if (h != null) {
boolean ret = h.handler.$invoke(e);
if (!ret && !h.propagate) {
e.preventDefault();
}
return h.propagate && ret;
}
return true;
}