Java Code Examples for com.google.gwt.event.dom.client.ClickHandler

The following are top voted examples for showing how to use com.google.gwt.event.dom.client.ClickHandler. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: unitimes   File: UniTimeDialogBox.java   View source code 7 votes vote down vote up
public UniTimeDialogBox(boolean autoHide, boolean modal) {
      super(autoHide, modal);
      
setAnimationEnabled(true);
setGlassEnabled(true);
	
      iContainer = new FlowPanel();
      iContainer.addStyleName("dialogContainer");
      
      iClose = new Anchor();
  	iClose.setTitle(MESSAGES.hintCloseDialog());
      iClose.setStyleName("close");
      iClose.addClickHandler(new ClickHandler() {
      	@Override
          public void onClick(ClickEvent event) {
              onCloseClick(event);
          }
      });
      iClose.setVisible(autoHide);

      iControls = new FlowPanel();
      iControls.setStyleName("dialogControls");        
      iControls.add(iClose);
  }
 
Example 2
Project: empiria.player   File: NavigationButtonModule.java   View source code 6 votes vote down vote up
@Override
public Widget getView() {
    if (button == null) {
        button = new CustomPushButton();
        button.setStyleName(getStyleName());
        button.addClickHandler(new ClickHandler() {

            @Override
            public void onClick(ClickEvent event) {
                if (isEnabled() && !isEnd()) {
                    flowRequestInvoker.invokeRequest(direction.getRequest());
                }
            }
        });
    }

    return button;
}
 
Example 3
Project: appinventor-extensions   File: GalleryPage.java   View source code 6 votes vote down vote up
/**
 * Helper method called by constructor to initialize the cancel button
 */
private void initCancelButton() {
  cancelButton = new Button(MESSAGES.galleryCancelText());
  cancelButton.addClickHandler(new ClickHandler() {
    @Override
    public void onClick(ClickEvent event) {
      if (editStatus==NEWAPP) {
        Ode.getInstance().switchToProjectsView();
      }else if(editStatus==UPDATEAPP){
        Ode.getInstance().switchToGalleryAppView(app, GalleryPage.VIEWAPP);
      }
    }
  });
  cancelButton.addStyleName("app-action-button");
  appAction.add(cancelButton);
}
 
Example 4
Project: empiria.player   File: TwoStateButton.java   View source code 6 votes vote down vote up
public TwoStateButton(String upStyleName, String downStyleName) {
    super();

    this.upStyleName = upStyleName;
    this.downStyleName = downStyleName;
    updateStyleName();

    addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent arg0) {
            stateDown = !stateDown;
            updateStyleName();
        }
    });
}
 
Example 5
Project: empiria.player   File: ExplanationControllerTest.java   View source code 6 votes vote down vote up
@Test
public void shouldCallPlayOrStopEntryOnPlayButtonClick() {
    // given
    String file = "test.mp3";
    Entry entry = mock(Entry.class);
    when(entry.getEntrySound()).thenReturn(file);

    doAnswer(new Answer<Void>() {
        @Override
        public Void answer(InvocationOnMock invocation) {
            clickHandler = (ClickHandler) invocation.getArguments()[0];
            return null;
        }
    }).when(explanationView).addEntryPlayButtonHandler(any(ClickHandler.class));

    // when
    testObj.init();
    testObj.processEntry(entry);
    clickHandler.onClick(null);

    // then
    verify(entryDescriptionSoundController).playOrStopEntrySound(entry.getEntrySound());
}
 
Example 6
Project: empiria.player   File: TextActionProcessorTest.java   View source code 6 votes vote down vote up
@Test
public void shouldHideFeedback() {
    //given
    Element element = mock(Element.class);
    testObj.initModule(element);
    verify(feedbackPresenter).addCloseButtonClickHandler(clickHandlerCaptor.capture());
    ClickHandler clickHandler = clickHandlerCaptor.getValue();
    ClickEvent clickEvent = mock(ClickEvent.class);

    //when
    clickHandler.onClick(clickEvent);

    //then
    verify(feedbackPresenter, times(2)).hideFeedback();
    verify(feedbackBlend, times(2)).hide();
}
 
Example 7
Project: empiria.player   File: ShowAnswersButtonModuleTest.java   View source code 6 votes vote down vote up
@Before
public void before() {
    setUp(new Class<?>[]{CustomPushButton.class}, new Class<?>[]{}, new Class<?>[]{EventsBus.class}, new CustomGuiceModule());
    instance = spy(injector.getInstance(ShowAnswersButtonModule.class));
    eventsBus = injector.getInstance(EventsBus.class);
    requestInvoker = mock(FlowRequestInvoker.class);
    button = injector.getInstance(CustomPushButton.class);
    styleNameConstants = injector.getInstance(ModeStyleNameConstants.class);
    doAnswer(new Answer<ClickHandler>() {

        @Override
        public ClickHandler answer(InvocationOnMock invocation) throws Throwable {
            handler = (ClickHandler) invocation.getArguments()[0];
            return null;
        }
    }).when(button)
            .addClickHandler(any(ClickHandler.class));
}
 
Example 8
Project: empiria.player   File: CheckButtonModuleTest.java   View source code 6 votes vote down vote up
@Before
public void before() {
    setUp(new Class<?>[]{CustomPushButton.class}, new Class<?>[]{}, new Class<?>[]{EventsBus.class}, new CustomGuiceModule());
    instance = spy(injector.getInstance(CheckButtonModule.class));
    eventsBus = injector.getInstance(EventsBus.class);
    styleNameConstants = injector.getInstance(ModeStyleNameConstants.class);
    requestInvoker = mock(FlowRequestInvoker.class);
    button = injector.getInstance(CustomPushButton.class);
    doAnswer(new Answer<ClickHandler>() {

        @Override
        public ClickHandler answer(InvocationOnMock invocation) throws Throwable {
            handler = (ClickHandler) invocation.getArguments()[0];
            return null;
        }
    }).when(button)
            .addClickHandler(any(ClickHandler.class));
}
 
Example 9
Project: appinventor-extensions   File: Toolbar.java   View source code 6 votes vote down vote up
/**
 * Adds a button to the toolbar
 *
 * @param item button to add
 * @param rightAlign {@code true} if the button should be right-aligned,
 *                   {@code false} if left-aligned
 */
protected void addButton(final ToolbarItem item, boolean rightAlign) {
  TextButton button = new TextButton(item.caption);
  button.addClickHandler(new ClickHandler() {
    @Override
    public void onClick(ClickEvent event) {
      item.command.execute();
    }
  });
  if (rightAlign) {
    rightButtons.add(button);
  } else {
    leftButtons.add(button);
  }
  buttonMap.put(item.widgetName, button);
}
 
Example 10
Project: empiria.player   File: ButtonModulePresenterTest.java   View source code 6 votes vote down vote up
@Test
public void shouldOpenURl() {
    // given
    doAnswer(new Answer<Void>() {
        @Override
        public Void answer(InvocationOnMock invocation) throws Throwable {
            clickHandler = (ClickHandler) invocation.getArguments()[0];
            return null;
        }
    }).when(view).addAnchorClickHandler(any(ClickHandler.class));

    instance.setBean(bean);
    instance.init();

    ClickEvent clickEvent = mock(ClickEvent.class);

    // when
    clickHandler.onClick(clickEvent);

    // then
    verify(assetOpenDelegatorService).open(URL);
    verify(clickEvent).preventDefault();
}
 
Example 11
Project: empiria.player   File: FeedbackAudioMuteButtonModuleTest.java   View source code 6 votes vote down vote up
@Before
public void before() {
    setUp(new Class<?>[]{CustomPushButton.class}, new Class<?>[]{}, new Class<?>[]{EventsBus.class}, new CustomGuiceModule());

    testObj = spy(injector.getInstance(FeedbackAudioMuteButtonModule.class));
    eventsBus = injector.getInstance(EventsBus.class);
    currentPageProperties = injector.getInstance(CurrentPageProperties.class);
    requestInvoker = mock(FlowRequestInvoker.class);
    button = injector.getInstance(CustomPushButton.class);
    styleNameConstants = injector.getInstance(ModeStyleNameConstants.class);
    doAnswer(new Answer<ClickHandler>() {

        @Override
        public ClickHandler answer(InvocationOnMock invocation) throws Throwable {
            handler = (ClickHandler) invocation.getArguments()[0];
            return null;
        }
    }).when(button)
            .addClickHandler(any(ClickHandler.class));
}
 
Example 12
Project: EasyML   File: SaveDatasetPanel.java   View source code 6 votes vote down vote up
@Override
protected void init(){
	grid = new DescribeGrid(labarr, "data");
	verticalPanel.add(grid);
	grid.addStyleName("bda-descgrid-savedata");
	savebtn.setStyleName("bda-descgrid-savedata-submitbtn");
	SimplePanel simPanel = new SimplePanel();
	simPanel.add( savebtn );
	simPanel.setStyleName("bda-descgrid-savedata-simpanel");
	verticalPanel.add(simPanel);
	savebtn.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent event) {
			dbController.submitSaveDataset2DB(panel,SaveDatasetPanel.this, dataset,grid);
		}
	});
}
 
Example 13
Project: EasyML   File: SqlScriptFileConfigTable.java   View source code 6 votes vote down vote up
public SqlScriptFileConfigTable(SqlProgramWidget widget, String name){
	this.widget = widget;
	this.name = name;
	this.insertRow(0);
	Label add = new Label();
	add.addStyleName("admin-user-edit");
	this.setWidget(0, 0, new Label(name));
	this.setWidget(0, 1, new Label());
	this.setWidget(0, 2, add);
	this.setWidget(0, 3, new Label());
	add.addClickHandler(new ClickHandler(){

		@Override
		public void onClick(ClickEvent event) {
			int i = 0;
			while( i < SqlScriptFileConfigTable.this.getRowCount() 
					&& SqlScriptFileConfigTable.this.getWidget(i, 2 ) != event.getSource() ) i ++ ;

			if( i < SqlScriptFileConfigTable.this.getRowCount() ){
				addRow( i, "");
			}

		}

	});
}
 
Example 14
Project: unitimes   File: SolverPage.java   View source code 6 votes vote down vote up
public SolverStatus() {
	super("unitime-SolverStatus");
	iStatus = new P("status-label");
	iIcon = new Image(RESOURCES.helpIcon()); iIcon.addStyleName("status-icon");
	iIcon.setVisible(false);
	add(iStatus); add(iIcon);
	RPC.execute(new PageNameRpcRequest("Solver Status"), new AsyncCallback<PageNameInterface>() {
		@Override
		public void onFailure(Throwable caught) {}
		@Override
		public void onSuccess(final PageNameInterface result) {
			iIcon.setTitle(MESSAGES.pageHelp(result.getName()));
			iIcon.setVisible(true);
			iIcon.addClickHandler(new ClickHandler() {
				@Override
				public void onClick(ClickEvent event) {
					if (result.getHelpUrl() == null || result.getHelpUrl().isEmpty()) return;
					UniTimeFrameDialog.openDialog(MESSAGES.pageHelp(result.getName()), result.getHelpUrl());
				}
			});
		}
	});
}
 
Example 15
Project: unitimes   File: CourseRequestBox.java   View source code 6 votes vote down vote up
@Override
public void addChip(Chip chip, boolean fireEvents) {
	final ChipPanel panel = new ChipPanel(chip, getChipColor(chip));
	panel.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent event) {
			remove(panel);
			resizeFilterIfNeeded();
			setAriaLabel(toAriaString());
			ValueChangeEvent.fire(CourseRequestFilterBox.this, getValue());
		}
	});
	insert(panel, getWidgetIndex(iFilterFinder));
	resizeFilterIfNeeded();
	setAriaLabel(toAriaString());
	if (fireEvents)
		ValueChangeEvent.fire(this, getValue());
}
 
Example 16
Project: unitimes   File: UniTimeHeaderPanel.java   View source code 6 votes vote down vote up
private Button addButton(String operation, String name, Character accessKey, String width, ClickHandler clickHandler) {
	Button button = new AriaButton(name);
	button.addClickHandler(clickHandler);
	ToolBox.setWhiteSpace(button.getElement().getStyle(), "nowrap");
	if (accessKey != null)
		button.setAccessKey(accessKey);
	if (width != null)
		ToolBox.setMinWidth(button.getElement().getStyle(), width);
	iOperations.put(operation, iButtons.getWidgetCount());
	iClickHandlers.put(operation, clickHandler);
	iButtons.add(button);
	button.getElement().getStyle().setMarginLeft(4, Unit.PX);
	for (UniTimeHeaderPanel clone: iClones) {
		Button clonedButton = clone.addButton(operation, name, null, width, clickHandler);
		clonedButton.addKeyDownHandler(iKeyDownHandler);
	}
	button.addKeyDownHandler(iKeyDownHandler);
	return button;
}
 
Example 17
Project: unitimes   File: WebTable.java   View source code 6 votes vote down vote up
public LockCell(boolean check, String text, String ariaLabel) {
	super(null);
	if (CONSTANTS.listOfClassesUseLockIcon()) {
		iCheck = new AriaToggleButton(RESOURCES.locked(), RESOURCES.unlocked());
	} else {
		iCheck = new AriaCheckBox();
	}
	if (text != null)
		((HasText)iCheck).setText(text);
	iCheck.setValue(check);
	((HasClickHandlers)iCheck).addClickHandler(new ClickHandler() {
		public void onClick(ClickEvent event) {
			event.stopPropagation();
		}
	});
	if (ariaLabel != null) setAriaLabel(ariaLabel);
}
 
Example 18
Project: unitimes   File: WebTable.java   View source code 6 votes vote down vote up
public IconCell(ImageResource resource, final String title, String text) {
	super(null);
	iIcon = new Image(resource);
	iIcon.setTitle(title);
	iIcon.setAltText(title);
	if (text != null && !text.isEmpty()) {
		iLabel = new HTML(text, false);
		iPanel = new HorizontalPanel();
		iPanel.setStyleName("icon");
		iPanel.add(iIcon);
		iPanel.add(iLabel);
		iIcon.getElement().getStyle().setPaddingRight(3, Unit.PX);
		iPanel.setCellVerticalAlignment(iIcon, HasVerticalAlignment.ALIGN_MIDDLE);
	}
	iIcon.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent event) {
			event.stopPropagation();
			UniTimeConfirmationDialog.info(title);
		}
	});
}
 
Example 19
Project: unitimes   File: WebTable.java   View source code 6 votes vote down vote up
public IconsCell add(ImageResource resource, final String title) {
	if (resource == null) return this;
	Image icon = new Image(resource);
	icon.setTitle(title);
	icon.setAltText(title);
	if (iPanel.getWidgetCount() > 0)
		icon.getElement().getStyle().setPaddingLeft(3, Unit.PX);
	iPanel.add(icon);
	iPanel.setCellVerticalAlignment(icon, HasVerticalAlignment.ALIGN_MIDDLE);
	if (title != null && !title.isEmpty()) {
		icon.addClickHandler(new ClickHandler() {
			@Override
			public void onClick(ClickEvent event) {
				event.stopPropagation();
				UniTimeConfirmationDialog.info(title);
			}
		});
	}
	return this;
}
 
Example 20
Project: unitimes   File: WebTable.java   View source code 6 votes vote down vote up
public NoteCell(String text, final String title) {
	super(null);
	if (Window.getClientWidth() <= 800 && title != null && !title.isEmpty()) {
		iIcon = new Image(RESOURCES.note());
		iIcon.setTitle(title);
		iIcon.setAltText(title);
		iIcon.addClickHandler(new ClickHandler() {
			@Override
			public void onClick(ClickEvent event) {
				event.stopPropagation();
				UniTimeConfirmationDialog.info(title);
			}
		});
	} else {
		iNote = new P("unitime-Note");
		iNote.setHTML(text);
		if (title != null) iNote.setTitle(title);
	}
}
 
Example 21
Project: appinventor-extensions   File: Toolbar.java   View source code 6 votes vote down vote up
/**
 *
 * @param item button to add
 * @param rightAlign true if button is right-aligned, false if left
 * @param top special styling if the button is on the top.
 */
protected void addButton(final ToolbarItem item, boolean rightAlign, boolean top) {
  TextButton button = new TextButton(item.caption);
  button.setStyleName("ode-TopPanelDropDownButton");
  button.addClickHandler(new ClickHandler() {
    @Override
    public void onClick(ClickEvent event) {
      item.command.execute();
    }
  });
  if (rightAlign) {
    rightButtons.add(button);
  } else {
    leftButtons.add(button);
  }
  buttonMap.put(item.widgetName, button);
}
 
Example 22
Project: appinventor-extensions   File: GalleryPage.java   View source code 6 votes vote down vote up
/**
 * Helper method called by constructor to initialize the report section
 */
private void initAppShare() {
  final HTML sharePrompt = new HTML();
  sharePrompt.setHTML(MESSAGES.gallerySharePrompt());
  sharePrompt.addStyleName("primary-prompt");
  final TextBox urlText = new TextBox();
  urlText.addStyleName("action-textbox");
  urlText.setText(Window.Location.getHost() + MESSAGES.galleryGalleryIdAction() + app.getGalleryAppId());
  urlText.addClickHandler(new ClickHandler() {
    @Override
    public void onClick(ClickEvent event) {
      urlText.selectAll();
    }
  });
  appSharePanel.add(sharePrompt);
  appSharePanel.add(urlText);
}
 
Example 23
Project: unitimes   File: FilterBox.java   View source code 6 votes vote down vote up
public void addChip(Chip chip, boolean fireEvents) {
	final ChipPanel panel = new ChipPanel(chip, getChipColor(chip));
	panel.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent event) {
			remove(panel);
			resizeFilterIfNeeded();
			setAriaLabel(toAriaString());
			ValueChangeEvent.fire(FilterBox.this, getValue());
		}
	});
	insert(panel, getWidgetIndex(iFilter));
	resizeFilterIfNeeded();
	setAriaLabel(toAriaString());
	if (fireEvents)
		ValueChangeEvent.fire(this, getValue());
}
 
Example 24
Project: unitimes   File: PageLabelImpl.java   View source code 6 votes vote down vote up
public PageLabelImpl() {
       iName = new P("text");
       
	iHelp = new Image(RESOURCES.help());
	iHelp.addStyleName("icon");
	iHelp.setVisible(false);
	
	add(iName);
	add(iHelp);
	
	iHelp.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent event) {
			if (iUrl == null || iUrl.isEmpty()) return;
			UniTimeFrameDialog.openDialog(MESSAGES.pageHelp(getText()), iUrl);
		}
	});
}
 
Example 25
Project: unitimes   File: InfoPanelImpl.java   View source code 6 votes vote down vote up
@Override
public void setClickHandler(ClickHandler clickHandler) {
	iTextClick.removeHandler();
	iHintClick.removeHandler();
	if (clickHandler == null) {
		if (iUrl != null && !iUrl.isEmpty()) {
			iText.addStyleName("clickable");
			iHint.addStyleName("clickable");
			iHint.setTabIndex(0);
		}
		iTextClick = iHint.addClickHandler(iDefaultClickHandler);
		iHintClick = iText.addClickHandler(iDefaultClickHandler);
	} else {
		iText.addStyleName("clickable");
		iHint.addStyleName("clickable");
		iHint.setTabIndex(0);
		iTextClick = iHint.addClickHandler(clickHandler);
		iHintClick = iText.addClickHandler(clickHandler);
	}
}
 
Example 26
Project: appinventor-extensions   File: DropDownButton.java   View source code 6 votes vote down vote up
public DropDownButton(String widgetName, Image icon, List<DropDownItem> toolbarItems,
                      boolean rightAlign) {
  super(icon);  // icon for button

  this.menu = new ContextMenu();
  this.items = new ArrayList<MenuItem>();
  this.rightAlign = rightAlign;

  for (DropDownItem item : toolbarItems) {
    if (item != null) {
      addItem(item);
    } else {
      menu.addSeparator();
    }
  }

  addClickHandler(new ClickHandler() {
    @Override
    public void onClick(ClickEvent event) {
      menu.setPopupPositionAndShow(new DropDownPositionCallback(getElement()));
    }
  });
}
 
Example 27
Project: empiria.player   File: DefaultAudioPlayerModule.java   View source code 5 votes vote down vote up
private void addClickHandler() {
    button.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            if (mediaWrapper == null) {
                createMediaWrapperAndPlayAudio(sources);
            } else {
                playAudio();
            }
        }
    });
}
 
Example 28
Project: empiria.player   File: ExplanationController.java   View source code 5 votes vote down vote up
private void addExplanationPlayButtonHandler() {
    this.explanationView.addPlayButtonHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            explanationDescriptionSoundController.playOrStopExplanationSound(entry.getEntryExampleSound());
        }
    });
}
 
Example 29
Project: empiria.player   File: ExplanationController.java   View source code 5 votes vote down vote up
private void addEntryPlayButtonHandler() {
    this.explanationView.addEntryPlayButtonHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            entryDescriptionSoundController.playOrStopEntrySound(entry.getEntrySound());
        }
    });
}
 
Example 30
Project: empiria.player   File: SlideshowButtonsViewImpl.java   View source code 5 votes vote down vote up
private ClickHandler createOnStopClickCommand() {
    return new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            presenter.onStopClick();
        }
    };
}
 
Example 31
Project: empiria.player   File: SlideshowButtonsViewImpl.java   View source code 5 votes vote down vote up
private ClickHandler createOnPreviousClickCommand() {
    return new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            presenter.onPreviousClick();
        }
    };
}
 
Example 32
Project: empiria.player   File: SlideshowButtonsViewImpl.java   View source code 5 votes vote down vote up
private ClickHandler createOnPlayClickCommand() {
    return new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            presenter.onPlayPauseClick();
        }
    };
}
 
Example 33
Project: unitimes   File: UniTimeNotifications.java   View source code 5 votes vote down vote up
protected void addNotification(final Notification notification) {
	RootPanel.get().add(notification, Window.getScrollLeft() + Window.getClientWidth() - 445, Window.getScrollTop() + Window.getClientHeight());
	iAnimation.cancel();
	for (Iterator<Notification> i = iNotifications.iterator(); i.hasNext(); ) {
		Notification n = i.next();
		if (n.equals(notification)) {
			n.hide(); i.remove();
		}
	}
	move();
	iNotifications.add(0, notification);
	iAnimation.run(1000);
	Timer timer = new Timer() {
		@Override
		public void run() {
			notification.hide();
			iNotifications.remove(notification);
		}
	};
	notification.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent event) {
			notification.hide();
			iNotifications.remove(notification);
			move();
		}
	});
	timer.schedule(10000);
}
 
Example 34
Project: empiria.player   File: BookmarkingHelper.java   View source code 5 votes vote down vote up
public void setClickCommand(final Command command) {
    view.addDomHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            command.execute();
        }
    }, ClickEvent.getType());
}
 
Example 35
Project: unitimes   File: RestrictionsTable.java   View source code 5 votes vote down vote up
public void addChildNode(Node node) {
	iChildren.add(node);
	update();
	if (iChildren.size() == 1) {
		iImage.addClickHandler(new ClickHandler() {
			@Override
			public void onClick(ClickEvent event) {
				setOpened(!isOpened());
			}
		});
	}
}
 
Example 36
Project: empiria.player   File: ButtonModulePresenter.java   View source code 5 votes vote down vote up
private void addClickHandler() {
    view.addAnchorClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            String path = buttonBean.getHref();
            assetOpenDelegatorService.open(path);
            event.preventDefault();
        }
    });
}
 
Example 37
Project: empiria.player   File: AbstractActivityButtonModule.java   View source code 5 votes vote down vote up
@Override
public void initModule(Element element) {// NOPMD
    updateStyleName();
    button.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            if (isEnabled) {
                invokeRequest();
            }
        }
    });
}
 
Example 38
Project: empiria.player   File: PicturePlayerViewImpl.java   View source code 5 votes vote down vote up
private ClickHandler createOnOpenFullscreenCommand() {
    return new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            presenter.openFullscreen();
        }
    };
}
 
Example 39
Project: empiria.player   File: ToolboxButtonCreator.java   View source code 5 votes vote down vote up
private ClickHandler createPaletteButtonClickHandler(final ColorModel color) {
    return new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            if (presenter != null) {
                presenter.colorClicked(color);
            }
        }
    };
}
 
Example 40
Project: empiria.player   File: MenuPresenter.java   View source code 5 votes vote down vote up
private ClickHandler createClickCommand() {
    return new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            if (isHidden) {
                show();
            } else {
                hide();
            }
        }
    };
}