本文整理汇总了Java中org.eclipse.jface.dialogs.PopupDialog类的典型用法代码示例。如果您正苦于以下问题:Java PopupDialog类的具体用法?Java PopupDialog怎么用?Java PopupDialog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PopupDialog类属于org.eclipse.jface.dialogs包,在下文中一共展示了PopupDialog类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: Popup2
import org.eclipse.jface.dialogs.PopupDialog; //导入依赖的package包/类
public Popup2(final IPopupProvider provider, final Widget... controls) {
super(WorkbenchHelper.getShell(), PopupDialog.HOVER_SHELLSTYLE, false, false, false, false, false, null, null);
this.provider = provider;
final Shell parent = provider.getControllingShell();
parent.addListener(SWT.Move, hide);
parent.addListener(SWT.Resize, hide);
parent.addListener(SWT.Close, hide);
parent.addListener(SWT.Deactivate, hide);
parent.addListener(SWT.Hide, hide);
parent.addListener(SWT.Dispose, event -> close());
for (final Widget c : controls) {
if (c == null) {
continue;
}
final TypedListener typedListener = new TypedListener(mtl);
c.addListener(SWT.MouseEnter, typedListener);
c.addListener(SWT.MouseExit, typedListener);
c.addListener(SWT.MouseHover, typedListener);
}
}
开发者ID:gama-platform,项目名称:gama,代码行数:21,代码来源:Popup2.java
示例2: GenericInfoPopupDialog
import org.eclipse.jface.dialogs.PopupDialog; //导入依赖的package包/类
public GenericInfoPopupDialog(Shell parentShell, String title, String message, final Runnable runnable)
{
super(parentShell, PopupDialog.INFOPOPUPRESIZE_SHELLSTYLE | SWT.MODELESS, false, true, true, false, false,
title, null);
this.message = message;
clickListener = new MouseAdapter()
{
@Override
public void mouseDown(MouseEvent e)
{
if (runnable != null)
{
runnable.run();
}
close();
}
};
}
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:21,代码来源:GenericInfoPopupDialog.java
示例3: AbstractInPlaceDialog
import org.eclipse.jface.dialogs.PopupDialog; //导入依赖的package包/类
public AbstractInPlaceDialog(Shell parent, int side, Control openControl) {
super(parent, PopupDialog.INFOPOPUP_SHELLSTYLE, false, false, false, false, false, null, null);
this.side = side;
this.openControl = openControl;
Rectangle bounds;
if (openControl == null || openControl.isDisposed()) {
bounds = new Rectangle(0, 0, 0, 0);
} else {
bounds = openControl.getBounds();
Point absPosition = openControl.toDisplay(openControl.getLocation());
bounds.x = absPosition.x - bounds.x;
bounds.y = absPosition.y - bounds.y;
}
this.controlBounds = bounds;
if (openControl != null) {
openControl.addDisposeListener(disposeListener);
}
}
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:21,代码来源:AbstractInPlaceDialog.java
示例4: createDialogArea
import org.eclipse.jface.dialogs.PopupDialog; //导入依赖的package包/类
protected Control createDialogArea(Composite parent) {
text = new Text(parent, SWT.MULTI | SWT.READ_ONLY | SWT.WRAP
| SWT.NO_FOCUS);
// Use the compact margins employed by PopupDialog.
GridData gd = new GridData(GridData.BEGINNING
| GridData.FILL_BOTH);
gd.horizontalIndent = PopupDialog.POPUP_HORIZONTALSPACING;
gd.verticalIndent = PopupDialog.POPUP_VERTICALSPACING;
text.setLayoutData(gd);
text.setText(contents);
// since SWT.NO_FOCUS is only a hint...
text.addFocusListener(new FocusAdapter() {
public void focusGained(FocusEvent event) {
ContentProposalPopup.this.close();
}
});
return text;
}
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:21,代码来源:ContentProposalAdapter.java
示例5: QuickLaunchDialog
import org.eclipse.jface.dialogs.PopupDialog; //导入依赖的package包/类
public QuickLaunchDialog(Shell parent, History<String> history) {
super(parent, PopupDialog.INFOPOPUPRESIZE_SHELLSTYLE, GRAB_FOCUS, PERSIST_SIZE, PERSIST_BOUNDS,
SHOW_DIALOG_MENU, SHOW_PERSIST_ACTIONS, TITLE, INFOTEXT);
if (history==null){
history= new History<>(10);
}
this.history=history;
}
开发者ID:de-jcup,项目名称:egradle,代码行数:9,代码来源:QuickLaunchDialog.java
示例6: createDialogArea
import org.eclipse.jface.dialogs.PopupDialog; //导入依赖的package包/类
@Override
protected Control createDialogArea(Composite parent) {
text = new Text(parent, SWT.MULTI | SWT.READ_ONLY | SWT.WRAP
| SWT.NO_FOCUS);
// Use the compact margins employed by PopupDialog.
GridData gd = new GridData(GridData.BEGINNING
| GridData.FILL_BOTH);
gd.horizontalIndent = PopupDialog.POPUP_HORIZONTALSPACING;
gd.verticalIndent = PopupDialog.POPUP_VERTICALSPACING;
text.setLayoutData(gd);
text.setText(contents);
// since SWT.NO_FOCUS is only a hint...
text.addFocusListener(new FocusAdapter() {
@Override
public void focusGained(FocusEvent event) {
ContentProposalPopup.this.close();
}
});
return text;
}
开发者ID:Transkribus,项目名称:TranskribusSwtGui,代码行数:23,代码来源:MyContentProposalAdapter.java
示例7: QuickOutline
import org.eclipse.jface.dialogs.PopupDialog; //导入依赖的package包/类
public QuickOutline(Shell parent, JsonEditor editor, String fileContentType) {
super(parent, PopupDialog.INFOPOPUPRESIZE_SHELLSTYLE, true, true, true, true, true, null, null);
this.fileContentType = fileContentType;
IBindingService bindingService = (IBindingService) PlatformUI.getWorkbench().getAdapter(IBindingService.class);
this.bindingKey = bindingService.getBestActiveBindingFormattedFor(COMMAND_ID);
this.triggerSequence = bindingService.getBestActiveBindingFor(COMMAND_ID);
this.editor = editor;
setInfoText(statusMessage());
create();
}
开发者ID:RepreZen,项目名称:KaiZen-OpenAPI-Editor,代码行数:13,代码来源:QuickOutline.java
示例8: PartialTranslationDialog
import org.eclipse.jface.dialogs.PopupDialog; //导入依赖的package包/类
/**
* The constructor
*
* @param shell
* is the shell of the SuggestionBubble that is parent of this
* dialog
* @param parent
* is the parent of this dialog.
*/
public PartialTranslationDialog(Shell shell, SuggestionBubble parent) {
this.parent = parent;
this.shell = shell;
if (System.getProperty("os.name").toLowerCase().contains("windows")) {
SHELL_STYLE = PopupDialog.INFOPOPUP_SHELLSTYLE;
win = true;
} else {
SHELL_STYLE = PopupDialog.HOVER_SHELLSTYLE;
win = false;
}
}
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:23,代码来源:PartialTranslationDialog.java
示例9: getPopup
import org.eclipse.jface.dialogs.PopupDialog; //导入依赖的package包/类
static Shell getPopup() {
if (popup == null || popup.isDisposed() || popup.getShell() == null || popup.getShell().isDisposed()) {
popup = new Shell(WorkbenchHelper.getShell(), PopupDialog.HOVER_SHELLSTYLE);
popup.setLayout(new GridLayout(1, true));
}
return popup;
}
开发者ID:gama-platform,项目名称:gama,代码行数:9,代码来源:Popup.java
示例10: TitaniumUpdatePopup
import org.eclipse.jface.dialogs.PopupDialog; //导入依赖的package包/类
public TitaniumUpdatePopup(Shell parentShell, final Runnable updateAction)
{
super(parentShell, PopupDialog.INFOPOPUPRESIZE_SHELLSTYLE | SWT.MODELESS, false, true, true, false, false,
MessageFormat.format(EplMessages.TitaniumUpdatePopup_update_title, EclipseUtil.getStudioPrefix()), null);
clickListener = new MouseAdapter()
{
public void mouseDown(MouseEvent e)
{
updateAction.run();
close();
}
};
}
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:16,代码来源:TitaniumUpdatePopup.java
示例11: initializeDefaultImages
import org.eclipse.jface.dialogs.PopupDialog; //导入依赖的package包/类
/**
* Initialize default images in JFace's image registry.
*
*/
private static void initializeDefaultImages() {
Object bundle = null;
// try {
// bundle = JFaceActivator.getBundle();
// } catch (NoClassDefFoundError exception) {
// // Test to see if OSGI is present
// }
declareImage(bundle, Wizard.DEFAULT_IMAGE, ICONS_PATH + "page.gif", //$NON-NLS-1$
Wizard.class, "images/page.gif"); //$NON-NLS-1$
// register default images for dialogs
declareImage(bundle, Dialog.DLG_IMG_MESSAGE_INFO, ICONS_PATH
+ "message_info.gif", Dialog.class, "images/message_info.gif"); //$NON-NLS-1$ //$NON-NLS-2$
declareImage(bundle, Dialog.DLG_IMG_MESSAGE_WARNING, ICONS_PATH
+ "message_warning.gif", Dialog.class, //$NON-NLS-1$
"images/message_warning.gif"); //$NON-NLS-1$
declareImage(bundle, Dialog.DLG_IMG_MESSAGE_ERROR, ICONS_PATH
+ "message_error.gif", Dialog.class, "images/message_error.gif");//$NON-NLS-1$ //$NON-NLS-2$
declareImage(bundle, Dialog.DLG_IMG_HELP,
ICONS_PATH + "help.gif", Dialog.class, "images/help.gif");//$NON-NLS-1$ //$NON-NLS-2$
declareImage(
bundle,
TitleAreaDialog.DLG_IMG_TITLE_BANNER,
ICONS_PATH + "title_banner.png", TitleAreaDialog.class, "images/title_banner.gif");//$NON-NLS-1$ //$NON-NLS-2$
declareImage(
bundle,
PreferenceDialog.PREF_DLG_TITLE_IMG,
ICONS_PATH + "pref_dialog_title.gif", PreferenceDialog.class, "images/pref_dialog_title.gif");//$NON-NLS-1$ //$NON-NLS-2$
declareImage(bundle, PopupDialog.POPUP_IMG_MENU, ICONS_PATH
+ "popup_menu.gif", PopupDialog.class, "images/popup_menu.gif");//$NON-NLS-1$ //$NON-NLS-2$
declareImage(
bundle,
PopupDialog.POPUP_IMG_MENU_DISABLED,
ICONS_PATH + "popup_menu_disabled.gif", PopupDialog.class, "images/popup_menu_disabled.gif");//$NON-NLS-1$ //$NON-NLS-2$
}
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:41,代码来源:JFaceResources.java
示例12: SelectionDialog
import org.eclipse.jface.dialogs.PopupDialog; //导入依赖的package包/类
@SuppressWarnings("deprecation") // backward compatibility
public SelectionDialog(Shell parent, ISelectExecute mini, ITextEditor editor) {
// Europa compatible constructor
super((Shell) null, PopupDialog.HOVER_SHELLSTYLE, false, false, false, false, null, null);
this.editor = editor;
this.minibuffer = mini;
}
开发者ID:MulgaSoft,项目名称:e4macs,代码行数:8,代码来源:SelectionDialog.java
示例13: TeamExplorerSearchControlPopup
import org.eclipse.jface.dialogs.PopupDialog; //导入依赖的package包/类
public TeamExplorerSearchControlPopup(final TeamExplorerSearchControl searchControl) {
// HOVER_SHELLSTYLE cannot get focus, which is nice in this case
super(searchControl.getShell(), PopupDialog.HOVER_SHELLSTYLE, false, false, false, false, false, null, null);
this.searchControl = searchControl;
}
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:7,代码来源:TeamExplorerSearchControlPopup.java
示例14: sendDialogOpened
import org.eclipse.jface.dialogs.PopupDialog; //导入依赖的package包/类
public static void sendDialogOpened(final PopupDialog dialog, final Map<String, String> properties) {
Check.notNull(dialog, "dialog"); //$NON-NLS-1$
final String dialogName = getName(dialog);
sendDialogOpened(dialogName, properties);
}
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:7,代码来源:ClientTelemetryHelper.java
示例15: InfoPopupDialog
import org.eclipse.jface.dialogs.PopupDialog; //导入依赖的package包/类
InfoPopupDialog(Shell parent) {
super(parent, PopupDialog.HOVER_SHELLSTYLE, false, false, false,
false, false, null, null);
}
开发者ID:Transkribus,项目名称:TranskribusSwtGui,代码行数:5,代码来源:MyContentProposalAdapter.java
示例16: adjustBounds
import org.eclipse.jface.dialogs.PopupDialog; //导入依赖的package包/类
@Override
protected void adjustBounds() {
Rectangle parentBounds = getParentShell().getBounds();
Rectangle proposedBounds;
// Try placing the info popup to the right
Rectangle rightProposedBounds = new Rectangle(parentBounds.x
+ parentBounds.width
+ PopupDialog.POPUP_HORIZONTALSPACING, parentBounds.y
+ PopupDialog.POPUP_VERTICALSPACING,
parentBounds.width, parentBounds.height);
rightProposedBounds = getConstrainedShellBounds(rightProposedBounds);
// If it won't fit on the right, try the left
if (rightProposedBounds.intersects(parentBounds)) {
Rectangle leftProposedBounds = new Rectangle(parentBounds.x
- parentBounds.width - POPUP_HORIZONTALSPACING - 1,
parentBounds.y, parentBounds.width,
parentBounds.height);
leftProposedBounds = getConstrainedShellBounds(leftProposedBounds);
// If it won't fit on the left, choose the proposed bounds
// that fits the best
if (leftProposedBounds.intersects(parentBounds)) {
if (rightProposedBounds.x - parentBounds.x >= parentBounds.x
- leftProposedBounds.x) {
rightProposedBounds.x = parentBounds.x
+ parentBounds.width
+ PopupDialog.POPUP_HORIZONTALSPACING;
proposedBounds = rightProposedBounds;
} else {
leftProposedBounds.width = parentBounds.x
- POPUP_HORIZONTALSPACING
- leftProposedBounds.x;
proposedBounds = leftProposedBounds;
}
} else {
// use the proposed bounds on the left
proposedBounds = leftProposedBounds;
}
} else {
// use the proposed bounds on the right
proposedBounds = rightProposedBounds;
}
getShell().setBounds(proposedBounds);
}
开发者ID:Transkribus,项目名称:TranskribusSwtGui,代码行数:44,代码来源:MyContentProposalAdapter.java
示例17: popUp
import org.eclipse.jface.dialogs.PopupDialog; //导入依赖的package包/类
private void popUp(final String title, final String description){
new PopupDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),PopupDialog.INFOPOPUPRESIZE_SHELLSTYLE,true,false,false,false,false,title,null){
private static final int CURSOR_SIZE=15;
private Label label = null;
protected Point getInitialLocation(Point initialSize){
Display display=getShell().getDisplay();
Point location=display.getCursorLocation();
location.x+=CURSOR_SIZE;
location.y+=CURSOR_SIZE;
return location;
}
protected Control createDialogArea( Composite parent){
Font terminalFont = JFaceResources.getFont(JFaceResources.TEXT_FONT);
label=new Label(parent,SWT.WRAP);
label.setText(description);
label.setFont(terminalFont);
/*
label.addFocusListener(new FocusAdapter(){
public void focusLost( FocusEvent event){
System.out.println("focus lost.");
close();
}
@Override
public void focusGained(FocusEvent e) {
super.focusGained(e);
System.out.println("focus gained.");
}
}
);
label.addKeyListener(new KeyAdapter() {
public void keyPressed(KeyEvent e) {
close();
}
});*/
GridData gd=new GridData(GridData.BEGINNING | GridData.FILL_BOTH);
gd.horizontalIndent=PopupDialog.POPUP_HORIZONTALSPACING;
gd.verticalIndent=PopupDialog.POPUP_VERTICALSPACING;
label.setLayoutData(gd);
return label;
}
}
.open();
}
开发者ID:yuv422,项目名称:z80editor,代码行数:47,代码来源:InstructionCounterHandler.java
示例18: SuggestionBubble
import org.eclipse.jface.dialogs.PopupDialog; //导入依赖的package包/类
/**
* Constructor
*
* @param parent
* is the parent {@link Text} object, to which SuggestionBubble
* will be added.
* @param targetLanguage
* is the language, to which the
* {@link SuggestionBubble.defaultText} will be translated
*/
public SuggestionBubble(Text parent, String targetLanguage) {
shell = parent.getShell();
text = parent;
this.targetLanguage = targetLanguage;
suggestionFilter = new SuggestionFilter();
suggestions = new ArrayList<Suggestion>();
String srcLang = System
.getProperty("tapiji.translator.default.language");
if (srcLang != null) {
SRC_LANG = srcLang.substring(0, 2).toUpperCase();
}
if (System.getProperty("os.name").toLowerCase().contains("windows")) {
SHELL_STYLE = PopupDialog.INFOPOPUPRESIZE_SHELLSTYLE;
win = true;
} else {
SHELL_STYLE = PopupDialog.HOVER_SHELLSTYLE;
win = false;
}
// MessagesEditorPlugin.getDefault().getBundle().
// getEntry("glossary.xml").getPath()
// System.out.println("install path "+MessagesEditorPlugin.getDefault().getBundle().getEntry("/").getPath()+"glossary.xml");
SuggestionProviderUtils.addSuggestionProviderUpdateListener(this);
/*
* Read shortcut of content assist (code completion) directly from
* org.eclipse.ui.IWorkbenchCommandConstants.EDIT_CONTENT_ASSIST and
* save it to CONTENT_ASSIST final variable
*/
IBindingService bindingService = (IBindingService) PlatformUI
.getWorkbench().getAdapter(IBindingService.class);
CONTENT_ASSIST = bindingService
.getBestActiveBindingFormattedFor(IWorkbenchCommandConstants.EDIT_CONTENT_ASSIST);
init();
}
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:52,代码来源:SuggestionBubble.java
示例19: QuickMenuDialog
import org.eclipse.jface.dialogs.PopupDialog; //导入依赖的package包/类
public QuickMenuDialog(Shell parent, String title)
{
super(parent, PopupDialog.INFOPOPUP_SHELLSTYLE, true, false, false, false, false, title, null);
}
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:5,代码来源:QuickMenuDialog.java
示例20: adjustBounds
import org.eclipse.jface.dialogs.PopupDialog; //导入依赖的package包/类
protected void adjustBounds() {
Rectangle parentBounds = getParentShell().getBounds();
Rectangle proposedBounds;
// Try placing the info popup to the right
Rectangle rightProposedBounds = new Rectangle(parentBounds.x
+ parentBounds.width
+ PopupDialog.POPUP_HORIZONTALSPACING, parentBounds.y
+ PopupDialog.POPUP_VERTICALSPACING,
parentBounds.width, parentBounds.height);
rightProposedBounds = getConstrainedShellBounds(rightProposedBounds);
// If it won't fit on the right, try the left
if (rightProposedBounds.intersects(parentBounds)) {
Rectangle leftProposedBounds = new Rectangle(parentBounds.x
- parentBounds.width - POPUP_HORIZONTALSPACING - 1,
parentBounds.y, parentBounds.width,
parentBounds.height);
leftProposedBounds = getConstrainedShellBounds(leftProposedBounds);
// If it won't fit on the left, choose the proposed bounds
// that fits the best
if (leftProposedBounds.intersects(parentBounds)) {
if (rightProposedBounds.x - parentBounds.x >= parentBounds.x
- leftProposedBounds.x) {
rightProposedBounds.x = parentBounds.x
+ parentBounds.width
+ PopupDialog.POPUP_HORIZONTALSPACING;
proposedBounds = rightProposedBounds;
} else {
leftProposedBounds.width = parentBounds.x
- POPUP_HORIZONTALSPACING
- leftProposedBounds.x;
proposedBounds = leftProposedBounds;
}
} else {
// use the proposed bounds on the left
proposedBounds = leftProposedBounds;
}
} else {
// use the proposed bounds on the right
proposedBounds = rightProposedBounds;
}
getShell().setBounds(proposedBounds);
}
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:43,代码来源:ContentProposalAdapter.java
注:本文中的org.eclipse.jface.dialogs.PopupDialog类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论