當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。