本文整理汇总了Java中com.codename1.ui.events.ActionEvent.consume方法的典型用法代码示例。如果您正苦于以下问题:Java ActionEvent.consume方法的具体用法?Java ActionEvent.consume怎么用?Java ActionEvent.consume使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.codename1.ui.events.ActionEvent
的用法示例。
在下文中一共展示了ActionEvent.consume方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: actionPerformed
import com.codename1.ui.events.ActionEvent; //导入方法依赖的package包/类
public void actionPerformed(ActionEvent ev) {
ev.consume();
switch(getId()) {
case 1:
// key press for activating clear causes keyRelease never to be
// called triggering a long click, this code disables the long click
releaseTime = System.currentTimeMillis();
pressedAndNotReleased = false;
longClick = false;
deleteChar();
break;
case 2:
ev.consume();
editString();
break;
}
}
示例2: onQueueAction
import com.codename1.ui.events.ActionEvent; //导入方法依赖的package包/类
public void onQueueAction(Component c, ActionEvent event)
{
event.consume();
final List list = (List) event.getSource();
final Map item = (Map)list.getSelectedItem();
Button clickedButton = ((GenericListCellRenderer)list.getRenderer()).extractLastClickedComponent();
if (clickedButton != null) {
// Occurs when touching a button
if (clickedButton.getName().equals("btnMediaActionFixed")) {
ArrayList<Command> commands = new ArrayList<Command>();
Image icon = StateMachine.getResourceFile().getImage("popup_trash_icon.png");
icon.lock();
commands.add(new Command(ui.translate("command_remove_item_from_playlist", "[default]Remove item"), icon) {
@Override
public void actionPerformed(ActionEvent evt) {
ui.player.removeFromQueue((Map) list.getSelectedItem());
if(ui.player.isQueueEmpty())
{
Display.getInstance().getCurrent().setTransitionOutAnimator(CommonTransitions.createEmpty());
ui.playerView.setFromMiniPlayer(false);
ui.back();
ui.back();
}
else
initQueueModel(list);
}
});
ui.dialogOptions.show(commands);
return;
}
}
ui.player.setQueueAndPlay((TrackListModel) list.getModel());
Display.getInstance().getCurrent().setTransitionOutAnimator(CommonTransitions.createFade(200));
ui.back();
}
示例3: actionPerformed
import com.codename1.ui.events.ActionEvent; //导入方法依赖的package包/类
public void actionPerformed(ActionEvent evt) {
JavascriptEvent jevt = (JavascriptEvent)evt;
JSObject source = jevt.getSelf();
String method = jevt.getMethod();
String key = source.toJSPointer()+"."+method;
JSFunction func = (JSFunction)callbacks.get(key);
if ( func == null ){
// No callback is registered for this method.
return;
}
func.apply(source, jevt.getArgs());
evt.consume();
}
示例4: actionPerformed
import com.codename1.ui.events.ActionEvent; //导入方法依赖的package包/类
@Override
public void actionPerformed(ActionEvent evt) {
evt.consume();
googleAnalytics.sendCrashReport((Throwable) evt.getSource());
}
示例5: actionPerformed
import com.codename1.ui.events.ActionEvent; //导入方法依赖的package包/类
public void actionPerformed(final ActionEvent evt) {
final Form f = getComponentForm();
Container layered = f.getLayeredPane(AutoCompleteTextField.this.getClass(), true);
boolean canOpenPopup = true;
for (int i = 0; i < layered.getComponentCount(); i++) {
Container wrap = (Container) layered.getComponentAt(i);
Component pop = wrap.getComponentAt(0);
if(pop.isVisible()){
if(!pop.contains(evt.getX(), evt.getY())){
pop.setVisible(false);
pop.setEnabled(false);
f.repaint();
evt.consume();
}else{
canOpenPopup = false;
}
}
}
if(!canOpenPopup || getText().length() < getMinimumLength()){
return;
}
if (contains(evt.getX(), evt.getY())) {
//if the suggestions are empty don't show the no need to show the popup
if(((List)popup.getComponentAt(0)).getModel().getSize() == 0){
return;
}
//something went wrong re-init the popup
if(popup.getAbsoluteX() != getAbsoluteX()){
removePopup();
addPopup();
}
evt.consume();
popup.getComponentAt(0).setScrollY(0);
popup.setVisible(true);
popup.setEnabled(true);
popup.repaint();
dontCalcSize = false;
f.revalidate();
dontCalcSize = true;
Display.getInstance().callSerially(new Runnable() {
public void run() {
pointerReleased(evt.getX(), evt.getY());
}
});
}
}