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

The following are top voted examples for showing how to use com.google.gwt.user.client.ui.HTML. 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: EasyML   File: BaseWidget.java   Source Code and License 6 votes vote down vote up
public BaseWidget(String text, String id) {
	this.label = new Label(text);
	p.setWidget(new HTML(text));
	p.getElement().getStyle().setZIndex(6);
	this.id = id;

	label.setStyleName("basewidget");
	label.setTitle(text);

	canvas = new GWTCanvas();
	abspanel.add(label, 0, 0);
	abspanel.add(canvas, 0, 0);
	focusPanel.add(abspanel.asWidget());
	focusPanel.setHeight("35px");
	focusPanel.setFocus(true);
	focusPanel.setStyleName("basefocuspanel");
	abspanel.setHeight("100%");
	initWidget(focusPanel);

	addDomHandler(this, MouseDownEvent.getType());
	addDomHandler(this, MouseUpEvent.getType());
	addDomHandler(this, MouseOverEvent.getType());
	addDomHandler(this, MouseOutEvent.getType());


}
 
Example 2
Project: unitimes   File: WebTable.java   Source Code and License 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 3
Project: unitimes   File: FilterBox.java   Source Code and License 6 votes vote down vote up
public ChipPanel(Chip chip, String color) {
	iChip = chip;
	setStyleName("chip");
	addStyleName(color);
	iLabel = new Label(chip.getTranslatedValue());
	iLabel.setStyleName("text");
	add(iLabel);
	iButton = new HTML("×");
	iButton.setStyleName("button");
	add(iButton);
	if (chip.hasToolTip())
		setTitle(toString() + "\n" + chip.getToolTip());
	else
		setTitle(toString());
	Roles.getDocumentRole().setAriaHiddenState(getElement(), true);
}
 
Example 4
Project: unitimes   File: TimeGrid.java   Source Code and License 6 votes vote down vote up
public BusyPanel(String text, int dayOfWeek, int startSlot, int length) {
	super();
	iText = text;
	iDayOfWeek = dayOfWeek;
	iStartSlot = startSlot;
	iLength = length;
	if (iText != null || !iText.isEmpty()) {
		setTitle(iText);
		boolean empty = true;
		for (int i = 0; i < 3; i++) {
			if (iMeetingTable[iDayOfWeek].length <= iStartSlot + i) { empty = false; break; }
			if (iMeetingTable[iDayOfWeek][iStartSlot + i] != null && !iMeetingTable[iDayOfWeek][iStartSlot + i].isEmpty()) {
				empty = false; break;
			}
		}
		if (empty) {
			HTML widget = new HTML(text, false);
			widget.setStyleName("text");
			setWidget(widget);
		}
	}
	setStyleName("busy");
	getElement().getStyle().setWidth(iCellWidth + (iPrint ? 3 : iDayOfWeek + 1 < iNrDays ? 3 : 0), Unit.PX);
	getElement().getStyle().setHeight(125 * iLength / 30, Unit.PX);
	iGrid.insert(this, iCellWidth * iDayOfWeek, 125 * iStartSlot / 30 - 50 * iStart, 1);
}
 
Example 5
Project: sig-seguimiento-vehiculos   File: InfoProjectTool.java   Source Code and License 6 votes vote down vote up
private void showDialog(final HTML htmlReport) {
	final Dialog simple = new Dialog();
	simple.setHeadingText(project.getTitle());
	simple.setSize("420px", "420px");
	simple.setResizable(true);
	simple.setHideOnButtonClick(true);
	simple.setPredefinedButtons(PredefinedButton.CLOSE);
	simple.setBodyStyleName("pad-text");
	simple.getBody().addClassName("pad-text");
	simple.add(getPanel(htmlReport));
	simple.addButton(new TextButton(UIMessages.INSTANCE.download(),
			new SelectHandler() {
				@Override
				public void onSelect(SelectEvent event) {
					FileExporter.saveAs(htmlReport.getHTML(),
							project.getTitle() + ".html");
				}
			}));
	simple.show();
}
 
Example 6
Project: sig-seguimiento-vehiculos   File: WmsGetInfoTool.java   Source Code and License 6 votes vote down vote up
private void showDialog(final HTML info) {
	final Dialog simple = new Dialog();
	simple.setHeadingText(UIMessages.INSTANCE.wmsInfo());
	HorizontalLayoutContainer container = new HorizontalLayoutContainer();
	container.setScrollMode(ScrollMode.AUTO);
	container.setSize("280px", "180px");

	container.add(replaceHref(info));
	simple.setSize("300px", "200px");
	simple.setResizable(true);
	simple.setHideOnButtonClick(true);
	simple.setPredefinedButtons(PredefinedButton.CLOSE);
	simple.setBodyStyleName("pad-text");
	simple.getBody().addClassName("pad-text");

	simple.add(container);

	simple.show();
}
 
Example 7
Project: sig-seguimiento-vehiculos   File: HtmlReportLayerTool.java   Source Code and License 6 votes vote down vote up
private void showDialog(final HTML htmlReport) {
	final Dialog simple = new Dialog();
	simple.setHeadingText("GeoWe Report");
	simple.setSize("420px", "420px");
	simple.setResizable(true);
	simple.setHideOnButtonClick(true);
	simple.setPredefinedButtons(PredefinedButton.CLOSE);
	simple.setBodyStyleName("pad-text");
	simple.getBody().addClassName("pad-text");
	simple.add(getPanel(htmlReport));
	simple.addButton(new TextButton(UIMessages.INSTANCE.download(),
			new SelectHandler() {
				@Override
				public void onSelect(SelectEvent event) {
					FileExporter.saveAs(htmlReport.getHTML(),
							getSelectedVectorLayer().getName() + ".html");
				}
			}));
	simple.show();
}
 
Example 8
Project: sig-seguimiento-vehiculos   File: LayerManagerWidget.java   Source Code and License 6 votes vote down vote up
private VerticalPanel getFoot() {
	slider.setWidth("290px");
	slider.disable();
	slider.setIncrement(1);

	slider.addValueChangeHandler(new ValueChangeHandler<Integer>() {

		@Override
		public void onValueChange(final ValueChangeEvent<Integer> event) {
			final Layer layer = getSelectedLayer(getSelectedTabName());
			layer.setOpacity((float) (event.getValue().intValue() / 100.0));
		}

	});

	final VerticalPanel panel = new VerticalPanel();
	panel.setWidth("300px");
	panel.addStyleName(ThemeStyles.get().style().borderTop());
	panel.add(new HTML(UIMessages.INSTANCE.lmOpacityHtmlLabel()));
	panel.add(slider);

	panel.add(statusBar);
	return panel;
}
 
Example 9
Project: calendar-component   File: SimpleDayCell.java   Source Code and License 6 votes vote down vote up
public SimpleDayCell(VCalendar calendar, int row, int cell) {
    this.calendar = calendar;
    this.row = row;
    this.cell = cell;
    setStylePrimaryName("v-calendar-month-day");
    caption = new Label();
    caption.setStyleName("v-calendar-day-number");
    caption.addMouseDownHandler(this);
    caption.addMouseUpHandler(this);
    add(caption);

    bottomspacer = new HTML();
    bottomspacer.setStyleName("v-calendar-bottom-spacer-empty");
    bottomspacer.setWidth(3 + "em");
    add(bottomspacer);
}
 
Example 10
Project: appinventor-extensions   File: GalleryPage.java   Source Code and License 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 11
Project: appinventor-extensions   File: AssetList.java   Source Code and License 6 votes vote down vote up
private void refreshAssetList() {
  OdeLog.log("AssetList: refreshing for project " + projectId);
  assetList.clear();

  if (assetsFolder != null) {
    for (ProjectNode node : assetsFolder.getChildren()) {
      // Add the name to the tree. We need to enclose it in a span
      // because the CSS style for selection specifies a span.
      String nodeName = node.getName();
      if (nodeName.length() > 20)
        nodeName = nodeName.substring(0, 8) + "..." + nodeName.substring(nodeName.length() - 9,
            nodeName.length());
      TreeItem treeItem = new TreeItem(
          new HTML("<span>" + nodeName + "</span>"));
      // keep a pointer from the tree item back to the actual node
      treeItem.setUserObject(node);
      assetList.addItem(treeItem);
    }
  }
}
 
Example 12
Project: appinventor-extensions   File: YoungAndroidFormUpgrader.java   Source Code and License 6 votes vote down vote up
private static void upgradeWarnDialog(String aMessage) {
  final DialogBox dialogBox = new DialogBox(false, true);
  dialogBox.setStylePrimaryName("ode-DialogBox");
  dialogBox.setText(MESSAGES.warningDialogTitle());
  dialogBox.setGlassEnabled(true);
  dialogBox.setAnimationEnabled(true);
  final HTML message = new HTML(aMessage);
  message.setStyleName("DialogBox-message");
  VerticalPanel vPanel = new VerticalPanel();
  Button okButton = new Button("OK");
  okButton.addClickListener(new ClickListener() {
      @Override
      public void onClick(Widget sender) {
        dialogBox.hide();
      }
    });
  vPanel.add(message);
  vPanel.add(okButton);
  dialogBox.setWidget(vPanel);
  dialogBox.center();
  dialogBox.show();
}
 
Example 13
Project: appinventor-extensions   File: OdeLog.java   Source Code and License 6 votes vote down vote up
/**
 * Creates a new output panel for displaying internal messages.
 */
private OdeLog() {
  // Initialize UI
  Button clearButton = new Button(MESSAGES.clearButton());
  clearButton.addClickHandler(new ClickHandler() {
    @Override
    public void onClick(ClickEvent event) {
      clear();
    }
  });

  text = new HTML();
  text.setWidth("100%");

  VerticalPanel panel = new VerticalPanel();
  panel.add(clearButton);
  panel.add(text);
  panel.setSize("100%", "100%");
  panel.setCellHeight(text, "100%");
  panel.setCellWidth(text, "100%");

  initWidget(panel);
}
 
Example 14
Project: appinventor-extensions   File: BlockSelectorBox.java   Source Code and License 6 votes vote down vote up
/**
 * Constructs a tree item for built-in blocks.
 *
 * @return tree item
 */
public TreeItem getBuiltInBlocksTree() {
  initBundledImages();
  TreeItem builtinNode = new TreeItem(new HTML("<span>" + MESSAGES.builtinBlocksLabel()
      + "</span>"));
  for (final String drawerName : BUILTIN_DRAWER_NAMES) {
    Image drawerImage = new Image(bundledImages.get(drawerName));
    TreeItem itemNode = new TreeItem(new HTML("<span>" + drawerImage
        + getBuiltinDrawerNames(drawerName) + "</span>"));
    SourceStructureExplorerItem sourceItem = new BlockSelectorItem() {
      @Override
      public void onSelected() {
        fireBuiltinDrawerSelected(drawerName);
      }
    };
    itemNode.setUserObject(sourceItem);
    builtinNode.addItem(itemNode);
  }
  builtinNode.setState(true);
  return builtinNode;
}
 
Example 15
Project: appinventor-extensions   File: BlockSelectorBox.java   Source Code and License 6 votes vote down vote up
/**
 * Constructs a tree item for generic ("Advanced") component blocks for
 * component types that appear in form.
 *
 * @param form
 *          only component types that appear in this Form will be included
 * @return tree item for this form
 */
public TreeItem getGenericComponentsTree(MockForm form) {
  Map<String, String> typesAndIcons = Maps.newHashMap();
  form.collectTypesAndIcons(typesAndIcons);
  TreeItem advanced = new TreeItem(new HTML("<span>" + MESSAGES.anyComponentLabel() + "</span>"));
  List<String> typeList = new ArrayList<String>(typesAndIcons.keySet());
  Collections.sort(typeList);
  for (final String typeName : typeList) {
    TreeItem itemNode = new TreeItem(new HTML("<span>" + typesAndIcons.get(typeName)
        + MESSAGES.textAnyComponentLabel()
        + ComponentsTranslation.getComponentName(typeName) + "</span>"));
    SourceStructureExplorerItem sourceItem = new BlockSelectorItem() {
      @Override
      public void onSelected() {
        fireGenericDrawerSelected(typeName);
      }
    };
    itemNode.setUserObject(sourceItem);
    advanced.addItem(itemNode);
  }
  return advanced;
}
 
Example 16
Project: appinventor-extensions   File: StatusPanel.java   Source Code and License 6 votes vote down vote up
/**
   * Initializes and assembles all UI elements shown in the status panel.
   */
  public StatusPanel() {
    HorizontalPanel hpanel = new HorizontalPanel();
    hpanel.setWidth("100%");
    hpanel.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER);
    String tosUrl = Ode.getInstance().getSystemConfig().getTosUrl();
    if (!Strings.isNullOrEmpty(tosUrl)) {
      String appInventorFooter =
          "<a href=\"" + tosUrl + "\" target=\"_blank\">" + MESSAGES.privacyTermsLink() + "</a>";
      hpanel.add(new HTML(appInventorFooter));
    }

    // This shows the git version and the date of the build
//    String version = GitBuildId.getVersion();
//    String date = GitBuildId.getDate();
//    if (version != null && date != null) {
//      Label buildId = new Label(MESSAGES.gitBuildId(date, version));
//      hpanel.add(buildId);
//      hpanel.setCellHorizontalAlignment(buildId, HorizontalPanel.ALIGN_RIGHT);
//    }

    initWidget(hpanel);
    setStyleName("ode-StatusPanel");
  }
 
Example 17
Project: appinventor-extensions   File: Ode.java   Source Code and License 6 votes vote down vote up
/**
 * The "Final" Dialog box. When a user chooses to end their session
 * due to a conflicting login, we should show this dialog which is modal
 * and has no exit! My preference would have been to close the window
 * altogether, but the browsers won't let javascript code close windows
 * that it didn't open itself (like the main window). I also tried to
 * use document.write() to write replacement HTML but that caused errors
 * in Firefox and strange behavior in Chrome. So we do this...
 *
 * We are called from invalidSessionDialog() (above).
 */
private void finalDialog() {
  // Create the UI elements of the DialogBox
  final DialogBox dialogBox = new DialogBox(false, true); // DialogBox(autohide, modal)
  dialogBox.setStylePrimaryName("ode-DialogBox");
  dialogBox.setText(MESSAGES.finalDialogText());
  dialogBox.setHeight("100px");
  dialogBox.setWidth("400px");
  dialogBox.setGlassEnabled(true);
  dialogBox.setAnimationEnabled(true);
  dialogBox.center();
  VerticalPanel DialogBoxContents = new VerticalPanel();
  HTML message = new HTML(MESSAGES.finalDialogMessage());
  message.setStyleName("DialogBox-message");
  DialogBoxContents.add(message);
  dialogBox.setWidget(DialogBoxContents);
  dialogBox.show();
}
 
Example 18
Project: appinventor-extensions   File: Ode.java   Source Code and License 6 votes vote down vote up
/**
 * corruptionDialog -- Put up a dialog box explaining that we detected corruption
 * while reading in a project file. There is no continuing once this happens.
 *
 */
void corruptionDialog() {
  // Create the UI elements of the DialogBox
  final DialogBox dialogBox = new DialogBox(false, true); // DialogBox(autohide, modal)
  dialogBox.setStylePrimaryName("ode-DialogBox");
  dialogBox.setText(MESSAGES.corruptionDialogText());
  dialogBox.setHeight("100px");
  dialogBox.setWidth("400px");
  dialogBox.setGlassEnabled(true);
  dialogBox.setAnimationEnabled(true);
  dialogBox.center();
  VerticalPanel DialogBoxContents = new VerticalPanel();
  HTML message = new HTML(MESSAGES.corruptionDialogMessage());
  message.setStyleName("DialogBox-message");
  DialogBoxContents.add(message);
  dialogBox.setWidget(DialogBoxContents);
  dialogBox.show();
}
 
Example 19
Project: appinventor-extensions   File: Ode.java   Source Code and License 6 votes vote down vote up
/**
 * This dialog is showned if an account is disabled. It is
 * completely modal with no escape. The provided URL is displayed in
 * an iframe, so it can be tailored to each person whose account is
 * disabled.
 *
 * @param Url the Url to display in the dialog box.
 */

public void disabledAccountDialog(String Url) {
  // Create the UI elements of the DialogBox
  final DialogBox dialogBox = new DialogBox(false, true); // DialogBox(autohide, modal)
  dialogBox.setStylePrimaryName("ode-DialogBox");
  dialogBox.setText(MESSAGES.accountDisabledMessage());
  dialogBox.setHeight("700px");
  dialogBox.setWidth("700px");
  dialogBox.setGlassEnabled(true);
  dialogBox.setAnimationEnabled(true);
  dialogBox.center();
  VerticalPanel DialogBoxContents = new VerticalPanel();
  HTML message = new HTML("<iframe src=\"" + Url + "\" style=\"border: 0; width: 680px; height: 660px;\"></iframe>");
  message.setStyleName("DialogBox-message");
  DialogBoxContents.add(message);
  dialogBox.setWidget(DialogBoxContents);
  dialogBox.show();
}
 
Example 20
Project: LAS   File: ComparisonAxisSelector.java   Source Code and License 6 votes vote down vote up
public ComparisonAxisSelector(String width) {
        // The the other widgets have flextable layouts.  Without it, this one doesn't line up.
		layout = new FlexTable();
		axes = new ListBox();
		flex = new FlexTable();
		// It looks funny without some sort of label on the same line.
		HTML html = new HTML("Axis: ");
		flex.setWidget(0, 0, html);
		flex.setWidget(0, 1, axes);
		disPanel = new DisclosurePanel("Compare");
		disPanel.add(flex);
		disPanel.setOpen(true);
		
//		if ( width != null && !width.equals("") ) {
//		    disPanel.setWidth(width);
//		}
		layout.setWidget(0, 0, disPanel);
		initWidget(layout);
	}
 
Example 21
Project: LAS   File: ColumnEditorWidget.java   Source Code and License 6 votes vote down vote up
private void turnOffRow(int row) {
    CellFormatter formatter = datatable.getCellFormatter();
    int dataRow = row - headerRows;
    
    
    String[] oldnew = dirtyrows.get(row);
    HTML html = new HTML(oldnew[0]);
    html.setTitle(oldnew[0]);
    int width = headertable.getWidget(0, 1).getOffsetWidth();
    html.setWidth(width+"px");
    // Put the old value back in the data structure used to make the JSON payload.
    List<String[]> affectedrow = allrows.get(ids.getValue());
    String[] parts = affectedrow.get(dataRow);
    for (int i = 0; i < parts.length; i++) {
        if ( headers[i].contains("WOCE") ) {
            parts[i] = oldnew[0];                        
        }
    }
    formatter.removeStyleName(row, 1, "dirty");
    datatable.setWidget(row, 1, html);
  
    
    
}
 
Example 22
Project: LAS   File: ColumnEditorWidget.java   Source Code and License 6 votes vote down vote up
@Override
public void onResponseReceived(Request request, Response response) {
    String text = response.getText();
    PopupPanel popup = new PopupPanel(true);
    popup.add(new HTML("<strong>Saved edits for:<p></p></strong>"+text+"<p></p>Click outside box to dismiss."));
    popup.setPopupPosition(200, Window.getClientHeight()/3);
    popup.show();
    CellFormatter formatter = datatable.getCellFormatter();
    for (Iterator dirtyIt = dirtyrows.keySet().iterator(); dirtyIt.hasNext();) {
        Integer widgetrow = (Integer) dirtyIt.next();
        for (int i = 0; i < headers.length; i++) {
            formatter.removeStyleName(widgetrow, i, "dirty");
        }
        
        CheckBox box = (CheckBox) datatable.getWidget(widgetrow, 0);
        box.setValue(false);
    }
    dirtyrows.clear();
}
 
Example 23
Project: LAS   File: ColumnEditorWidget.java   Source Code and License 6 votes vote down vote up
/**
 * Set the column headers.
 * 
 */
private void setHeaders() {
    CellFormatter cellFormatter = headertable.getCellFormatter();
    headertable.setWidget(0, 0, new HTML(""));
    int column = 0;
    for (int p = 0; p < headers.length; p++) {
        if ( headers[p].startsWith("\"")) headers[p] = headers[p].substring(1, headers[p].length());
        if ( headers[p].endsWith("\"")) headers[p] = headers[p].substring(0,headers[p].length()-1);
        if ( headers[p].endsWith("_")) headers[p] = headers[p].substring(0, headers[p].length()-1);
        if ( headers[p].toLowerCase().equals(wocevar.toLowerCase()) ) {
            headertable.setWidget(0, 1, new HTML(headers[p]));
            cellFormatter.addStyleName(0, 1, "nowrap");
        } else if (headers[p].toLowerCase().equals(datavar.toLowerCase()) ) {
            headertable.setWidget(0, 2, new HTML(headers[p]));
            cellFormatter.addStyleName(0, 2, "nowrap");
        } else {
            headertable.setWidget(0, column + columnOffset, new HTML(headers[p]));
            cellFormatter.addStyleName(0, column + columnOffset, "nowrap");
            column++;
        }
    }
    headertable.setWidget(0, 0, allNone);
    RowFormatter formatter = headertable.getRowFormatter();
    formatter.addStyleName(0, "nowrap");
}
 
Example 24
Project: LAS   File: DropDown.java   Source Code and License 6 votes vote down vote up
public DropDown() {
    current = new FlexTable();
    current.addStyleName("datatable");
    itemlist = new FlexTable();
    dropdown = new PopupPanel(true);
    scroller = new ScrollPanel();
    scroller.add(itemlist);
    dropdown.add(scroller);
    down =new HTML(" &#9660;");
    down.addStyleName("current-item");
    initWidget(current);
    HTML load = new HTML("loading...");
    load.addStyleName("current-item");
    current.setWidget(0, 0, load);
    current.setWidget(0, 1, down);
    current.addClickHandler(show);
}
 
Example 25
Project: mentor   File: CourseView.java   Source Code and License 6 votes vote down vote up
private CourseView() {
	
	MaterialRow row = new MaterialRow();
		MaterialColumn tocColumn = new MaterialColumn();
		tocColumn.setGrid("l2");
		tocColumn.setHideOn(HideOn.HIDE_ON_MED_DOWN);
			toc = new MaterialScrollspy();
			toc.addStyleName(ApplicationShell.res().style().toc());
		tocColumn.add(toc);
			HTML dummy = new HTML("&nbsp;");	// for column to survive pinning of TOC
		tocColumn.add(dummy);
	row.add(tocColumn);
		MaterialColumn lecturesColumn = new MaterialColumn();
		lecturesColumn.setGrid("s12 m12 l8");
			courseBanner = new CourseBanner();
		lecturesColumn.add(courseBanner);
			lecturesContainer = new MaterialPanel();
		lecturesColumn.add(lecturesContainer);
	row.add(lecturesColumn);
	add(row);
	
	MaterialPushpin.apply(toc, 64.0, 0.0);
	
}
 
Example 26
Project: mentor   File: LectureView.java   Source Code and License 6 votes vote down vote up
private LectureView() {

		MaterialRow row = new MaterialRow();
			MaterialColumn tocColumn = new MaterialColumn();
			tocColumn.setGrid("l2");
			tocColumn.setHideOn(HideOn.HIDE_ON_MED_DOWN);
				toc = new MaterialScrollspy();
				toc.addStyleName(ApplicationShell.res().style().toc());
			tocColumn.add(toc);
				HTML dummy = new HTML("&nbsp;");	// for column to survive pinning of TOC
			tocColumn.add(dummy);
		row.add(tocColumn);
			MaterialColumn unitsColumn = new MaterialColumn();
			unitsColumn.setGrid("s12 m12 l8");
				lectureBanner = new LectureBanner();
			unitsColumn.add(lectureBanner);
				unitsContainer = new MaterialPanel();
			unitsColumn.add(unitsContainer);
		row.add(unitsColumn);
		add(row);
		
		MaterialPushpin.apply(toc, 64.0, 0.0);
		
	}
 
Example 27
Project: mentor   File: ImageUnitWidget.java   Source Code and License 6 votes vote down vote up
public ImageUnitWidget(ImageUnit unit) {

		super();
		
		MaterialColumn imageColumn = new MaterialColumn();
		imageColumn.setGrid("s12");
		imageColumn.setTextAlign(TextAlign.CENTER);
			image = new MaterialImage();
		imageColumn.add(image);
		getContentRow().add(imageColumn);

		captionColumn = new MaterialColumn();
		captionColumn.setGrid("s12");
		captionColumn.setTextAlign(TextAlign.CENTER);
			caption = new HTML();
			caption.addStyleName(res.style().caption());
		captionColumn.add(caption);
		getContentRow().add(captionColumn);

		if (unit != null)
			setUnit(unit);
		
	}
 
Example 28
Project: document-management-system   File: HelloWorld.java   Source Code and License 6 votes vote down vote up
public HelloWorld() {
	HTML html = new HTML("Hello Word");
	refresh = new Button("refresh UI");
	refresh.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent event) {
			GeneralComunicator.refreshUI();
		}
	});

	vPanel = new VerticalPanel();
	vPanel.add(html);
	vPanel.add(refresh);

	refresh.setStyleName("okm-Input");

	initWidget(vPanel);
}
 
Example 29
Project: document-management-system   File: DebugConsolePopup.java   Source Code and License 6 votes vote down vote up
/**
 * Logout popup
 */
public DebugConsolePopup() {
	// Establishes auto-close when click outside
	super(false, false);

	setText(Main.i18n("debug.console.label"));
	vPanel = new VerticalPanel();
	button = new Button(Main.i18n("button.close"), this);
	text = new HTML(Main.i18n("debug.enable.disable"));

	vPanel.add(new HTML("<br>"));
	vPanel.add(text);
	vPanel.add(Log.getLogger(DivLogger.class).getWidget());
	vPanel.add(new HTML("<br>"));
	vPanel.add(button);
	vPanel.add(new HTML("<br>"));

	vPanel.setCellHorizontalAlignment(button, VerticalPanel.ALIGN_CENTER);

	button.setStyleName("okm-YesButton");

	super.hide();
	Log.getLogger(DivLogger.class).getWidget().setVisible(true);
	setWidget(vPanel);
}
 
Example 30
Project: document-management-system   File: LogoutPopup.java   Source Code and License 6 votes vote down vote up
/**
 * Logout popup
 */
public LogoutPopup() {
	// Establishes auto-close when click outside
	super(false, true);

	vPanel = new VerticalPanel();
	text = new HTML(Main.i18n("logout.logout"));
	button = new Button(Main.i18n("button.close"), this);

	vPanel.setWidth("250px");
	vPanel.setHeight("100px");

	vPanel.add(new HTML("<br>"));
	vPanel.add(text);
	vPanel.add(new HTML("<br>"));
	vPanel.add(button);
	vPanel.add(new HTML("<br>"));

	vPanel.setCellHorizontalAlignment(text, VerticalPanel.ALIGN_CENTER);
	vPanel.setCellHorizontalAlignment(button, VerticalPanel.ALIGN_CENTER);

	button.setStyleName("okm-YesButton");

	super.hide();
	setWidget(vPanel);
}
 
Example 31
Project: document-management-system   File: WorkflowWidget.java   Source Code and License 6 votes vote down vote up
/**
 * WorkflowWidget
 */
public WorkflowWidget(String name, String uuid, WorkflowWidgetToFire workflowWidgetToFire, Map<String, Object> workflowVariables) {
	this.name = name;
	this.uuid = uuid;
	this.workflowWidgetToFire = workflowWidgetToFire;
	this.workflowVariables = workflowVariables;
	drawed = false;

	vPanel = new VerticalPanel();
	hPanel = new HorizontalPanel();
	manager = new FormManager();

	vPanel.setWidth("300px");
	vPanel.setHeight("50px");

	vPanel.add(new HTML("<br>"));
	vPanel.add(manager.getTable());
	vPanel.add(new HTML("<br>"));

	vPanel.setCellHorizontalAlignment(hPanel, VerticalPanel.ALIGN_CENTER);

	initWidget(vPanel);
}
 
Example 32
Project: document-management-system   File: Status.java   Source Code and License 6 votes vote down vote up
/**
 * The status
 */
public Status() {
	super(false, true);
	hPanel = new HorizontalPanel();
	image = new Image(OKMBundleResources.INSTANCE.indicator());
	msg = new HTML("");
	space = new HTML("");

	hPanel.add(image);
	hPanel.add(msg);
	hPanel.add(space);

	hPanel.setCellVerticalAlignment(image, HasAlignment.ALIGN_MIDDLE);
	hPanel.setCellVerticalAlignment(msg, HasAlignment.ALIGN_MIDDLE);
	hPanel.setCellHorizontalAlignment(image, HasAlignment.ALIGN_CENTER);
	hPanel.setCellWidth(image, "30px");
	hPanel.setCellWidth(space, "7px");

	hPanel.setHeight("25px");

	msg.setStyleName("okm-NoWrap");

	super.hide();
	setWidget(hPanel);
}
 
Example 33
Project: document-management-system   File: WidgetUtil.java   Source Code and License 6 votes vote down vote up
/**
 * Draws a tag cloud
 */
public static void drawTagCloud(final TagCloud keywordsCloud, Collection<String> keywords) {
	// Deletes all tag clouds keys
	keywordsCloud.clear();
	keywordsCloud.setMinFrequency(Main.get().mainPanel.dashboard.keyMapDashboard.getTotalMinFrequency());
	keywordsCloud.setMaxFrequency(Main.get().mainPanel.dashboard.keyMapDashboard.getTotalMaxFrequency());

	for (Iterator<String> it = keywords.iterator(); it.hasNext(); ) {
		String keyword = it.next();
		HTML tagKey = new HTML(keyword);
		tagKey.setStyleName("okm-cloudTags");
		Style linkStyle = tagKey.getElement().getStyle();
		int fontSize = keywordsCloud.getLabelSize(Main.get().mainPanel.dashboard.keyMapDashboard.getKeywordRate(keyword));
		linkStyle.setProperty("fontSize", fontSize + "pt");
		linkStyle.setProperty("color", keywordsCloud.getColor(fontSize));
		if (fontSize > 0) {
			linkStyle.setProperty("top", (keywordsCloud.getMaxFontSize() - fontSize) / 2 + "px");
		}
		keywordsCloud.add(tagKey);
	}
}
 
Example 34
Project: document-management-system   File: Status.java   Source Code and License 6 votes vote down vote up
/**
 * Status
 */
public Status() {
	super(false, true);
	hPanel = new HorizontalPanel();
	image = new Image(OKMBundleResources.INSTANCE.indicator());
	msg = new HTML("");
	space = new HTML("");

	hPanel.add(image);
	hPanel.add(msg);
	hPanel.add(space);

	hPanel.setCellVerticalAlignment(image, HasAlignment.ALIGN_MIDDLE);
	hPanel.setCellVerticalAlignment(msg, HasAlignment.ALIGN_MIDDLE);
	hPanel.setCellHorizontalAlignment(image, HasAlignment.ALIGN_CENTER);
	hPanel.setCellWidth(image, "30px");
	hPanel.setCellWidth(space, "7px");

	hPanel.setHeight("25px");

	msg.setStyleName("okm-NoWrap");

	super.hide();
	setWidget(hPanel);
}
 
Example 35
Project: gwt-cs   File: Tiles3DPointCloud.java   Source Code and License 6 votes vote down vote up
@Override
public void buildPanel() {
    final ViewerPanel csVPanel = new ViewerPanel();

    Cesium3DTileset tileset = csVPanel.getViewer().scene().primitives().add(Cesium3DTileset.create("https://beta.cesium.com/api/assets/1460?access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIyMzk2YzJiOS1jZGFmLTRlZmYtYmQ4MS00NTA3NjEwMzViZTkiLCJpZCI6NDQsImFzc2V0cyI6WzE0NjBdLCJpYXQiOjE0OTkyNjQ3NTV9.oWjvN52CRQ-dk3xtvD4e8ZnOHZhoWSpJLlw115mbQJM"));

    tileset.readyPromise().then(new Fulfill<Cesium3DTileset>() {
        @Override
        public void onFulfilled(Cesium3DTileset value) {
            BoundingSphere boundingSphere = value.boundingSphere();
            csVPanel.getViewer().camera.viewBoundingSphere(boundingSphere, new org.cesiumjs.cs.core.HeadingPitchRange(0.0, -0.5, boundingSphere.radius));
            csVPanel.getViewer().camera.lookAtTransform(Matrix4.IDENTITY());
        }
    });

    contentPanel.add(new HTML("<p>Example styles for a point cloud tileset.</p>"));
    contentPanel.add(csVPanel);

    initWidget(contentPanel);
}
 
Example 36
Project: gwt-cs   File: GoogleEarthEnterprise.java   Source Code and License 6 votes vote down vote up
@Override
public void buildPanel() {
    GoogleEarthEnterpriseMetadata geeMetadata = GoogleEarthEnterpriseMetadata.create("http://www.earthenterprise.org/3d");

    ViewerOptions options = new ViewerOptions();
    options.imageryProvider = GoogleEarthEnterpriseImageryProvider.create(geeMetadata);
    options.terrainProvider = GoogleEarthEnterpriseTerrainProvider.create(geeMetadata);
    options.baseLayerPicker = false;
    ViewerPanel csVPanel = new ViewerPanel(options);

    ViewOptions viewOptions = new ViewOptions();
    viewOptions.destinationRec = Rectangle.fromDegrees(-123.0, 36.0, -121.7, 39.0);
    csVPanel.getViewer().camera.setView(viewOptions);

    contentPanel.add(new HTML("<p>Add imagery from a Web Map Service (WMS) server.</p>"));
    contentPanel.add(csVPanel);

    initWidget(contentPanel);
}
 
Example 37
Project: gwt-cs   File: GeoJSONsimplestyle.java   Source Code and License 6 votes vote down vote up
@Override
public void buildPanel() {
    ViewerOptions viewerOptions = new ViewerOptions();
    viewerOptions.sceneMode = SceneMode.SCENE2D();
    viewerOptions.timeline = false;
    viewerOptions.animation = false;
    csVPanel = new ViewerPanel(viewerOptions);

    Promise<GeoJsonDataSource, String> dataSource = GeoJsonDataSource.load(GWT.getModuleBaseURL() + "SampleData/simplestyles.geojson");
    csVPanel.getViewer().dataSources().add(dataSource);
    dataSource.then(new Fulfill<GeoJsonDataSource>() {
        @Override
        public void onFulfilled(GeoJsonDataSource value) {
            csVPanel.getViewer().zoomTo(value);
        }
    });

    contentPanel.add(new HTML("<p>Load GeoJSON with simplestyle information.</p>"));
    contentPanel.add(csVPanel);

    initWidget(contentPanel);
}
 
Example 38
Project: gwt-cs   File: Tiles3DInterior.java   Source Code and License 6 votes vote down vote up
@Override
public void buildPanel() {
    ViewerPanel csVPanel = new ViewerPanel();

    csVPanel.getViewer().scene().primitives().add(Cesium3DTileset.create("https://beta.cesium.com/api/assets/1463?access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI5ZGExZTdmMS0xZjA5LTQxODAtOThmYi04MWU1YjZkMWZjNjgiLCJpZCI6NDQsImFzc2V0cyI6WzE0NjNdLCJpYXQiOjE0OTkyNzYwNzV9.eTEtaAEBUehNIZushZQnp0On9BPRtZYS7XEWFwneSRU"));

    Cartesian3 initialPosition = new Cartesian3(-1111583.3721328347, -5855888.151574568, 2262561.444696748);
    org.cesiumjs.cs.core.HeadingPitchRoll initialOrientation = org.cesiumjs.cs.core.HeadingPitchRoll.fromDegrees(100.0, -15.0, 0.0);
    ViewOptions viewOptions = new ViewOptions();
    viewOptions.destinationPos = initialPosition;
    viewOptions.orientation = initialOrientation;
    viewOptions.endTransform = Matrix4.IDENTITY();
    csVPanel.getViewer().scene().camera().setView(viewOptions);

    contentPanel.add(new HTML("<p>A sample interior rendered with 3D Tiles.</p>"));
    contentPanel.add(csVPanel);

    initWidget(contentPanel);
}
 
Example 39
Project: gwt-cs   File: CesiumNavigation.java   Source Code and License 6 votes vote down vote up
@Override
public void buildPanel() {
    ViewerCesiumNavigationMixinOptions options = new ViewerCesiumNavigationMixinOptions();
    options.defaultResetView = Rectangle.fromDegrees(71, 3, 90, 14);
    options.enableCompass = true;
    options.enableZoomControls = true;
    options.enableDistanceLegend = true;
    options.enableCompassOuterRing = true;

    ViewerPanel csVPanel = new ViewerPanel();
    csVPanel.getViewer().extend(viewerCesiumNavigationMixin.instance(), options);

    contentPanel.add(new HTML("<p>Use CesiumNavigation plugin with GWT wrapper.</p>"));
    contentPanel.add(csVPanel);

    initWidget(contentPanel);
}
 
Example 40
Project: gwt-cs   File: Tiles3DInspector.java   Source Code and License 6 votes vote down vote up
@Override
public void buildPanel() {
    final ViewerPanel csVPanel = new ViewerPanel();

    csVPanel.getViewer().extend(viewerCesium3DTilesInspectorMixin.instance());

    Cesium3DTileset tileset = csVPanel.getViewer().scene().primitives().add(Cesium3DTileset.create("https://beta.cesium.com/api/assets/1461?access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJkYWJmM2MzNS02OWM5LTQ3OWItYjEyYS0xZmNlODM5ZDNkMTYiLCJpZCI6NDQsImFzc2V0cyI6WzE0NjFdLCJpYXQiOjE0OTkyNjQ3NDN9.vuR75SqPDKcggvUrG_vpx0Av02jdiAxnnB1fNf-9f7s"));
    csVPanel.getViewer().cesium3DTilesInspector.viewModel.tileset = tileset;

    tileset.readyPromise().then(new Fulfill<Cesium3DTileset>() {
        @Override
        public void onFulfilled(Cesium3DTileset value) {
            BoundingSphere boundingSphere = value.boundingSphere();
            csVPanel.getViewer().camera.viewBoundingSphere(boundingSphere, new org.cesiumjs.cs.core.HeadingPitchRange(0.0, -0.5, boundingSphere.radius / 4.0));
            csVPanel.getViewer().camera.lookAtTransform(Matrix4.IDENTITY());
        }
    });

    contentPanel.add(new HTML("<p>Use the 3D Tiles inspector as a debugging tool for different tilesets.</p>"));
    contentPanel.add(csVPanel);

    initWidget(contentPanel);
}
 
Example 41
Project: gwt-cs   File: Tiles3DPhotogrammetry.java   Source Code and License 6 votes vote down vote up
@Override
public void buildPanel() {
    final ViewerPanel csVPanel = new ViewerPanel();

    Cesium3DTileset tileset = csVPanel.getViewer().scene().primitives().add(Cesium3DTileset.create("https://beta.cesium.com/api/assets/1458?access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIxYmJiNTAxOC1lOTg5LTQzN2EtODg1OC0zMWJjM2IxNGNlYmMiLCJpZCI6NDQsImFzc2V0cyI6WzE0NThdLCJpYXQiOjE0OTkyNjM4MjB9.1WKijRa-ILkmG6utrhDWX6rDgasjD7dZv-G5ZyCmkKg"));

    tileset.readyPromise().then(new Fulfill<Cesium3DTileset>() {
        @Override
        public void onFulfilled(Cesium3DTileset value) {
            BoundingSphere boundingSphere = value.boundingSphere();
            csVPanel.getViewer().camera.viewBoundingSphere(boundingSphere, new org.cesiumjs.cs.core.HeadingPitchRange(0.0, -0.5, boundingSphere.radius));
            csVPanel.getViewer().camera.lookAtTransform(Matrix4.IDENTITY());
        }
    });

    contentPanel.add(new HTML("<p>A sample photgrammetry dataset rendered with 3D Tiles.</p>"));
    contentPanel.add(csVPanel);

    initWidget(contentPanel);
}
 
Example 42
Project: gwt-cs   File: Tiles3DBIM.java   Source Code and License 6 votes vote down vote up
@Override
public void buildPanel() {
    final ViewerPanel csVPanel = new ViewerPanel();

    Cesium3DTileset tileset = csVPanel.getViewer().scene().primitives().add(Cesium3DTileset.create("https://beta.cesium.com/api/assets/1459?access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIzNjUyM2I5Yy01YmRhLTQ0MjktOGI0Zi02MDdmYzBjMmY0MjYiLCJpZCI6NDQsImFzc2V0cyI6WzE0NTldLCJpYXQiOjE0OTkyNjQ3ODF9.SW_rwY-ic0TwQBeiweXNqFyywoxnnUBtcVjeCmDGef4"));

    tileset.readyPromise().then(new Fulfill<Cesium3DTileset>() {
        @Override
        public void onFulfilled(Cesium3DTileset value) {
            BoundingSphere boundingSphere = value.boundingSphere();
            csVPanel.getViewer().camera.viewBoundingSphere(boundingSphere, new org.cesiumjs.cs.core.HeadingPitchRange(0.5, -0.2, boundingSphere.radius * 4.0));
            csVPanel.getViewer().camera.lookAtTransform(Matrix4.IDENTITY());
        }
    });

    contentPanel.add(new HTML("<p>A sample BIM dataset rendered with 3D Tiles.</p>"));
    contentPanel.add(csVPanel);

    initWidget(contentPanel);
}
 
Example 43
Project: gwt-cs   File: ShowSourceButton.java   Source Code and License 6 votes vote down vote up
protected void showSourceCode(String sourceCode) {
    sourceCode = sourceCode.replaceAll("<", "&lt,").replace(">", "&gt;");

    final String html = "<pre class=\"brush: java; toolbar: false;\">" + sourceCode + "</pre>";
    ScrollPanel sp = new ScrollPanel();
    sp.setSize((Window.getClientWidth() * 0.6) + "px",
            (Window.getClientHeight() * 0.7) + "px");
    sp.add(new HTML(html));

    DialogBoxWithCloseButton dialogBox = new DialogBoxWithCloseButton(false);
    dialogBox.setWidget(sp);
    dialogBox.setText(ShowcaseSearchPanel.I18N.viewSource(source));
    dialogBox.center();

    super.doFormat();
}
 
Example 44
Project: cuba   File: CubaTwinColSelectWidget.java   Source Code and License 6 votes vote down vote up
protected void enableAddAllBtn() {
    HTML br1 = new HTML("<span/>");
    br1.setStyleName(CLASSNAME + "-deco");
    buttons.add(br1);
    buttons.insert(br1, buttons.getWidgetIndex(add) + 1);
    addAll = new VButton();
    addAll.setText(">>");
    addAll.addStyleName("addAll");
    addAllHandlerRegistration = addAll.addClickHandler(this);
    buttons.insert(addAll, buttons.getWidgetIndex(br1) + 1);

    HTML br2 = new HTML("<span/>");
    br2.setStyleName(CLASSNAME + "-deco");
    buttons.add(br2);

    removeAll = new VButton();
    removeAll.setText("<<");
    removeAll.addStyleName("removeAll");
    removeAllHandlerRegistration = removeAll.addClickHandler(this);
    buttons.add(removeAll);
}
 
Example 45
Project: Wiab.pro   File: CajolerFacade.java   Source Code and License 6 votes vote down vote up
private void appendToDocument(HTML target, PluginContext pluginContext, CajolerResponse response) {
  DivElement domitaVdocElement = Document.get().createDivElement();
  domitaVdocElement.setClassName("innerHull");

  target.getElement().setInnerHTML("");
  target.getElement().setClassName("outerHull");
  target.getElement().appendChild(domitaVdocElement);

  initializeDoodadEnvironment(
      cajaFrame, domitaVdocElement, pluginContext.getJSOInterface());

  // Render HTML
  domitaVdocElement.setInnerHTML(response.getHtml());

  // Inject JS
  Document cajaFrameDoc = cajaFrame.getContentDocument();
  cajaFrameDoc.getBody().appendChild(cajaFrameDoc.createScriptElement(response.getJs()));
}
 
Example 46
Project: Wiab.pro   File: EditorHarness.java   Source Code and License 6 votes vote down vote up
/**
 * Output content for and editor
 */
private void outputEditorState(final Editor editor,
    final HTML prettyContent, final HTML prettyHtml) {
  Runnable printer = new Runnable() {
    public void run() {
      if (!quiet) {
        String content = EditorDocFormatter.formatContentDomString(editor);
        String html = EditorDocFormatter.formatImplDomString(editor);
        if (content != null) {
          prettyContent.setText(content);
        }
        if (html != null) {
          prettyHtml.setText(html);
        }
      }
    }
  };

  if (LogLevel.showDebug()) {
    // Flush and update once it's safe
    if (editor.getContent().flush(printer)) {
      printer.run(); // note that if true is returned, the command isn't run inside flush.
    }
  }
}
 
Example 47
Project: gwt-olcs   File: ShowSourceButton.java   Source Code and License 6 votes vote down vote up
protected void showSourceCode(String sourceCode) {
    sourceCode = sourceCode.replaceAll("<", "&lt,").replace(">", "&gt;");

    final String html = "<pre class=\"brush: java; toolbar: false;\">" + sourceCode + "</pre>";
    ScrollPanel sp = new ScrollPanel();
    sp.setSize((Window.getClientWidth() * 0.6) + "px",
            (Window.getClientHeight() * 0.7) + "px");
    sp.add(new HTML(html));

    DialogBoxWithCloseButton dialogBox = new DialogBoxWithCloseButton(false);
    dialogBox.setWidget(sp);
    dialogBox.setText(ShowcaseSearchPanel.I18N.viewSource(source));
    dialogBox.center();

    super.doFormat();
}
 
Example 48
Project: tree-grid   File: HierarchyRenderer.java   Source Code and License 6 votes vote down vote up
private HierarchyItem(String className) {
    panel = new FlowPanel();
    panel.getElement().addClassName(className);

    expander = new Expander();
    expander.getElement().addClassName(CLASS_TREE_GRID_EXPANDER);

    if (innerRenderer instanceof WidgetRenderer) {
        content = ((WidgetRenderer) innerRenderer).createWidget();
    } else {
        // TODO: 20/09/16 create more general widget?
        content = GWT.create(HTML.class);
    }

    content.getElement().addClassName(CLASS_TREE_GRID_CELL_CONTENT);

    panel.add(expander);
    panel.add(content);

    expander.addClickHandler(HierarchyRenderer.this);

    initWidget(panel);
}
 
Example 49
Project: onecmdb   File: FooterScreen.java   Source Code and License 6 votes vote down vote up
public FooterScreen() {
	HorizontalPanel panel = new HorizontalPanel();
	HTML label = new HTML("OneCMDB 1.4.0 Beta &copy; Lokomo Systems <<a href='javascript:;'>about</a>>");
	label.setTitle("Show about screen");
	label.setStyleName("onecmdb-footer-label");
	panel.add(label);
	panel.setCellHorizontalAlignment(label, HorizontalPanel.ALIGN_RIGHT);
	panel.setStyleName("onecmdb-footer");
	label.addClickListener(new ClickListener() {

		public void onClick(Widget sender) {
			getBaseEntryScreen().showScreen(OneCMDBApplication.SHOW_STATIC_CONTENT, 
					"about.html", 
					new Long(0));
		}
		
	});
	initWidget(panel);
}
 
Example 50
Project: x-cure-chat   File: ForumMessageWidget.java   Source Code and License 6 votes vote down vote up
/**
 * Allows to add a horizontal panel with various sharing links to the forum messages.
 * All of the forum messages get a web link to the post.
 * THe regular posts get also sharing links for Twitter, Mail.ru and Facebook.
 * @param panel the panel to add the panel to.
 */
private void addForumMessageSharingLinks( HorizontalPanel panel ) {
	final String forumMessageURL = getForumMessageURL( messageData );
	final String forumMessageTitle = messageData.messageTitle;
	
	HorizontalPanel linksPanel = new HorizontalPanel();
	linksPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_BOTTOM );
	linksPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_RIGHT );
	//Add the post link
	linksPanel.add( new ShareMessageLinkURL( forumMessageURL, forumMessageTitle, i18nTitles.forumPostLinkTitle() ) );
	
	//If it is a regular forum post then add the sharing links
	if( ! messageData.isForumSectionMessage() && ! messageData.isForumTopicMessage() ) {
		linksPanel.add( new HTML("&nbsp;") );
		linksPanel.add( new ShareMessageTwitterURL( forumMessageURL, forumMessageTitle, i18nTitles.shareInTwitterLinkTitle() ) );
		linksPanel.add( new HTML("&nbsp;") );
		linksPanel.add( new ShareMessageVKontakteURL( forumMessageURL, forumMessageTitle, i18nTitles.shareInVKontakteLinkTitle() ) );
		linksPanel.add( new HTML("&nbsp;") );
		linksPanel.add( new ShareMessageMailRuURL( forumMessageURL, forumMessageTitle, i18nTitles.shareInMyWorldLinkTitle() ) );
		linksPanel.add( new HTML("&nbsp;") );
		linksPanel.add( new ShareMessageFacebookURL( forumMessageURL, forumMessageTitle, i18nTitles.shareInInFacebookLinkTitle() ) );
	}
	
	panel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_RIGHT );
	panel.add( linksPanel );
}
 
Example 51
Project: easy-vote   File: LoginWidget.java   Source Code and License 6 votes vote down vote up
private void login() {
	
	Long voterId = null;

	try {
		voterId = Long.parseLong(nameField.getText());
	} catch(NumberFormatException e) {
		EasyVote.setError(new HTML("The ID of the user must be a number."));
		return;
	}
	
	String pass = passField.getText();

	sendButton.setEnabled(false);
	Communicator.getInstance().login(voterId, pass, loginCallback);
}
 
Example 52
Project: unitime   File: FilterBox.java   Source Code and License 6 votes vote down vote up
public ChipPanel(Chip chip, String color) {
	iChip = chip;
	setStyleName("chip");
	addStyleName(color);
	iLabel = new Label(chip.getTranslatedValue());
	iLabel.setStyleName("text");
	add(iLabel);
	iButton = new HTML("&times;");
	iButton.setStyleName("button");
	add(iButton);
	if (chip.hasToolTip())
		setTitle(toString() + "\n" + chip.getToolTip());
	else
		setTitle(toString());
	Roles.getDocumentRole().setAriaHiddenState(getElement(), true);
}
 
Example 53
Project: gwtlib   File: ContentWidget.java   Source Code and License 6 votes vote down vote up
/**
 * Initialize this widget by creating the elements that should be added to the
 * page.
 */
public void init() {
  if(!_initialized) {
    _initialized = true;
    VerticalPanel vPanel = new VerticalPanel();

    HTML nameWidget = new HTML(getName());
    nameWidget.setStyleName(STYLE + "-name");
    vPanel.add(nameWidget);
    HTML descWidget = new HTML(getDescription());
    descWidget.setStyleName(STYLE + "-description");
    vPanel.add(descWidget);
    Widget widget = onInit();
    if(widget != null) vPanel.add(widget);

    _panel.add(vPanel);
  }
}
 
Example 54
Project: x-cure-chat   File: PageListWidget.java   Source Code and License 6 votes vote down vote up
/**
 * The basic constructor 
 * @param siteSectionPrefix the history token site section prefix
 */
public PageListWidget( final String siteSectionPrefix ) {
	this.siteSectionPrefix = siteSectionPrefix;
	final HorizontalPanel mainPanel = new HorizontalPanel();
	mainPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_CENTER);
	mainPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_BOTTOM);
	indexesPanel = new HorizontalPanel();
	indexesPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_CENTER);
	indexesPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_BOTTOM);
	Label pageLabel = new Label( I18NManager.getTitles().pageString() );
	pageLabel.setStyleName( CommonResourcesContainer.REGULAR_FIELD_STYLE );
	mainPanel.add( pageLabel );
	mainPanel.add( new HTML(":&nbsp;") );
	mainPanel.add( indexesPanel );
	//The wrapper panel
	HorizontalPanel wrapPanel = new HorizontalPanel();
	wrapPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_CENTER );
	wrapPanel.add( mainPanel );
	initWidget( wrapPanel );
}
 
Example 55
Project: fullmetalgalaxy   File: WgtBoardLayerFireCover.java   Source Code and License 6 votes vote down vote up
@Override
public void redraw()
{
  m_tokenLastUpdate = GameEngine.game().getLastTokenUpdate().getTime();
  m_gameLastVersion = GameEngine.game().getVersion();
  // same game but something changed: redraw all visible layers.
  m_validLayersSet.clear();
  for( Map.Entry<EbTeam, HTML> entry : m_fireCoverLayers.entrySet() )
  {
    HTML layer = entry.getValue();
    if( layer.isVisible() )
    {
      layer.setHTML( getFireCoverHtml( (EbTeam)entry.getKey() ) );
      m_validLayersSet.add( (EbTeam)entry.getKey() );
    }
  }
}
 
Example 56
Project: geowe-core   File: GeoprocessHelpDialog.java   Source Code and License 6 votes vote down vote up
private HorizontalLayoutContainer getHelpPanel(final HTML data) {
	HorizontalLayoutContainer panel = new HorizontalLayoutContainer();
	panel.setSize("400px", "400px");
	panel.add(data);
	ScrollSupport scrollSupport = panel.getScrollSupport();
	scrollSupport.setScrollMode(ScrollMode.AUTO);
	return panel;
}
 
Example 57
Project: firefly   File: Toolbar.java   Source Code and License 6 votes vote down vote up
public CmdButton(String name, Widget icon, Command cmd, String label, String desc) {
    this.name = name;
    this.command = cmd;
    this.name = name;
    String htmlstr = label == null ? name : label;
    html = new HTML(htmlstr);
    if (desc != null) {
        html.setTitle(desc);
    }
    this.command = cmd;
    html.setWordWrap(false);
    if (command instanceof GeneralCommand) {
        addListeners();
        setButtonEnabled(((GeneralCommand)command).isEnabled());
    }

    GwtUtil.setStyles(iconHolderLeft, "padding", "none", "marginRight", "3px");
    GwtUtil.setStyle(html, "padding", "6px 0");
    container = GwtUtil.makeHoriPanel(null, null, iconHolderLeft, html, iconHolderRight);
    container.setCellVerticalAlignment(iconHolderLeft, VerticalPanel.ALIGN_MIDDLE);
    container.setCellVerticalAlignment(iconHolderRight, VerticalPanel.ALIGN_MIDDLE);
    setIconLeft(icon);
    setIconRight(null);
    GwtUtil.setStyle(container, "margin", "0px auto");
    initWidget(new SimplePanel(container));
}
 
Example 58
Project: firefly   File: PopupUtil.java   Source Code and License 6 votes vote down vote up
public static void showConfirmMsg(final Widget w,
                                  final String title,
                                  final String msg,
                                  final ClickHandler yesHandler,
                                  final ClickHandler noHandler) {
    BaseDialog dialog= new BaseDialog(w, ButtonType.YES_NO,title,true,null) {
        protected void inputComplete() {
            if (yesHandler!=null) yesHandler.onClick(null);
        }
        protected void inputCanceled() {
            if (noHandler!=null) noHandler.onClick(null);
        }
    };

    HTML html= new HTML(msg);
    dialog.setWidget(html);

    dialog.setVisible(true);

}
 
Example 59
Project: x-cure-chat   File: PagedActionGridDialog.java   Source Code and License 6 votes vote down vote up
/**
 * This method allocates the data table
 * @param numberOfRows the number of rows per page
 * @param numberOfColumns the number of columns in the data table
 */
public void allocateDataTable(final int numberOfRows, final int numberOfColumns){
	NUMBER_OF_COLUMNS = numberOfColumns;
	NUMBER_OF_ROWS_PER_PAGE = numberOfRows;
	//Make the blank table with the requires number of columns and rows
	//The latter gets on extra row for the titles
	dataTable.setSize("100%", "100%");
	dataTable.setStyleName( CommonResourcesContainer.PAGED_DIALOG_TABLE_STYLE_NAME );
	for(int row = 0; row <= NUMBER_OF_ROWS_PER_PAGE; row++) {
		dataTable.insertRow( row );
		for( int column=0; column < NUMBER_OF_COLUMNS; column++ ) {
			dataTable.insertCell( row, column );
			dataTable.setWidget(row, column, new HTML("&nbsp;") );
		}
		dataTable.setWidget(row, 0, new HTML("&nbsp;"));
	}
}
 
Example 60
Project: firefly   File: LoadCatalogSearchUI.java   Source Code and License 6 votes vote down vote up
private Widget createLoadCatalogsContent() {
    SimpleInputField field = SimpleInputField.createByProp(_prop.makeBase("upload"));
    _uploadField= (FileUploadField)field.getField();
    _uploadField.setUploadType("TABLE");

    HTML text = GwtUtil.makeFaddedHelp("Custom catalog in IPAC table format&nbsp;&nbsp;");

    Label pad = new Label(" ");
    pad.setHeight("400px");

    FlexTable grid = new FlexTable();
    grid.setCellSpacing(5);
    DOM.setStyleAttribute(grid.getElement(), "padding", "5px");
    grid.setWidget(0, 0, field);
    grid.setWidget(1, 0, text);

    return grid;
}