Java Code Examples for com.google.gwt.user.client.ui.Widget

The following are top voted examples for showing how to use com.google.gwt.user.client.ui.Widget. 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: bootstrap-formgroup   File: ClientSideFormGroup.java   View source code 6 votes vote down vote up
public void setWidget(Widget w, boolean delegateCaptionHandling) {
    if (w != null) {
        this.widgetType = VaadinWidgetUtils.getWidgetTypeByWidget(w);
        this.widgetElement = VaadinWidgetUtils.getElementByVaadinWidget(w, this.widgetType);
        if (this.widgetType.isAddStyle()) {
            this.widgetElement.addClassName(this.widgetType.getCssStyle());
        } else {
            this.widgetElement.setClassName(this.widgetType.getCssStyle());
        }
        if (delegateCaptionHandling) {
            getElement().appendChild(label = DOM.createLabel());
        } else {
            getElement().appendChild(label = DOM.createDiv());
        }
        getElement().appendChild(div);
    }
    super.setWidget(w);

    if (w != null) {
        getContainerElement().appendChild(small);
        getContainerElement().appendChild(feedback);
    }
}
 
Example 2
Project: unitimes   File: EventRoomAvailability.java   View source code 6 votes vote down vote up
@Override
public List<SelectionInterface> getSelection() {
	List<SelectionInterface> selection = new ArrayList<EventInterface.SelectionInterface>();
	for (int i = 0; i < iTables.getWidgetCount(); i++) {
		Widget w = iTables.getWidget(i);
		if (w instanceof TimeGrid)
			for (SelectionInterface s: ((TimeGrid)w).getSelections()) {
				SelectionInterface x = new SelectionInterface();
				x.setLength(s.getLength());
				x.setStartSlot(s.getStartSlot());
				for (ResourceInterface r: s.getLocations())
					x.addLocation(r);
				for (Integer d: s.getDays())
					x.addDay(iSelectedDates.get(d - iSelectedDates.get(0)));
				selection.add(x);
			}
	}
	return selection;
}
 
Example 3
Project: unitimes   File: InstructorAttributesTable.java   View source code 6 votes vote down vote up
protected Widget getCell(final AttributeInterface feature, final AttributesColumn column, final int idx) {
	switch (column) {
	case NAME:
		return new Label(feature.getName() == null ? "" : feature.getName(), false);
	case CODE:
		return new Label(feature.getCode() == null ? "" : feature.getCode(), false);
	case TYPE:
		if (feature.getType() == null)
			return null;
		else {
			Label type = new Label(feature.getType().getAbbreviation(), false);
			type.setTitle(feature.getType().getLabel());
			return type;
		}
	case PARENT:
		return new Label(feature.getParentName() == null ? "" : feature.getParentName(), false);
	case INSTRUCTORS:
		if (feature.hasInstructors())
			return new InstructorsCell(feature);
		else
			return null;
	default:
		return null;
	}
}
 
Example 4
Project: OSWf-OSWorkflow-fork   File: SimulatorView.java   View source code 6 votes vote down vote up
private final Widget buildProcessInstancesGrid() {
              
    commonGridSettings(processInstancesGrid);
    processInstancesGrid.setSelectionType(SelectionStyle.SINGLE);
    
    ListGridField nameField = new ListGridField("piid", "Process Instance ID", 120);
    ListGridField stateField = new ListGridField("state", "Process Instance State");
    ListGridField currentField = new ListGridField("current", "Current Steps", 100);
    ListGridField historyField = new ListGridField("history", "History Steps", 100);

    processInstancesGrid.setFields(new ListGridField[] { 
        integerField(nameField), 
        leftField(stateField), 
        integerField(currentField), 
        integerField(historyField)
    });
   
    return processInstancesGrid;
}
 
Example 5
Project: empiria.player   File: SlideshowPlayerModuleTest.java   View source code 6 votes vote down vote up
@Test
public void shouldInitModule_withTemplate() {
    // given
    Element element = mock(Element.class);

    SlideshowBean slideshowBean = new SlideshowBean();
    List<SlideBean> slides = Lists.newArrayList();
    slideshowBean.setSlideBeans(slides);

    SlideshowPlayerBean slideshowPlayer = new SlideshowPlayerBean();
    slideshowPlayer.setSlideshowBean(slideshowBean);

    when(moduleStructure.getBean()).thenReturn(slideshowPlayer);
    when(templateInterpreter.isPagerTemplateActivate(slideshowPlayer)).thenReturn(true);

    // when
    testObj.initModule(element, moduleSocket, eventsBus);

    // then
    verify(presenter).init(slideshowBean, inlineBodyGeneratorSocket);
    verify(controller).init(slideshowBean.getSlideBeans(), inlineBodyGeneratorSocket);
    verify(controller).initPager(slides.size());
    verify(presenter).setPager(any(Widget.class));
}
 
Example 6
Project: unitimes   File: UniTimeTable.java   View source code 6 votes vote down vote up
private boolean focus(int row, int col) {
	if (!getRowFormatter().isVisible(row) || col >= getCellCount(row)) return false;
	Widget w = super.getWidget(row, col);
	if (w == null || !w.isVisible()) return false;
	if (w instanceof SmartTableCell) {
		return ((SmartTableCell)w).focus();
	} else if (w instanceof HasFocus) {
		return ((HasFocus)w).focus();
	} else if (w instanceof Focusable) {
		((Focusable)w).setFocus(true);
		if (w instanceof TextBoxBase)
			((TextBoxBase)w).selectAll();
		return true;
	}
	return false;
}
 
Example 7
Project: appinventor-extensions   File: MockComponent.java   View source code 6 votes vote down vote up
/**
 * Sets the components widget representation and initializes its properties.
 *
 * <p>To be called from implementing constructor.
 *
 * @param widget  components visual representation in designer
 */
void initComponent(Widget widget) {
  // Widget needs to be initialized before the component itself so that the component properties
  // can be reflected by the widget
  initWidget(widget);

  // Capture mouse and click events in onBrowserEvent(Event)
  sinkEvents(Event.MOUSEEVENTS | Event.ONCLICK);

  // Add the special name property and set the tooltip
  String name = componentName();
  setTitle(name);
  addProperty(PROPERTY_NAME_NAME, name, null, new TextPropertyEditor());

  // TODO(user): Ensure this value is unique within the project using a list of
  // already used UUIDs
  // Set the component's UUID
  // The default value here can be anything except 0, because YoungAndroidProjectServce
  // creates forms with an initial Uuid of 0, and Properties.java doesn't encode
  // default values when it generates JSON for a component.
  addProperty(PROPERTY_NAME_UUID, "-1", null, new TextPropertyEditor());
  changeProperty(PROPERTY_NAME_UUID, "" + Random.nextInt());

  editor.getComponentPalettePanel().configureComponent(this);
}
 
Example 8
Project: empiria.player   File: DefaultMediaProcessorExtension.java   View source code 5 votes vote down vote up
private MediaExecutor<Widget> createSwfExecutor(BaseMediaConfiguration bmc) {
    if (bmc.isFeedback()) {
        return simpleSwfExecutorProvider.get();
    } else {
        return createLocalSwfMediaExecutor();
    }
}
 
Example 9
Project: empiria.player   File: ImgModule.java   View source code 5 votes vote down vote up
/**
 * buduke widok na starych zasadach
 *
 * @param element
 */
protected void createOldView(Element element) {
    ImgContent content;
    imageSource = element.getAttribute("src");
    if (element.getElementsByTagName("label").getLength() > 0) {
        content = labelledImgContentProvider.get();
    } else {
        Map<String, String> styles = styleSocket.getStyles(element);
        if (styles.containsKey(EMPIRIA_IMG_MODE) && styles.get(EMPIRIA_IMG_MODE).equalsIgnoreCase("explorable")) {
            content = explorableImgContentProvider.get();
        } else {
            content = picturePlayerModuleProvider.get();
        }
    }
    content.init(element, getModuleSocket());
    view.setContent(content);
    NodeList titleNodes = element.getElementsByTagName("title");
    if (titleNodes.getLength() > 0) {
        Widget titleWidget = getModuleSocket().getInlineBodyGeneratorSocket().generateInlineBody(titleNodes.item(0));
        if (titleWidget != null) {
            view.setTitle(titleWidget);
        }
    }
    NodeList descriptionNodes = element.getElementsByTagName("description");
    if (descriptionNodes.getLength() > 0) {
        Widget descriptionWidget = getModuleSocket().getInlineBodyGeneratorSocket().generateInlineBody(descriptionNodes.item(0));
        if (descriptionWidget != null) {
            view.setDescription(descriptionWidget);
        }
    }
}
 
Example 10
Project: empiria.player   File: ExternalSoundInstanceCreator.java   View source code 5 votes vote down vote up
private CallbackReceiver<MediaWrapper<Widget>> createCallbackReceiver(final String audioName, final ExternalSoundInstanceCallback callback, final Optional<OnEndCallback> onEndCallback, final Optional<OnPauseCallback> onPauseCallback) {
    return new CallbackReceiver<MediaWrapper<Widget>>() {
        @Override
        public void setCallbackReturnObject(MediaWrapper<Widget> audioWrapper) {
            ExternalSoundInstance soundInstance = moduleFactory.getExternalSoundInstance(audioWrapper, onEndCallback, onPauseCallback);
            callback.onSoundCreated(soundInstance, audioName);
        }
    };
}
 
Example 11
Project: empiria.player   File: SlideshowPlayerPresenterTest.java   View source code 5 votes vote down vote up
@Test
public void shouldReturnViewAsWidget() {
    // given
    Widget widget = mock(Widget.class);
    when(view.asWidget()).thenReturn(widget);

    // when
    Widget result = testObj.getView();

    // then
    assertThat(result).isEqualTo(widget);
}
 
Example 12
Project: appinventor-extensions   File: TutorialPanel.java   View source code 5 votes vote down vote up
/**
 * Creates video on page!
 */
private static void createVideoDialog(String tutorialId) {
  // Create the UI elements of the DialogBox
  final DialogBox dialogBox = new DialogBox(true, true); // DialogBox(autohide, modal)
  dialogBox.setStylePrimaryName("ode-DialogBox");
  dialogBox.setText("Tutorial Video");
  dialogBox.setGlassEnabled(true);
  dialogBox.setAnimationEnabled(true);
  VerticalPanel DialogBoxContents = new VerticalPanel();
  // Adds Youtube Video
  HTML message = new HTML("<iframe width=\"560\" height=\"315\" src=\"https://www.youtube.com/embed/" + tutorialId + "?rel=0&autoplay=1\" frameborder=\"0\" allowfullscreen></iframe>");
  message.setStyleName("DialogBox-message");
  FlowPanel holder = new FlowPanel();
  Button ok = new Button("Close");
  ok.addClickListener(new ClickListener() {
      public void onClick(Widget sender) {
        dialogBox.hide();
      }
    });
  ok.setStyleName("DialogBox-button");
  holder.add(ok);
  DialogBoxContents.add(message);
  DialogBoxContents.add(holder);
  dialogBox.setWidget(DialogBoxContents);
  dialogBox.center();
  dialogBox.show();
}
 
Example 13
Project: empiria.player   File: ItemController.java   View source code 5 votes vote down vote up
protected Widget createTitleWidget(String index, String text) {
    Panel titlePanel = new FlowPanel();
    titlePanel.setStyleName(styleNames.QP_ITEM_TITLE());
    Label indexLabel = new Label(index + ". ");
    indexLabel.setStyleName(styleNames.QP_ITEM_TITLE_INDEX());
    Label textLabel = new Label(text);
    textLabel.setStyleName(styleNames.QP_ITEM_TITLE_TEXT());
    titlePanel.add(indexLabel);
    titlePanel.add(textLabel);
    return titlePanel;
}
 
Example 14
Project: empiria.player   File: DragDropControllerTest.java   View source code 5 votes vote down vote up
private void mockDropEnabling() {
    @SuppressWarnings("unchecked")
    DroppableObject<FlowPanelWithDropZone> droppable = Mockito.mock(DroppableObject.class);
    when(dragGapView.enableDropCapabilities()).thenReturn(droppable);

    Widget droppableWidget = Mockito.mock(Widget.class);
    when(droppable.getDroppableWidget()).thenReturn(droppableWidget);

    dropZoneGuardian = Mockito.mock(DropZoneGuardian.class);
    when(dragGapModuleFactory.createDropZoneGuardian(droppable, droppableWidget)).thenReturn(dropZoneGuardian);
}
 
Example 15
Project: appinventor-extensions   File: MockComponentsUtil.java   View source code 5 votes vote down vote up
static void restoreSizeStyle(Widget w, String[] style) {
  Element element = w.getElement();
  if (style[0] != null) {
    DOM.setStyleAttribute(element, "width", style[0]);
  }
  if (style[1] != null) {
    DOM.setStyleAttribute(element, "height", style[1]);
  }
}
 
Example 16
Project: empiria.player   File: ExternalSoundInstance.java   View source code 5 votes vote down vote up
private void registerOnPauseCallback(MediaWrapper<Widget> audioWrapper, final Optional<OnPauseCallback> onPauseCallback) {
    if (onPauseCallback.isPresent()) {
        mediaWrapperController.addHandler(MediaEventTypes.ON_PAUSE, audioWrapper, new MediaEventHandler() {
            @Override
            public void onMediaEvent(MediaEvent event) {
                onPauseCallback.get().onPause();
            }
        });
    }
}
 
Example 17
Project: empiria.player   File: AudioModule.java   View source code 5 votes vote down vote up
private Widget prepareObjectModuleView(Element element, Element defaultTemplate) {
    AudioModuleView audioModuleView = new AudioModuleView();
    addStyleName(element, audioModuleView);
    Map<String, String> src = getSource(element, "audio");
    mediaWrapperCreator.createMediaWrapper(src, getCallbackRecevier(defaultTemplate, audioModuleView));
    return audioModuleView;
}
 
Example 18
Project: empiria.player   File: PageInPageModule.java   View source code 5 votes vote down vote up
@Override
public Widget getView() {
    if (pagePanel == null) {
        pagePanel = controller.getView();
        pagePanel.setStyleName(styleNames.QP_PAGE_IN_PAGE());
    }
    return pagePanel;
}
 
Example 19
Project: bootstrap-formgroup   File: ClientSideFormGroup.java   View source code 5 votes vote down vote up
void setFor(ComponentConnector forId) {
    Widget widget = forId.getWidget();

    // VNativeSelect need binding of Caption on the ListBox to get :focus
    if (widget instanceof VNativeSelect) {
        AriaHelper.bindCaption(((VNativeSelect) widget).getListBox(), label);
        return;
    }

    AriaHelper.bindCaption(widget, label);
}
 
Example 20
Project: appinventor-extensions   File: Ode.java   View source code 5 votes vote down vote up
/**
 * Possibly display the MIT App Inventor "Splash Screen"
 *
 * @param force Bypass the check to see if they have dimissed this version
 */
private void createWelcomeDialog(boolean force) {
  if (!shouldShowWelcomeDialog() && !force) {
    maybeShowNoProjectsDialog();
    return;
  }
  // Create the UI elements of the DialogBox
  final DialogBox dialogBox = new DialogBox(false, true); // DialogBox(autohide, modal)
  dialogBox.setStylePrimaryName("ode-DialogBox");
  dialogBox.setText(MESSAGES.createWelcomeDialogText());
  dialogBox.setHeight(splashConfig.height + "px");
  dialogBox.setWidth(splashConfig.width + "px");
  dialogBox.setGlassEnabled(true);
  dialogBox.setAnimationEnabled(true);
  dialogBox.center();
  VerticalPanel DialogBoxContents = new VerticalPanel();
  HTML message = new HTML(splashConfig.content);
  message.setStyleName("DialogBox-message");
  FlowPanel holder = new FlowPanel();
  Button ok = new Button(MESSAGES.createWelcomeDialogButton());
  final CheckBox noshow = new CheckBox(MESSAGES.doNotShow());
  ok.addClickListener(new ClickListener() {
      public void onClick(Widget sender) {
        dialogBox.hide();
        if (noshow.getValue()) { // User checked the box
          userSettings.getSettings(SettingsConstants.SPLASH_SETTINGS).
            changePropertyValue(SettingsConstants.SPLASH_SETTINGS_VERSION,
              "" + splashConfig.version);
          userSettings.saveSettings(null);
        }
        maybeShowNoProjectsDialog();
      }
    });
  holder.add(ok);
  holder.add(noshow);
  DialogBoxContents.add(message);
  DialogBoxContents.add(holder);
  dialogBox.setWidget(DialogBoxContents);
  dialogBox.show();
}
 
Example 21
Project: unitimes   File: CurriculaCourses.java   View source code 5 votes vote down vote up
public void addBlankLine() {
	List<Widget> line = new ArrayList<Widget>();

	HorizontalPanel hp = new HorizontalPanel();
	line.add(hp);

	CurriculaCourseSelectionBox cx = new CurriculaCourseSelectionBox();
	cx.setWidth("130px");
	cx.addCourseSelectionHandler(iCourseChangedHandler);
	if (cx.getCourseFinder() instanceof HasOpenHandlers)
		((HasOpenHandlers<PopupPanel>)cx.getCourseFinder()).addOpenHandler(new OpenHandler<PopupPanel>() {
			@Override
			public void onOpen(OpenEvent<PopupPanel> event) {
				iTable.clearHover();
			}
		});
	if (!iEditable) cx.setEnabled(false);
	line.add(cx);
	
	for (int col = 0; col < iClassifications.getClassifications().size(); col++) {
		ShareTextBox ex = new ShareTextBox(col, null, null);
		if (!iEditable) ex.setReadOnly(true);
		line.add(ex);
		EnrollmentLabel note = new EnrollmentLabel(col, null, null, null, null, null, null);
		line.add(note);
	}
	
	int row = iTable.addRow("", line);
	iTable.getRowFormatter().addStyleName(row, "unitime-NoPrint");
	if (iVisibleCourses != null) iTable.getRowFormatter().setVisible(row, false);
	for (int col = 0; col < line.size(); col++)
		if (!iTable.getCellFormatter().isVisible(0, col))
			iTable.getCellFormatter().setVisible(row, col, false);
}
 
Example 22
Project: empiria.player   File: SlideshowSoundController.java   View source code 5 votes vote down vote up
@Override
public void onMediaEvent(MediaEvent event) {
    MediaWrapper<Widget> onEndEventSource = (MediaWrapper<Widget>) event.getMediaWrapper();

    if (slideshowSounds.containsWrapper(onEndEventSource)) {
        slideEndHandler.onEnd();
    }
}
 
Example 23
Project: sig-seguimiento-vehiculos   File: SimpleThemingVerticalLegend.java   View source code 5 votes vote down vote up
@Override
protected List<Widget> getData() {

	Map<String, String> attrColorMap = createAttributeColorMap();
	List<Widget> widgets = new ArrayList<Widget>();
	for (Entry<String, String> attr : attrColorMap.entrySet()) {
		HorizontalPanel hpanel = new HorizontalPanel();
		hpanel.setSpacing(2);
		hpanel.add(getColorPanel(attr.getValue()));
		hpanel.add(new Label(attr.getKey()));

		widgets.add(hpanel);
	}
	return widgets;
}
 
Example 24
Project: sig-seguimiento-vehiculos   File: CopyElementDialog.java   View source code 5 votes vote down vote up
private Widget createPanel() {
	VerticalLayoutContainer panel = new VerticalLayoutContainer();
	
	initLayerCombo1();
	
	FieldLabel layer1Label = new FieldLabel(layerCombo1,
			UIMessages.INSTANCE.layerLabelText(""));
	panel.add(layer1Label, new VerticalLayoutData(1, -1));										

	return panel;
}
 
Example 25
Project: empiria.player   File: ConnectionModuleViewImplTest.java   View source code 5 votes vote down vote up
private Widget mockSurfaceWidget(ConnectionModuleViewImpl spyView) {
    ConnectionSurface surface = mock(ConnectionSurface.class);
    Widget widget = mock(Widget.class);
    when(surface.asWidget()).thenReturn(widget);
    doReturn(surface).when(spyView).getCurrentSurface();
    return widget;
}
 
Example 26
Project: unitimes   File: UniTimeTable.java   View source code 5 votes vote down vote up
public void refreshTable() {
	for (int r = 1; r < getRowCount(); r++) {
		for (int c = 0; c < getCellCount(r); c++) {
			Widget w = getWidget(r, c);
			if (w instanceof HasRefresh)
				((HasRefresh)w).refresh();
		}
	}
}
 
Example 27
Project: calendar-component   File: DateCellContainer.java   View source code 5 votes vote down vote up
@Override
public void onMouseDown(MouseDownEvent event) {
    clickTargetWidget = (Widget) event.getSource();

    event.stopPropagation();
}
 
Example 28
Project: empiria.player   File: ImgTemplateParser.java   View source code 5 votes vote down vote up
private MediaController createModuleWrapper(String elementName) {
    MediaController moduleWrapper = null;
    Widget widget = generateInlineBody(elementName);
    if (widget == null) {
        moduleWrapper = createEmptyModuleWrapper();
    } else {
        moduleWrapper = createModuleWrapperForWidget(widget);
    }
    return moduleWrapper;
}
 
Example 29
Project: empiria.player   File: SlideshowPagerPresenter.java   View source code 5 votes vote down vote up
public Widget createPager(int slidesSize) {
    for (int i = 0; i < slidesSize; i++) {
        SlideshowPagerButtonPresenter pagerButton = createPagerButton();
        pagerButtonsList.add(pagerButton);
        view.addPager(pagerButton.getView());
    }

    return view.asWidget();
}
 
Example 30
Project: empiria.player   File: PageSwitchModule.java   View source code 5 votes vote down vote up
@Override
public Widget getView() {
    if (switchWidget == null) {
        switchWidget = new PageSwitchListBox();
        switchWidget.addChangeHandler(this);
        switchWidget.setItemsCount(dataSourceSupplier.getItemsCount());

        ((Widget) switchWidget).setStyleName(getStyleName());
    }

    return (Widget) switchWidget;
}
 
Example 31
Project: unitimes   File: FilterBox.java   View source code 5 votes vote down vote up
private void fixHandlers(final FilterBox box, Widget w) {
	if (w instanceof HasBlurHandlers)
		((HasBlurHandlers)w).addBlurHandler(box.iBlurHandler);
	if (w instanceof HasFocusHandlers)
		((HasFocusHandlers)w).addFocusHandler(box.iFocusHandler);
	if (w instanceof HasKeyDownHandlers)
		((HasKeyDownHandlers)w).addKeyDownHandler(new KeyDownHandler() {
			@Override
			public void onKeyDown(KeyDownEvent event) {
				if (event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ESCAPE)
					if (box.isFilterPopupShowing()) box.hideFilterPopup();
			}
		});
}
 
Example 32
Project: unitimes   File: CourseFinderClasses.java   View source code 5 votes vote down vote up
public CheckBox getClassSelection(int row) {
	Widget w = getWidget(row, 0);
	if (w != null && w instanceof CheckBox) {
		return (CheckBox)w;
	} else {
		return null;
	}
}
 
Example 33
Project: sig-seguimiento-vehiculos   File: GitHubRepositoryListDialog.java   View source code 5 votes vote down vote up
private Widget createPanel() {
	final VerticalLayoutContainer vPanel = new VerticalLayoutContainer();
	vPanel.addStyleName(ThemeStyles.get().style().borderBottom());
	final GitHubRepositoryAttributeBeanProperties props = GWT
			.create(GitHubRepositoryAttributeBeanProperties.class);
	repositoryStore = new ListStore<GitHubRepositoryAttributeBean>(props.key());

	final ColumnConfig<GitHubRepositoryAttributeBean, Integer> idCol = new ColumnConfig<GitHubRepositoryAttributeBean, Integer>(
			props.attributeId(), 190, "Id");		
	final ColumnConfig<GitHubRepositoryAttributeBean, String> nameCol = new ColumnConfig<GitHubRepositoryAttributeBean, String>(
			props.attributeName(), 190, UIMessages.INSTANCE.gitHubColumNameRepo());
	final ColumnConfig<GitHubRepositoryAttributeBean, String> descriptionCol = new ColumnConfig<GitHubRepositoryAttributeBean, String>(
			props.description(), 200, UIMessages.INSTANCE.gitHubColumDescriptionRepo());
	
	final ColumnConfig<GitHubRepositoryAttributeBean, String> fullNameCol = new ColumnConfig<GitHubRepositoryAttributeBean, String>(
			props.attributeFullName(), 200, "Full Name");

	final List<ColumnConfig<GitHubRepositoryAttributeBean, ?>> columns = new ArrayList<ColumnConfig<GitHubRepositoryAttributeBean, ?>>();
	//columns.add(idCol);
	columns.add(nameCol);
	columns.add(descriptionCol);		
	//columns.add(fullNameCol);

	final ColumnModel<GitHubRepositoryAttributeBean> columModel = new ColumnModel<GitHubRepositoryAttributeBean>(
			columns);

	grid = new Grid<GitHubRepositoryAttributeBean>(
			repositoryStore, columModel);
	//grid.setSelectionModel(new CellSelectionModel<GitHubRepositoryAttributeBean>());
	grid.getColumnModel().getColumn(0).setHideable(false);
	grid.setAllowTextSelection(true);
	grid.getView().setStripeRows(true);
	grid.getView().setColumnLines(true);		
	grid.setBorders(false);
	setGridDragable(grid);
	
	vPanel.add(grid, new VerticalLayoutData(1, 1, new Margins(5, 0, 0, 0)));		

	return vPanel;
}
 
Example 34
Project: sig-seguimiento-vehiculos   File: MenuPanelWidget.java   View source code 5 votes vote down vote up
private Widget getSaveToolGroup1Tools() {
	HorizontalPanel horizontalGroup = new HorizontalPanel();
	horizontalGroup.getElement().getStyle()
			.setVerticalAlign(VerticalAlign.MIDDLE);
	horizontalGroup.setSpacing(5);
	horizontalGroup.add(saveLayerTool);
	horizontalGroup.add(exportLayerTool);
	//horizontalGroup.add(saveProjectTool);
	return horizontalGroup;
}
 
Example 35
Project: unitimes   File: RoomGroupsTable.java   View source code 5 votes vote down vote up
protected Widget getCell(final GroupInterface group, final RoomGroupsColumn column, final int idx) {
	switch (column) {
	case NAME:
		return new Label(group.getLabel() == null ? "" : group.getLabel(), false);
	case ABBREVIATION:
		return new Label(group.getAbbreviation() == null ? "" : group.getAbbreviation(), false);
	case DEFAULT:
		if (group.isDefault())
			return new Image(RESOURCES.on());
		else
			return null;
	case DEPARTMENT:
		return new DepartmentCell(true, group.getDepartment());
	case DESCRIPTION:
		if (group.hasDescription()) {
			HTML html = new HTML(group.getDescription());
			html.setStyleName("description");
			return html;
		} else
			return null;
	case ROOMS:
		if (group.hasRooms())
			return new RoomsCell(group);
		else
			return null;
	default:
		return null;
	}
}
 
Example 36
Project: unitimes   File: FilterBox.java   View source code 5 votes vote down vote up
public boolean removeChip(Chip chip, boolean fireEvents) {
	for (int i = 0; i < getWidgetCount(); i++) {
		Widget w = getWidget(i);
		if (w instanceof ChipPanel && ((ChipPanel)w).getChip().equals(chip)) {
			remove(i);
			resizeFilterIfNeeded();
			setAriaLabel(toAriaString());
			if (fireEvents)
				ValueChangeEvent.fire(FilterBox.this, getValue());
			return true;
		}
	}
	return false;
}
 
Example 37
Project: empiria.player   File: ItemViewCarrier.java   View source code 4 votes vote down vote up
public Widget getContentView() {
    return contentView;
}
 
Example 38
Project: empiria.player   File: ObjectTemplateParser.java   View source code 4 votes vote down vote up
@Override
public void parse(Node mainNode, Widget parent) {
    super.parse(mainNode, parent);

}
 
Example 39
Project: empiria.player   File: SoundExecutorSwfSimple.java   View source code 4 votes vote down vote up
@Override
public void setMediaWrapper(MediaWrapper<Widget> descriptor) {
}
 
Example 40
Project: empiria.player   File: WidgetSizeHelper.java   View source code 4 votes vote down vote up
public Rectangle getPlayerContainerRectangle() {
    Widget playerContainer = (Widget) accessor.getPlayerContainer();
    return toRectangle(playerContainer);
}