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

The following examples show how to use com.google.gwt.user.client.ui.HTML. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: InsufficientPrivileges.java    From core with GNU Lesser General Public License v2.1 6 votes vote down vote up
@Override
public void execute() {
    final DefaultWindow window = new DefaultWindow(Console.CONSTANTS.accessDenied());
    window.setWidth(320);
    window.setHeight(240);
    HTML message = new HTML(Console.CONSTANTS.insufficientPrivileges());

    DialogueOptions options = new DialogueOptions(
            Console.CONSTANTS.common_label_logout(),
            event -> {
                window.hide();
                new LogoutCmd(ssoEnabled).execute();
            },
            Console.CONSTANTS.common_label_cancel(),
            event -> {}
    );
    options.showCancel(false);

    window.trapWidget(new WindowContentBuilder(message, options).build());
    window.setGlassEnabled(true);
    window.center();
}
 
Example #2
Source File: Status.java    From document-management-system with GNU General Public License v2.0 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 #3
Source File: MockComponent.java    From appinventor-extensions with Apache License 2.0 6 votes vote down vote up
/**
 * Constructs a tree item for the component which will be displayed in the
 * source structure explorer.
 *
 * @return  tree item for this component
 */
protected TreeItem buildTree() {
  // Instantiate new tree item for this component
  // Note: We create a ClippedImagePrototype because we need something that can be
  // used to get HTML for the iconImage. AbstractImagePrototype requires
  // an ImageResource, which we don't necessarily have.
  TreeItem itemNode = new TreeItem(
      new HTML("<span>" + iconImage.getElement().getString() + SafeHtmlUtils.htmlEscapeAllowEntities(getName()) + "</span>")) {
    @Override
    protected Focusable getFocusable() {
      return nullFocusable;
    }
  };
  itemNode.setUserObject(sourceStructureExplorerItem);
  return itemNode;
}
 
Example #4
Source File: BlockSelectorBox.java    From appinventor-extensions with Apache License 2.0 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 #5
Source File: BlockSelectorBox.java    From appinventor-extensions with Apache License 2.0 6 votes vote down vote up
/**
 * Constructs a tree item for built-in blocks.
 *
 * @return tree item
 */
public TreeItem getBuiltInBlocksTree(MockForm form) {
  initBundledImages();
  TreeItem builtinNode = new TreeItem(new HTML("<span>" + MESSAGES.builtinBlocksLabel()
      + "</span>"));
  for (final String drawerName : getSubsetDrawerNames(form)) {
    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 #6
Source File: ColumnProfileView.java    From core with GNU Lesser General Public License v2.1 6 votes vote down vote up
@Override
public void setPreview(final SafeHtml html) {

    if(locked) return;

    if (
            (contentCanvas.getWidgetCount()>0  && !contentCanvas.getElement().hasAttribute("presenter-view"))
                    || (contentCanvas.getWidgetCount() ==0)
            ) {

            contentCanvas.clear();
            contentCanvas.add(new ScrollPanel(new HTML(html)));
            contentCanvas.getElement().removeAttribute("presenter-view");

    }
}
 
Example #7
Source File: CubaTwinColSelectWidget.java    From cuba with Apache License 2.0 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(addItemsLeftToRightButton) + 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 #8
Source File: OdeLog.java    From appinventor-extensions with Apache License 2.0 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 #9
Source File: Ode.java    From appinventor-extensions with Apache License 2.0 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 #10
Source File: DiagramTab.java    From SensorWebClient with GNU General Public License v2.0 6 votes vote down vote up
private HTML buildSliderPart(String width, String height, String cursor, String color, double transparancy) {
    HTML container = new HTML();
    container.setWidth(width);
    container.setHeight(height);
    DOM.setStyleAttribute(container.getElement(), "cursor", cursor);
    DOM.setStyleAttribute(container.getElement(), "backgroundColor", color);

    // transparency styling (see also bug#449 and http://www.quirksmode.org/css/opacity.html)
    // note: since GWT complains, '-msFilter' has to be in plain camelCase (w/o '-')
    // ordering is important here
    DOM.setStyleAttribute(container.getElement(), "opacity", Double.toString(transparancy));
    DOM.setStyleAttribute(container.getElement(), "mozOpacity", Double.toString(transparancy));
    String opacity = "(opacity=" +Double.toString(transparancy*100) + ")";
    DOM.setStyleAttribute(container.getElement(), "msFilter", "\"progid:DXImageTransform.Microsoft.Alpha"+ opacity + "\"");
    DOM.setStyleAttribute(container.getElement(), "filter", "alpha" + opacity);
    return container;
}
 
Example #11
Source File: UploadStep.java    From core with GNU Lesser General Public License v2.1 6 votes vote down vote up
@Override
protected Widget asWidget(final Context context) {
    final FlowPanel panel = new FlowPanel();

    HTML description = new HTML(Console.CONSTANTS.common_label_chooseFile());
    description.getElement().setAttribute("style", "padding-bottom:15px;");
    panel.add(description);

    form = new FormPanel();

    // create a panel to hold all of the form widgets.
    VerticalPanel formPanel = new VerticalPanel();
    form.setWidget(formPanel);

    // create a FileUpload widgets.
    fileUpload = new FileUpload();
    fileUpload.setName("uploadFormElement");
    IdHelper.setId(fileUpload, id(), "file");
    formPanel.add(fileUpload);

    panel.add(form);
    return panel;
}
 
Example #12
Source File: GalleryPage.java    From appinventor-extensions with Apache License 2.0 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 #13
Source File: InfoProjectTool.java    From geowe-core with GNU General Public License v3.0 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 #14
Source File: EditorHarness.java    From swellrt with Apache License 2.0 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 #15
Source File: HelloWorld.java    From document-management-system with GNU General Public License v2.0 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 #16
Source File: EditorHarness.java    From incubator-retired-wave with Apache License 2.0 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 #17
Source File: WebTable.java    From unitime with Apache License 2.0 6 votes vote down vote up
public IconsCell add(ImageResource resource, final String title, final boolean html) {
	if (resource == null) return this;
	Image icon = new Image(resource);
	String text = title;
	if (html) { HTML h = new HTML(title); text = h.getText(); }
	icon.setTitle(text);
	icon.setAltText(text);
	if (iPanel.getWidgetCount() > 0)
		icon.getElement().getStyle().setMarginLeft(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, html);
			}
		});
	}
	return this;
}
 
Example #18
Source File: WmsGetInfoTool.java    From geowe-core with GNU General Public License v3.0 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 #19
Source File: ApplicationHeader.java    From core with GNU Lesser General Public License v2.1 6 votes vote down vote up
public ApplicationHeader(String title) {

        prefix = new HTML("");
        prefix.setStyleName("header-content");
        HTML changeButton = new HTML("(change)");

        changeButton.setStyleName("html-link");
        changeButton.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent clickEvent) {
                Window.alert("Changing profiles not implemented yet!");
            }
        });

        add(prefix);
        //add(changeButton);

        //changeButton.getElement().getParentElement().setAttribute("style", "vertical-align:middle");

        setProfileName(title);
    }
 
Example #20
Source File: HtmlReportLayerTool.java    From geowe-core with GNU General Public License v3.0 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 #21
Source File: TimeGrid.java    From unitime with Apache License 2.0 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 #22
Source File: DataSourceFinderView.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Override
public void setPreview(final SafeHtml html) {

    Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
        @Override
        public void execute() {
            previewCanvas.clear();
            previewCanvas.add(new ScrollPanel(new HTML(html)));
        }
    });

}
 
Example #23
Source File: RBACContextView.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
private Widget asWidget() {
    VerticalPanel container = new VerticalPanel();
    container.setStyleName("fill-layout");

    HorizontalPanel menu = new HorizontalPanel();
    menu.setStyleName("fill-layout-width");
    final TextBox nameBox = new TextBox();
    nameBox.setText(securityFramework.resolveToken());

    MultiWordSuggestOracle oracle = new  MultiWordSuggestOracle();
    oracle.addAll(Console.MODULES.getRequiredResourcesRegistry().getTokens());

    SuggestBox suggestBox = new SuggestBox(oracle, nameBox);

    Button btn = new Button("Show", new ClickHandler() {
        @Override
        public void onClick(ClickEvent clickEvent) {
            container.clear();

            try {
                container.add(createContent(nameBox.getText()));
            } catch (Throwable e) {
                HTML msg = new HTML(e.getMessage());
                msg.getElement().getStyle().setColor("red");
                container.add(msg);
            }
        }
    });
    menu.add(new HTML("Token: "));
    menu.add(suggestBox);
    menu.add(btn);


    VerticalPanel p = new VerticalPanel();
    p.setStyleName("fill-layout-width");
    p.add(menu);
    p.add(container);
    return p;
}
 
Example #24
Source File: TemplateNodeMutationHandler.java    From swellrt with Apache License 2.0 5 votes vote down vote up
@Override
protected Widget createGwtWidget(Renderable element) {
  HTML widget = new HTML();
  element.setProperty(HtmlTemplate.TEMPLATE_WIDGET, widget);

  // Do the things that the doodad API should be doing by default.
  // ContentElement attempts this, and fails, so we have to do this ourselves.
  widget.getElement().getStyle().setProperty("whiteSpace", "normal");
  widget.getElement().getStyle().setProperty("lineHeight", "normal");

  return widget;
}
 
Example #25
Source File: CajolerFacade.java    From incubator-retired-wave with Apache License 2.0 5 votes vote down vote up
private void handleSuccessfulResponse(
    String url, HTML target, PluginContext pluginContext, CajolerResponse cajoled) {
  if (ENABLE_CACHE) {
    cache.put(url, cajoled);
  }

  appendToDocument(target, pluginContext, cajoled);
}
 
Example #26
Source File: Header.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
private Widget getLinksSection() {
    linksPane = new HTMLPanel(createLinks());
    linksPane.getElement().setId("header-links-section");
    linksPane.getElement().setAttribute("role", "menubar");
    linksPane.getElement().setAttribute("aria-controls", "main-content-area");

    for (final ToplevelTabs.Config tlt : toplevelTabs) {
        final String id = "header-" + tlt.getToken();

        SafeHtmlBuilder html = new SafeHtmlBuilder();
        html.appendHtmlConstant("<div class='header-link-label'>");
        html.appendHtmlConstant("<span role='menuitem'>");
        html.appendHtmlConstant(tlt.getTitle());
        html.appendHtmlConstant("</span>");
        html.appendHtmlConstant("</div>");
        HTML widget = new HTML(html.toSafeHtml());
        widget.setStyleName("fill-layout");

        widget.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                // navigate either child directly or parent if revealed the first time
                /*boolean hasChild = perspectiveStore.hasChild(tlt.getToken());
                String token = hasChild ?
                        perspectiveStore.getChild(tlt.getToken()) : tlt.getToken();
                boolean updateToken = hasChild ? true : tlt.isUpdateToken();*/

                String token = tlt.getToken();
                placeManager.revealPlace(
                        new PlaceRequest.Builder().nameToken(token).build(), tlt.isUpdateToken()
                );
            }
        });
        linksPane.add(widget, id);

    }

    return linksPane;
}
 
Example #27
Source File: CajolerFacade.java    From swellrt with Apache License 2.0 5 votes vote down vote up
/**
 * Given a GWT {@code HTML} widget, instantiate an HTML Template doodad within
 * that widget.
 *
 * @param target a GWT {@code HTML} widget. The contents of this widget will
 *        be cleared out and replaced with the dynamic content created by the
 *        HTML Template doodad.
 * @param pluginContext an object which will be exposed to the HTML Template
 *        doodad as a global window variable named {@code wave}. This
 *        represents the Wave API to the doodad's JavaScript.
 * @param url the URL of an HTML file that will be cajoled (via Caja) and
 *        instantiated as the contents of the supplied {@code HTML} widget.
 */
// This should be @SuppressWarnings("deadCode"), to ignore the branch disabled
// by the ENABLE_CACHE value, but Eclipse does not recognise "deadCode".
@SuppressWarnings("all")
public void instantiateDoodadInHTML(
    final HTML target, final PluginContext pluginContext, final String url) {
  if (ENABLE_CACHE && cache.containsKey(url)) {
    SchedulerInstance.getMediumPriorityTimer().schedule(new Task() {
      @Override
      public void execute() {
        // Use isAttached as a cheap approximation of doodad still being active.
        if (target.isAttached()) {
          appendToDocument(target, pluginContext, cache.get(url));
        }
      }
    });
  } else {
    cajoleService.cajole(url, new Callback<CajolerResponse>() {
      @Override
      public void onSuccess(CajolerResponse cajoled) {
        handleSuccessfulResponse(url, target, pluginContext, cajoled);
      }

      @Override
      public void onError(String message) {
        // log.
      }
    });
  }
}
 
Example #28
Source File: DiagramTab.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
private void initZooming() {
    HTML zoomBox = new HTML();
    DOM.setStyleAttribute(zoomBox.getElement(), "opacity", "0.15");
    DOM.setStyleAttribute(zoomBox.getElement(), "mozOpacity", "0.15");
    DOM.setStyleAttribute(zoomBox.getElement(), "msFilter", "\"progid:DXImageTransform.Microsoft.Alpha(Opacity=15)\"");
    DOM.setStyleAttribute(zoomBox.getElement(), "filter", "alpha(opacity=15)");

    DOM.setStyleAttribute(zoomBox.getElement(), "outline", "black dashed 1px");
    DOM.setStyleAttribute(zoomBox.getElement(), "backgroundColor", "blue");
    DOM.setStyleAttribute(zoomBox.getElement(), "visibility", "hidden");
    this.mainChartViewport.add(zoomBox);

    GenericWidgetView zoomBoxView = new GenericWidgetViewImpl(zoomBox);
    new ZoomBoxPresenter(this.mainChartEventBus, zoomBoxView);
}
 
Example #29
Source File: JMSEditor.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
public Widget asWidget() {
    LayoutPanel layout = new LayoutPanel();

    VerticalPanel panel = new VerticalPanel();
    panel.setStyleName("rhs-content-panel");

    ScrollPanel scroll = new ScrollPanel(panel);
    layout.add(scroll);
    layout.setWidgetTopHeight(scroll, 0, Style.Unit.PX, 100, Style.Unit.PCT);

    serverName = new HTML("Replace me");
    serverName.setStyleName("content-header-label");

    panel.add(serverName);
    panel.add(new ContentDescription("Configuration for JMS queues and topics."));

    TabPanel bottomLayout = new TabPanel();
    bottomLayout.addStyleName("default-tabpanel");
    bottomLayout.addStyleName("master_detail-detail");

    queueList = new JMSQueueList(presenter);
    bottomLayout.add(queueList.asWidget(), "Queues");

    topicList = new JMSTopicList(presenter);
    bottomLayout.add(topicList.asWidget(), "Topics");

    bottomLayout.selectTab(0);

    panel.add(bottomLayout);

    return layout;
}
 
Example #30
Source File: CoreQueueEditor.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
public Widget asWidget() {
    LayoutPanel layout = new LayoutPanel();

    VerticalPanel panel = new VerticalPanel();
    panel.setStyleName("rhs-content-panel");

    ScrollPanel scroll = new ScrollPanel(panel);
    layout.add(scroll);
    layout.setWidgetTopHeight(scroll, 0, Style.Unit.PX, 100, Style.Unit.PCT);

    serverName = new HTML("Replace me");
    serverName.setStyleName("content-header-label");

    panel.add(serverName);
    panel.add(new ContentDescription("Configuration for core queues."));

    TabPanel bottomLayout = new TabPanel();
    bottomLayout.addStyleName("default-tabpanel");
    bottomLayout.addStyleName("master_detail-detail");

    queueList = new CoreQueueList(presenter);
    bottomLayout.add(queueList.asWidget(), "Queues");

    bottomLayout.selectTab(0);

    panel.add(bottomLayout);

    return layout;
}