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


Java PopupPanel.hide方法代码示例

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


在下文中一共展示了PopupPanel.hide方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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

示例3: loadSourceFile

import com.google.gwt.user.client.ui.PopupPanel; //导入方法依赖的package包/类
/**
* loadSourceFile opens the app as a new app inventor project
* @param gApp the app to open
* @return True if success, otherwise false
*/
public boolean loadSourceFile(GalleryApp gApp, String newProjectName, final PopupPanel popup) {
  final String projectName = newProjectName;
  final String sourceKey = getGallerySettings().getSourceKey(gApp.getGalleryAppId());
  final long galleryId = gApp.getGalleryAppId();

  // first check name to see if valid and unique...
  if (!TextValidators.checkNewProjectName(projectName))
    return false;  // the above function takes care of error messages
  // Callback for updating the project explorer after the project is created on the back-end
  final Ode ode = Ode.getInstance();

  final OdeAsyncCallback<UserProject> callback = new OdeAsyncCallback<UserProject>(
  // failure message
  MESSAGES.createProjectError()) {
    @Override
    public void onSuccess(UserProject projectInfo) {
      Project project = ode.getProjectManager().addProject(projectInfo);
      Ode.getInstance().openYoungAndroidProjectInDesigner(project);
      popup.hide();
    }
    @Override
    public void onFailure(Throwable caught) {
      popup.hide();
      super.onFailure(caught);
    }
  };
  // this is really what's happening here, we call server to load project
  ode.getProjectService().newProjectFromGallery(projectName, sourceKey, galleryId, callback);
  return true;
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:36,代码来源:GalleryClient.java

示例4: addItems

import com.google.gwt.user.client.ui.PopupPanel; //导入方法依赖的package包/类
/**
 * Adds suggestions to the suggestion menu bar.
 * 
 * @param suggestions
 *            the suggestions to be added
 * @param textFieldWidget
 *            the text field which the suggestion is attached to to bring
 *            back the focus after selection
 * @param popupPanel
 *            pop-up panel where the menu bar is shown to hide it after
 *            selection
 * @param suggestionServerRpc
 *            server RPC to ask for new suggestion after a selection
 */
public void addItems(final List<SuggestTokenDto> suggestions, final VTextField textFieldWidget,
        final PopupPanel popupPanel, final TextFieldSuggestionBoxServerRpc suggestionServerRpc) {
    for (int index = 0; index < suggestions.size(); index++) {
        final SuggestTokenDto suggestToken = suggestions.get(index);
        final MenuItem mi = new MenuItem(suggestToken.getSuggestion(), true, new ScheduledCommand() {
            @Override
            public void execute() {
                final String tmpSuggestion = suggestToken.getSuggestion();
                final TokenStartEnd tokenStartEnd = tokenMap.get(tmpSuggestion);
                final String text = textFieldWidget.getValue();
                final StringBuilder builder = new StringBuilder(text);
                builder.replace(tokenStartEnd.getStart(), tokenStartEnd.getEnd() + 1, tmpSuggestion);
                textFieldWidget.setValue(builder.toString(), true);
                popupPanel.hide();
                textFieldWidget.setFocus(true);
                suggestionServerRpc.suggest(builder.toString(), textFieldWidget.getCursorPos());
            }
        });
        tokenMap.put(suggestToken.getSuggestion(),
                new TokenStartEnd(suggestToken.getStart(), suggestToken.getEnd()));
        Roles.getListitemRole().set(mi.getElement());
        WidgetUtil.sinkOnloadForImages(mi.getElement());
        addItem(mi);
    }
}
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:40,代码来源:SuggestionsSelectList.java

示例5: animationIconCSS

import com.google.gwt.user.client.ui.PopupPanel; //导入方法依赖的package包/类
private void animationIconCSS(int mills, int startX, int startY) {
    Image icon = new Image(ONE_GEAR_ICON_LARGE);
    final PopupPanel popup= new PopupPanel();
    popup.setStyleName("");
    popup.addStyleName("animationLevel");
    popup.setAnimationEnabled(false);
    popup.setWidget(icon);
    Widget w= button.getIcon()!=null ? button.getIcon() : button;
    int endX= w.getAbsoluteLeft();
    int endY= w.getAbsoluteTop();
    setupCssAnimation(startX,startY,endX,endY);
    int extra= 35;
    CssAnimation.setAnimationStyle(popup,"iconAnimate "+ (mills+extra) +"ms ease-in-out 1 normal");
    popup.setPopupPosition(endX, endY);
    popup.show();
    Timer t= new Timer() {
        @Override
        public void run() {
            popup.hide();
        }
    };
    t.schedule( mills);
}
 
开发者ID:lsst,项目名称:firefly,代码行数:24,代码来源:BackgroundManager.java

示例6: setMenu

import com.google.gwt.user.client.ui.PopupPanel; //导入方法依赖的package包/类
public boolean setMenu(final PopupPanel popup) {
	List<Operation> operations = getOperations();
	if (operations.isEmpty()) return false;
	boolean first = true;
	MenuBar menu = new MenuBarWithAccessKeys();
	for (final Operation op: operations) {
		if (!op.isApplicable()) continue;
		if (op.hasSeparator() && !first)
			menu.addSeparator();
		first = false;
		MenuItem item = new MenuItem(op.getName(), true, new Command() {
			@Override
			public void execute() {
				popup.hide();
				op.execute();
			}
		});
		if (op instanceof AriaOperation)
			Roles.getMenuitemRole().setAriaLabelProperty(item.getElement(), ((AriaOperation)op).getAriaLabel());
		else
			Roles.getMenuitemRole().setAriaLabelProperty(item.getElement(), UniTimeHeaderPanel.stripAccessKey(op.getName()));
		menu.addItem(item);
	}
	if (first) return false;
	menu.setVisible(true);
	popup.add(menu);
	return true;
}
 
开发者ID:UniTime,项目名称:unitime,代码行数:29,代码来源:UniTimeTableHeader.java

示例7: deliverError

import com.google.gwt.user.client.ui.PopupPanel; //导入方法依赖的package包/类
public void deliverError(ValidationError ve) {
	AtomTools.log(Level.FINE, "Frame.deliverError using generic implementation", this);
	
	final PopupPanel popupPanel = new PopupPanel(false);
	popupPanel.getElement().getStyle().setZIndex(1000);
	VerticalPanel popUpPanelContents = new VerticalPanel();
	popupPanel.setTitle("Error");
	HTML message = new HTML(ve.getMessage());
    Button button = new Button("Close", new ClickHandler() {
		
		public void onClick(ClickEvent event) {
			popupPanel.hide();
		}
	});
    SimplePanel holder = new SimplePanel();
    holder.add(button);
    popUpPanelContents.add(message);
    popUpPanelContents.add(holder);
    popupPanel.setWidget(popUpPanelContents);
    popupPanel.center();
}
 
开发者ID:fhcampuswien,项目名称:atom,代码行数:22,代码来源:Frame.java

示例8: show

import com.google.gwt.user.client.ui.PopupPanel; //导入方法依赖的package包/类
public static void show(String text, int delayMillis, final boolean doReload){
	final PopupPanel notificationPopup = new PopupPanel(false);
	final Label label = new Label(text);
	notificationPopup.setWidget(label);
	notificationPopup.setPopupPosition(50, 20);
	notificationPopup.setVisible(true);
	notificationPopup.show();

	Timer t = new Timer() {
		@Override
		public void run() {
			Animation a = new Animation() {
				@Override
				protected void onUpdate(double progress) {
					notificationPopup.getElement().getStyle().setProperty("opacity", String.valueOf(1-progress));
					if(progress == 1) {
						notificationPopup.hide();
						if(doReload)
							Location.reload();
					}
				}
			};
			a.run(500);
		}
	};
	
	t.schedule(delayMillis);
}
 
开发者ID:jkonert,项目名称:socom,代码行数:29,代码来源:ShortNotification.java

示例9: show

import com.google.gwt.user.client.ui.PopupPanel; //导入方法依赖的package包/类
public void show() {
	final PopupPanel panel = new PopupPanel();
	panel.setStyleName(Res.R.style().toast());

	HTML label = new HTML(message.replace("\n", "<br/>"));
	panel.setWidget(label);
	panel.setPopupPositionAndShow(new PopupPanel.PositionCallback() {
		public void setPosition(int offsetWidth, int offsetHeight) {
			int left = (Window.getClientWidth() - offsetWidth) / 2;
			int top = 0;
			switch (gravity) {
				case Gravity.TOP:
					top = (Window.getClientHeight() - offsetHeight) / 10;
					break;
				case Gravity.CENTER:
					top = (Window.getClientHeight() - offsetHeight) / 2;
					break;
				case Gravity.BOTTOM:
					top = 9 * (Window.getClientHeight() - offsetHeight) / 10;
					break;
			}
			panel.setPopupPosition(left, top);
		}
	});

	// Create a new timer that calls hide().
	Timer t = new Timer() {
		public void run() {
			panel.hide();
		}
	};

	if (duration == LENGTH_SHORT) {
		t.schedule(2500);
	} else {
		t.schedule(4000);
	}
}
 
开发者ID:mobialia,项目名称:gwt-android-emu,代码行数:39,代码来源:Toast.java

示例10: AriaSuggestBox

import com.google.gwt.user.client.ui.PopupPanel; //导入方法依赖的package包/类
public AriaSuggestBox(AriaTextBox box, SuggestOracle oracle) {
	iOracle = oracle;
	iText = box;
	iText.setStyleName("gwt-SuggestBox");
	initWidget(iText);
	
	addEventsToTextBox();
	
	iSuggestionMenu = new SuggestionMenu();
	
	iPopupScroll = new ScrollPanel(iSuggestionMenu);
	iPopupScroll.addStyleName("scroll");
	
	iSuggestionPopup = new PopupPanel(true, false);
	iSuggestionPopup.setPreviewingAllNativeEvents(true);
	iSuggestionPopup.setStyleName("unitime-SuggestBoxPopup");
	iSuggestionPopup.setWidget(iPopupScroll);
	iSuggestionPopup.addAutoHidePartner(getElement());
	
	iSuggestionCallback = new SuggestionCallback() {
		@Override
		public void onSuggestionSelected(Suggestion suggestion) {
			if (!suggestion.getReplacementString().isEmpty()) {
				setStatus(ARIA.suggestionSelected(status(suggestion)));
			}
			iCurrentText = suggestion.getReplacementString();
			setText(suggestion.getReplacementString());
			hideSuggestionList();
			fireSuggestionEvent(suggestion);
		}
	};
	
	iOracleCallback = new SuggestOracle.Callback() {
		@Override
		public void onSuggestionsReady(Request request, Response response) {
			if (response.getSuggestions() == null || response.getSuggestions().isEmpty()) {
				if (iSuggestionPopup.isShowing()) iSuggestionPopup.hide();
			} else {
				iSuggestionMenu.clearItems();
				SuggestOracle.Suggestion first = null;
				for (SuggestOracle.Suggestion suggestion: response.getSuggestions()) {
					iSuggestionMenu.addItem(new SuggestionMenuItem(suggestion));
					if (first == null) first = suggestion;
				}
				iSuggestionMenu.selectItem(0);
				ToolBox.setMinWidth(iSuggestionMenu.getElement().getStyle(), (iText.getElement().getClientWidth() - 4) + "px");
				iSuggestionPopup.showRelativeTo(iText);
				iSuggestionMenu.scrollToView();
				if (response.getSuggestions().size() == 1) {
					if (first.getReplacementString().isEmpty())
						setStatus(status(first));
					else
						setStatus(ARIA.showingOneSuggestion(status(first)));
				} else {
					setStatus(ARIA.showingMultipleSuggestions(response.getSuggestions().size(), request.getQuery(), status(first)));
				}
			}
		}
	};
	
	Roles.getTextboxRole().setAriaAutocompleteProperty(iText.getElement(), AutocompleteValue.NONE);
	
	iSuggestionPopup.getElement().setAttribute("id", DOM.createUniqueId());
	Roles.getTextboxRole().setAriaOwnsProperty(iText.getElement(), Id.of(iSuggestionPopup.getElement()));
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:66,代码来源:AriaSuggestBox.java

示例11: InfoPanelImpl

import com.google.gwt.user.client.ui.PopupPanel; //导入方法依赖的package包/类
public InfoPanelImpl() {
	super("cell");
	iText = new P("text");
	add(iText);
	
	iHint = new ClickableHint(""); iHint.setStyleName("hint");
	add(iHint);
	
	iUpdateInfo = new Callback() {
		@Override
		public void execute(Callback callback) {
			if (callback != null) callback.execute(null);
		}
	};
	
	iInfo = new FlexTable();
	iInfo.setStyleName("unitime-InfoTable");
	// iUpdateInfo = updateInfo;
	iInfoPanel = new PopupPanel();
	iInfoPanel.setWidget(iInfo);
	iInfoPanel.setStyleName("unitime-PopupHint");
	sinkEvents(Event.ONMOUSEOVER);
	sinkEvents(Event.ONMOUSEOUT);
	sinkEvents(Event.ONMOUSEMOVE);
	iShowInfo = new Timer() {
		@Override
		public void run() {
			if (iInfo.getRowCount() == 0) return;
			iUpdateInfo.execute(new Callback() {
				public void execute(Callback callback) {
					iInfoPanel.setPopupPositionAndShow(new PopupPanel.PositionCallback() {
						@Override
						public void setPosition(int offsetWidth, int offsetHeight) {
							int maxX = Window.getScrollLeft() + Window.getClientWidth() - offsetWidth - 10;
							iInfoPanel.setPopupPosition(Math.min(iX, maxX), iY);
						}
					});
					if (callback != null) callback.execute(null);
				}
			});
		}
	};
	iHideInfo = new Timer() {
		@Override
		public void run() {
			iInfoPanel.hide();
		}
	};
	
	iDefaultClickHandler = new ClickHandler() {
		@Override
		public void onClick(ClickEvent event) {
			if (iUrl != null && !iUrl.isEmpty())
				ToolBox.open(GWT.getHostPageBaseURL() + iUrl);
		}
	};
	iTextClick = iHint.addClickHandler(iDefaultClickHandler);
	iHintClick = iText.addClickHandler(iDefaultClickHandler);
	iHint.setTabIndex(-1);
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:61,代码来源:InfoPanelImpl.java

示例12: DatasetButton

import com.google.gwt.user.client.ui.PopupPanel; //导入方法依赖的package包/类
public DatasetButton() {
    choose = new PushButton("Data Set");
    choose.setTitle("Select a Data Set.");
    choose.addStyleDependentName("SMALLER");
    choose.addClickHandler(openClick);
    datasetPanel = new PopupPanel(false);
    datasetPanel.setAnimationEnabled(true);
    datasetWidget = new DatasetWidget();
    datasetWidget.setName(name);
    datasetWidget.setHeight("650px");
    datasetWidget.addSelectionHandler(new SelectionHandler<TreeItem>() {
        @Override
        public void onSelection(SelectionEvent<TreeItem> event) {
            TreeItem item = event.getSelectedItem();
            Object u = item.getUserObject();
            if ( u instanceof VariableSerializable ) {
                selectedVariable = (VariableSerializable) u;
                dataset_name.setText(selectedVariable.getDSName());
                variable_name.setText(selectedVariable.getName());
                datasetWidget.setName(name); // setting the name of this datasetWidget as it will be the source of the re-firing of event
                eventBus.fireEvent(event); // this datasetWidget is now the source                    
            }
        }
    });
    datasetWidget.init();
    popupGrid = new Grid(3, 1);
    close = new Button("close");
    close.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent arg0) {
            datasetPanel.hide();
        }
    });
    verticalPanel.add(dataset_name);
    verticalPanel.add(variable_name);
    selection.add(verticalPanel);
    treePanel.add(datasetWidget);
    popupGrid.setWidget(0, 0, close);
    popupGrid.setWidget(1, 0, selection);
    popupGrid.setWidget(2, 0, treePanel);
    datasetPanel.add(popupGrid);
    datasetPanel.hide();
    initWidget(choose);
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:45,代码来源:DatasetButton.java

示例13: setInstructions

import com.google.gwt.user.client.ui.PopupPanel; //导入方法依赖的package包/类
public void setInstructions(final String instructions, final String infoButtonChar, final String closeButtonLabel) {
        final HTML instructionsLabel = new HTML(instructions);
        final PopupPanel popupPanel = new PopupPanel(false); // the close action to this panel causes background buttons to be clicked
        popupPanel.setGlassEnabled(true);
        popupPanel.setStylePrimaryName("stimulusHelpPanel");
        instructionsLabel.setStylePrimaryName("stimulusHelpText");
        instructionsScrollPanel = new ScrollPanel(instructionsLabel);
        instructionsScrollPanel.getElement().getStyle().setPropertyPx("maxHeight", Window.getClientHeight() - 150);
        final VerticalPanel verticalPanel = new VerticalPanel();
        verticalPanel.add(instructionsScrollPanel);
        final Button closeButton = new Button(closeButtonLabel);
        verticalPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
        verticalPanel.add(closeButton);
        popupPanel.setWidget(verticalPanel);
        infoButton.setText(infoButtonChar);
        final SingleShotEventListner infoSingleShotEventListner = new SingleShotEventListner() {

            @Override
            protected void singleShotFired() {
                if (infoButton.isEnabled()) {
//                    outerGrid.clear(); // users found that hiding the picker screen made it hard to understand the instruction text
                    popupPanel.center();
                    infoButton.setEnabled(false);
                    resetSingleShot();
                }
            }
        };
        infoButton.addClickHandler(infoSingleShotEventListner);
        infoButton.addTouchStartHandler(infoSingleShotEventListner);
        infoButton.addTouchMoveHandler(infoSingleShotEventListner);
        infoButton.addTouchEndHandler(infoSingleShotEventListner);
        final SingleShotEventListner instructionsSingleShotEventListner1 = new SingleShotEventListner() {

            @Override
            protected void singleShotFired() {
                popupPanel.hide();
                resizeView();
                infoButton.setEnabled(true);
                resetSingleShot();
            }
        };
        closeButton.addClickHandler(instructionsSingleShotEventListner1);
        closeButton.addTouchStartHandler(instructionsSingleShotEventListner1);
        closeButton.addTouchMoveHandler(instructionsSingleShotEventListner1);
        closeButton.addTouchEndHandler(instructionsSingleShotEventListner1);
        popupPanel.addCloseHandler(new CloseHandler<PopupPanel>() {

            @Override
            public void onClose(CloseEvent<PopupPanel> event) {
                instructionsScrollPanel = null;
//                instructionsSingleShotEventListner1.eventFired();
//                infoButton.setEnabled(true);
//                resizeView();
            }
        });
        popupPanel.center();
    }
 
开发者ID:languageininteraction,项目名称:GraphemeColourSynaesthesiaApp,代码行数:58,代码来源:ColourPickerCanvasView.java

示例14: showWidgetPopup

import com.google.gwt.user.client.ui.PopupPanel; //导入方法依赖的package包/类
public void showWidgetPopup(final PresenterEventListner saveEventListner, IsWidget popupContentWidget) {
    final PopupPanel popupPanel = new PopupPanel(false); // the close action to this panel causes background buttons to be clicked
    popupPanel.setGlassEnabled(true);
    popupPanel.setStylePrimaryName("svgPopupPanel");
    final VerticalPanel popupverticalPanel = new VerticalPanel();
    popupverticalPanel.add(popupContentWidget);

    popupverticalPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
    final SingleShotEventListner cancelSingleShotEventListner = new SingleShotEventListner() {

        @Override
        protected void singleShotFired() {
            popupPanel.hide();
        }
    };
    final HorizontalPanel buttonPanel = new HorizontalPanel();
    final Button cancelButton = new Button(messages.popupCancelButtonLabel());
    cancelButton.addClickHandler(cancelSingleShotEventListner);
    cancelButton.addTouchStartHandler(cancelSingleShotEventListner);
    cancelButton.addTouchMoveHandler(cancelSingleShotEventListner);
    cancelButton.addTouchEndHandler(cancelSingleShotEventListner);
    buttonPanel.add(cancelButton);
    if (saveEventListner != null) {
        final SingleShotEventListner okSingleShotEventListner = new SingleShotEventListner() {

            @Override
            protected void singleShotFired() {
                popupPanel.hide();
                saveEventListner.eventFired(null);
            }
        };
        final Button okButton = new Button(saveEventListner.getLabel());
        okButton.addClickHandler(okSingleShotEventListner);
        okButton.addTouchStartHandler(okSingleShotEventListner);
        okButton.addTouchMoveHandler(okSingleShotEventListner);
        okButton.addTouchEndHandler(okSingleShotEventListner);
        buttonPanel.add(okButton);
    }
    popupverticalPanel.add(buttonPanel);
    popupPanel.setWidget(popupverticalPanel);
    popupPanel.setPopupPositionAndShow(new PopupPanel.PositionCallback() {

        @Override
        public void setPosition(int offsetWidth, int offsetHeight) {
            final int topPosition = Window.getClientHeight() / 2 - offsetHeight;
            // topPosition is used to make sure the dialogue is above the half way point on the screen to avoid the software keyboard covering the box
            // topPosition is also checked to make sure it does not show above the top of the page
            popupPanel.setPopupPosition(Window.getClientWidth() / 2 - offsetWidth / 2, (topPosition < 0) ? 0 : topPosition);
        }
    });
}
 
开发者ID:languageininteraction,项目名称:LanguageMemoryApp,代码行数:52,代码来源:AbstractSvgView.java


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