当前位置: 首页>>代码示例>>Java>>正文


Java PopupPanel类代码示例

本文整理汇总了Java中com.google.gwt.user.client.ui.PopupPanel的典型用法代码示例。如果您正苦于以下问题:Java PopupPanel类的具体用法?Java PopupPanel怎么用?Java PopupPanel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PopupPanel类属于com.google.gwt.user.client.ui包,在下文中一共展示了PopupPanel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: HorizontalPanelWithHint

import com.google.gwt.user.client.ui.PopupPanel; //导入依赖的package包/类
public HorizontalPanelWithHint(Widget hint) {
	super();
	iHint = new PopupPanel();
	iHint.setWidget(hint);
	iHint.setStyleName("unitime-PopupHint");
	sinkEvents(Event.ONMOUSEOVER);
	sinkEvents(Event.ONMOUSEOUT);
	sinkEvents(Event.ONMOUSEMOVE);
	iShowHint = new Timer() {
		@Override
		public void run() {
			iHint.show();
		}
	};
	iHideHint = new Timer() {
		@Override
		public void run() {
			iHint.hide();
		}
	};
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:22,代码来源:HorizontalPanelWithHint.java

示例2: UniTimeTable

import com.google.gwt.user.client.ui.PopupPanel; //导入依赖的package包/类
public UniTimeTable() {
	setCellPadding(2);
	setCellSpacing(0);
	sinkEvents(Event.ONMOUSEOVER);
	sinkEvents(Event.ONMOUSEOUT);
	sinkEvents(Event.ONCLICK);
	sinkEvents(Event.ONKEYDOWN);
	sinkEvents(Event.ONDBLCLICK);
	setStylePrimaryName("unitime-MainTable");
	iHintPanel = new PopupPanel();
	iHintPanel.setStyleName("unitime-PopupHint");
	Roles.getGridRole().set(getElement());
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:14,代码来源:UniTimeTable.java

示例3: UniTimeTableHeader

import com.google.gwt.user.client.ui.PopupPanel; //导入依赖的package包/类
public UniTimeTableHeader(String title, int colSpan, HorizontalAlignmentConstant align) {
	super(title, false);
	iColSpan = colSpan;
	iAlign = align;
	iTitle = title;
	
	addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent event) {
			final PopupPanel popup = new PopupPanel(true);
			popup.addStyleName("unitime-Menu");
			if (!setMenu(popup)) return;
			popup.showRelativeTo((Widget)event.getSource());
			((MenuBar)popup.getWidget()).focus();
		}
	});
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:18,代码来源:UniTimeTableHeader.java

示例4: SelectionLayer

import com.google.gwt.user.client.ui.PopupPanel; //导入依赖的package包/类
public SelectionLayer() {
	setStyleName("selection-layer");
	
	iPopup = new PopupPanel();
	iPopup.setStyleName("unitime-TimeGridSelectionPopup");
	iHint = new P("content");
	iPopup.setWidget(iHint);
	
	iSelection = new SelectionPanel();
	iSelection.setVisible(false);
	add(iSelection, 0, 0);
	
	sinkEvents(Event.ONMOUSEDOWN);
	sinkEvents(Event.ONMOUSEUP);
	sinkEvents(Event.ONMOUSEMOVE);
	sinkEvents(Event.ONMOUSEOVER);
	sinkEvents(Event.ONMOUSEOUT);
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:19,代码来源:TimeGrid.java

示例5: openAdditionalChoiceDialog

import com.google.gwt.user.client.ui.PopupPanel; //导入依赖的package包/类
/**
 * Opens the additional choice dialog.
 */
protected void openAdditionalChoiceDialog() {
  popup.setPopupPositionAndShow(new PopupPanel.PositionCallback() {
    public void setPosition(int offsetWidth, int offsetHeight){
      // adjust the x and y positions so that the entire panel
      // is on-screen
      int xPosition = getAbsoluteLeft();
      int yPosition = getAbsoluteTop();
      int xExtrude =
        xPosition + offsetWidth - Window.getClientWidth() - Window.getScrollLeft();
      int yExtrude =
        yPosition + offsetHeight - Window.getClientHeight() - Window.getScrollTop();
      if (xExtrude > 0) {
        xPosition -= (xExtrude + ADDITIONAL_CHOICE_ONSCREEN_PADDING);
      }
      if (yExtrude > 0) {
        yPosition -= (yExtrude + ADDITIONAL_CHOICE_ONSCREEN_PADDING);
      }
      popup.setPopupPosition(xPosition, yPosition);
    }
  });
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:25,代码来源:AdditionalChoicePropertyEditor.java

示例6: onClose

import com.google.gwt.user.client.ui.PopupPanel; //导入依赖的package包/类
@Override
public void onClose(CloseEvent<PopupPanel> event) {
	debug("VComboBoxMultiselect.SP: onClose(" + event.isAutoClosed() + ")");

	if (event.isAutoClosed()) {
		this.lastAutoClosed = new Date().getTime();
	}
}
 
开发者ID:bonprix,项目名称:vaadin-combobox-multiselect,代码行数:9,代码来源:VComboBoxMultiselect.java

示例7: onResponseReceived

import com.google.gwt.user.client.ui.PopupPanel; //导入依赖的package包/类
@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();
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:20,代码来源:ColumnEditorWidget.java

示例8: DropDown

import com.google.gwt.user.client.ui.PopupPanel; //导入依赖的package包/类
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);
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:18,代码来源:DropDown.java

示例9: showContextMenuPopup

import com.google.gwt.user.client.ui.PopupPanel; //导入依赖的package包/类
protected void showContextMenuPopup(int left, int top) {
    if (customContextMenu instanceof HasWidgets) {
        if (!((HasWidgets) customContextMenu).iterator().hasNext()) {
            // there are no actions to show
            return;
        }
    }

    customContextMenuPopup = Tools.createCubaTableContextMenu();
    customContextMenuPopup.setOwner(this);
    customContextMenuPopup.setWidget(customContextMenu);

    customContextMenuPopup.addCloseHandler(new CloseHandler<PopupPanel>() {
        @Override
        public void onClose(CloseEvent<PopupPanel> event) {
            customContextMenuPopup = null;
        }
    });

    Tools.showPopup(customContextMenuPopup, left, top);
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:22,代码来源:CubaTreeWidget.java

示例10: closeAllRegisteredPopups

import com.google.gwt.user.client.ui.PopupPanel; //导入依赖的package包/类
public void closeAllRegisteredPopups() {
	//Set the closing all marker
	isCloseAllPopupInProgress = true;
	//Iterate through all the popups and close them, Iterate the list backwards
	//because we typically have a stack of dialog windows that are open
	ListIterator<PopupPanel> iterWindows = openedPopUps.listIterator( openedPopUps.size() );
	while( iterWindows.hasPrevious() ) {
		try {
			iterWindows.previous().hide();
		} catch( Throwable e) {
			//DO nothing if the exceptions happened then we window is probably already closed or smth.
		}
	}
	//Clear the list of popups
	openedPopUps.clear();
	//Remove the closing all marker
	isCloseAllPopupInProgress = false;
}
 
开发者ID:ivan-zapreev,项目名称:x-cure-chat,代码行数:19,代码来源:SiteManagerUI.java

示例11: CustomOverlayWidget

import com.google.gwt.user.client.ui.PopupPanel; //导入依赖的package包/类
/**
 * The constructor should first call super() to initialize the component and
 * then handle any initialization relevant to Vaadin.
 */
public CustomOverlayWidget() {
    setWidget(new HTML()); // Seems that we need this one
    overlay = new PopupPanel();
    overlay.addStyleName(CLASSNAME);
    overlay.setAutoHideEnabled(false);
    overlay.setAnimationEnabled(false);
    overlay.setModal(false);

    Event.addNativePreviewHandler(new NativePreviewHandler() {
        public void onPreviewNativeEvent(NativePreviewEvent event) {
            int typeInt = event.getTypeInt();
            // We're only listening for these
            if (typeInt == Event.ONSCROLL) {
                CustomOverlayWidget.this.updateOverlayPosition();
            }
        }
    });
}
 
开发者ID:Haulmont,项目名称:vaadin-overlays,代码行数:23,代码来源:CustomOverlayWidget.java

示例12: MultiLineTextDisplayElement

import com.google.gwt.user.client.ui.PopupPanel; //导入依赖的package包/类
public MultiLineTextDisplayElement(String id, int x, int y, int width, int height,
        String text, String label, int[][] coords) {
    super(id, x, y, width, height);
    this.coords = coords;
    this.label = label;
    this.text = text;
    
    popup = new PopupPanel(true, false);
    HTML content = new HTML(text);
	
    popup.setStylePrimaryName("PopupPanel");
    popup.addStyleName("AnnotationPopup");
	popup.setWidget(content);
    
 // Create a canvas containing the filled polygon with no border
    Canvas sub_canvas = Canvas.createIfSupported();
    sub_canvas.setCoordinateSpaceWidth(width);
    sub_canvas.setCoordinateSpaceHeight(height);
    
    Context2d context = sub_canvas.getContext2d();
    context.beginPath();
    context.moveTo(coords[0][0] - baseLeft(), coords[0][1] - baseTop());

    for (int i = 1; i < coords.length; i++) {
    	context.lineTo(coords[i][0] - baseLeft(), coords[i][1] - baseTop());
    }
	
    context.setFillStyle(color_fill);
    context.fill();
    
    context.closePath();
    
    this.image_data = context.getImageData(0, 0, width, height);
}
 
开发者ID:jhu-digital-manuscripts,项目名称:rosa,代码行数:35,代码来源:MultiLineTextDisplayElement.java

示例13: doElementAction

import com.google.gwt.user.client.ui.PopupPanel; //导入依赖的package包/类
@Override
public boolean doElementAction(final int x, final int y) {
	if (never_show) {
		return false;
	}
	
	popup.setPopupPositionAndShow(new PopupPanel.PositionCallback() {
		int left = x;
		int top = y;

		public void setPosition(int width, int height) {
			if (left + width > Window.getClientWidth()) {
				left = Window.getClientWidth() - width;
			}
			
			if (top + height > Window.getClientHeight()) {
				top = Window.getClientHeight() - height;
			}
			
			popup.setPopupPosition(left, top);
		}
	});
	
	return true;
}
 
开发者ID:jhu-digital-manuscripts,项目名称:rosa,代码行数:26,代码来源:MultiLineTextDisplayElement.java

示例14: resolve

import com.google.gwt.user.client.ui.PopupPanel; //导入依赖的package包/类
public void resolve(Object source) {
    PopupPanel p = (PopupPanel) popups.get( source );
    if( p != null ){
        p.hide();
        popups.remove( source );
        if( listeners.containsKey( source ) ){
            try{
                ((SourcesPropertyChangeEvents) source)
                .removePropertyChangeListener("attach", 
                        (PropertyChangeListener) listeners.remove(source) );
                ((SourcesPropertyChangeEvents) source)
                .removePropertyChangeListener("visible",
                        (PropertyChangeListener) listeners.remove(source));
                
            } catch(RuntimeException re){
                re.printStackTrace();
            }
        }
    }
}
 
开发者ID:kebernet,项目名称:gwittir,代码行数:21,代码来源:PopupValidationFeedback.java

示例15: testPanels

import com.google.gwt.user.client.ui.PopupPanel; //导入依赖的package包/类
@Test
public void testPanels() throws Exception {
  invokeAllAccessibleMethods(new AbsolutePanel() {});
  invokeAllAccessibleMethods(new CellPanel() {});
  invokeAllAccessibleMethods(new ComplexPanel() {});
  invokeAllAccessibleMethods(new DeckLayoutPanel() {});
  invokeAllAccessibleMethods(new DeckPanel() {});
  invokeAllAccessibleMethods(new DecoratorPanel() {});
  invokeAllAccessibleMethods(new DockLayoutPanel(Unit.PX) {});
  invokeAllAccessibleMethods(new DockPanel() {});
  invokeAllAccessibleMethods(new FlowPanel() {});
  invokeAllAccessibleMethods(new FocusPanel() {});
  invokeAllAccessibleMethods(new HorizontalPanel() {});
  invokeAllAccessibleMethods(new HTMLPanel("") {});
  invokeAllAccessibleMethods(new LayoutPanel() {});
  invokeAllAccessibleMethods(new PopupPanel() {});
  invokeAllAccessibleMethods(new RenderablePanel("") {});
  invokeAllAccessibleMethods(new ResizeLayoutPanel() {});
  invokeAllAccessibleMethods(new SimpleLayoutPanel() {});
  invokeAllAccessibleMethods(new SimplePanel() {});
  invokeAllAccessibleMethods(new SplitLayoutPanel() {});
  invokeAllAccessibleMethods(new StackPanel() {});
  invokeAllAccessibleMethods(new VerticalPanel() {});
}
 
开发者ID:google,项目名称:gwtmockito,代码行数:25,代码来源:GwtMockitoWidgetBaseClassesTest.java


注:本文中的com.google.gwt.user.client.ui.PopupPanel类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。