當前位置: 首頁>>代碼示例>>Java>>正文


Java Dialog類代碼示例

本文整理匯總了Java中org.eclipse.swt.widgets.Dialog的典型用法代碼示例。如果您正苦於以下問題:Java Dialog類的具體用法?Java Dialog怎麽用?Java Dialog使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Dialog類屬於org.eclipse.swt.widgets包,在下文中一共展示了Dialog類的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: drawProcessingAppFinder

import org.eclipse.swt.widgets.Dialog; //導入依賴的package包/類
public void drawProcessingAppFinder(final Composite composite, 
        final String processingPath, final List<String> selectedLibs ) {

    Listener buttonListener = new Listener() {
        public void handleEvent(Event event) {
            Dialog dialog = OS.helper().getDialog(composite.getShell());
            
            if(dialog instanceof FileDialog)
                processing_app_path_text.setText(((FileDialog)dialog).open());
            else if(dialog instanceof DirectoryDialog)
                processing_app_path_text.setText(((DirectoryDialog)dialog).open());
                
        }
    };
 
    ModifyListener textModifyListener = new ModifyListener() {
        public void modifyText(ModifyEvent e) {
            validate_listener.validate();
            showDiscoveredLibraries((Text)e.getSource(), baselibs_viewer, true);
            setSelectedLibs(baselibs_viewer, selectedLibs);
        }
    };
    
    processing_app_path_text = drawDirFinder(composite, 
    		PROCESSING_APP_PATH_LABEL, processingPath, buttonListener, textModifyListener);
}
 
開發者ID:ybakos,項目名稱:proclipsing,代碼行數:27,代碼來源:PathAndLibrariesSelectionDrawer.java

示例2: applyWindowLocation

import org.eclipse.swt.widgets.Dialog; //導入依賴的package包/類
/**
 * Shellのウインドウ位置とサイズを読み込み適用します
 * 
 * @param clazz ウインドウクラス
 * @param shell Shell
 */
public static void applyWindowLocation(Class<? extends Dialog> clazz, Shell shell) {
    Map<String, WindowLocationBean> map = AppConfig.get().getWindowLocationMap();
    WindowLocationBean location;
    synchronized (map) {
        location = map.get(clazz.getName());
    }
    if (location != null) {
        if ((location.getWidth() > 0) && (location.getHeight() > 0)) {
            shell.setLocation(location.getX(), location.getY());
            shell.setSize(location.getWidth(), location.getHeight());
        }
    }
}
 
開發者ID:sanaehirotaka,項目名稱:logbook,代碼行數:20,代碼來源:LayoutLogic.java

示例3: saveWindowLocation

import org.eclipse.swt.widgets.Dialog; //導入依賴的package包/類
/**
 * Shellのウインドウ位置とサイズを保存します
 * 
 * @param clazz ウインドウクラス
 * @param shell Shell
 */
public static void saveWindowLocation(Class<? extends Dialog> clazz, Shell shell) {
    Map<String, WindowLocationBean> map = AppConfig.get().getWindowLocationMap();
    Point location = shell.getLocation();
    Point size = shell.getSize();
    WindowLocationBean wlocation = new WindowLocationBean();
    wlocation.setX(location.x);
    wlocation.setY(location.y);
    wlocation.setWidth(size.x);
    wlocation.setHeight(size.y);
    synchronized (map) {
        map.put(clazz.getName(), wlocation);
    }
}
 
開發者ID:sanaehirotaka,項目名稱:logbook,代碼行數:20,代碼來源:LayoutLogic.java

示例4: drawProcessingAppFinder

import org.eclipse.swt.widgets.Dialog; //導入依賴的package包/類
public void drawProcessingAppFinder(final Composite composite) {

        Label processingPathLabel = new Label(composite, SWT.NONE);
        processingPathLabel.setText(PROCESSING_APP_PATH_LABEL);    

        GridData gd1 = new GridData();
        gd1.widthHint = LABEL_WIDTH_HINT;
        gd1.horizontalSpan = 2;
        gd1.horizontalAlignment = SWT.BEGINNING;
        processingPathLabel.setLayoutData(gd1);
        
        processing_app_path_text = new Text(composite, SWT.NONE | SWT.BORDER );
        GridData gd = new GridData(GridData.FILL_HORIZONTAL);
        gd.widthHint = PATH_TEXT_WIDTH_HINT;
        processing_app_path_text.setLayoutData(gd);        
        
        Button button = new Button(composite, SWT.PUSH);
        button.setText(DIR_SEARCH_BUTTON_LABEL);
        button.addListener(SWT.Selection, new Listener() {
            public void handleEvent(Event event) {
            Dialog dialog = OS.helper().getDialog(composite.getShell());
            
            if(dialog instanceof FileDialog)
                processing_app_path_text.setText(((FileDialog)dialog).open());
            else if(dialog instanceof DirectoryDialog)
                processing_app_path_text.setText(((DirectoryDialog)dialog).open());
                
            }
        });        
    }
 
開發者ID:ybakos,項目名稱:proclipsing,代碼行數:31,代碼來源:ProclipsingPreferencePage.java

示例5: createContents

import org.eclipse.swt.widgets.Dialog; //導入依賴的package包/類
private void createContents(final Shell shell) {
	shell.setLayout(new GridLayout(2, false));

	final Label icon = new Label(shell, SWT.NONE);
	icon.setImage(Images.getMainIcons()[6]);
	GridData gridData = new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 3);
	icon.setLayoutData(gridData);

	final Label info = new Label(shell, SWT.NONE);
	info.setText(this.message);
	gridData = new GridData(SWT.LEAD, SWT.CENTER, false, true);
	info.setLayoutData(gridData);

	final Link linkProject = new Link(shell, SWT.NONE);
	linkProject.setText("<a href=\"" + getApplicationUrl() + "\">" + getApplicationUrl() + "</a>");
	gridData = new GridData(SWT.LEAD, SWT.CENTER, false, true);
	linkProject.setLayoutData(gridData);
	linkProject.addSelectionListener(new LinkSelectionListener());

	final Link linkIcon = new Link(shell, SWT.NONE);
	String url = getIconUrl().startsWith("http") ? getIconUrl() : "http://" + getIconUrl();
	linkIcon.setText(Messages.get("msg.info.icon") + " <a href=\"" + url + "\">" + getIconUrl() + "</a>");
	gridData = new GridData(SWT.LEAD, SWT.CENTER, false, true);
	linkIcon.setLayoutData(gridData);
	linkIcon.addSelectionListener(new LinkSelectionListener());

	final Button okButton = new Button(shell, SWT.PUSH);
	okButton.setText(Messages.get("lbl.button.ok"));
	final GC gc = new GC(okButton);
	gc.setFont(okButton.getFont());
	final int buttonWidth = org.eclipse.jface.dialogs.Dialog.convertHorizontalDLUsToPixels(gc.getFontMetrics(), IDialogConstants.BUTTON_WIDTH);
	gc.dispose();
	GridDataFactory.swtDefaults().align(SWT.CENTER, SWT.CENTER).grab(true, false).span(2, 1).minSize(buttonWidth, SWT.DEFAULT).applyTo(okButton);
	okButton.setFocus();
	okButton.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent event) {
			shell.close();
		}
	});
	shell.setDefaultButton(okButton);
}
 
開發者ID:Albertus82,項目名稱:RouterLogger,代碼行數:43,代碼來源:AboutDialog.java

示例6: createContents

import org.eclipse.swt.widgets.Dialog; //導入依賴的package包/類
private void createContents(final Shell shell) {
	shell.setLayout(new GridLayout(2, false));

	final Label icon = new Label(shell, SWT.NONE);
	icon.setImage(Images.getMainIcons()[5]);
	GridData gridData = new GridData(SWT.CENTER, SWT.CENTER, false, false, 0, 3);
	icon.setLayoutData(gridData);

	final Label info = new Label(shell, SWT.NONE);
	info.setText(this.message);
	gridData = new GridData(SWT.LEAD, SWT.CENTER, false, true);
	info.setLayoutData(gridData);

	final Link linkProject = new Link(shell, SWT.NONE);
	linkProject.setText("<a href=\"" + getApplicationUrl() + "\">" + getApplicationUrl() + "</a>");
	gridData = new GridData(SWT.LEAD, SWT.CENTER, false, true);
	linkProject.setLayoutData(gridData);
	linkProject.addSelectionListener(new LinkSelectionListener());

	final Link linkIcon = new Link(shell, SWT.NONE);
	String url = getIconUrl().startsWith("http") ? getIconUrl() : "http://" + getIconUrl();
	linkIcon.setText(Messages.get("msg.info.icon") + " <a href=\"" + url + "\">" + getIconUrl() + "</a>");
	gridData = new GridData(SWT.LEAD, SWT.CENTER, false, true);
	linkIcon.setLayoutData(gridData);
	linkIcon.addSelectionListener(new LinkSelectionListener());

	final Button okButton = new Button(shell, SWT.PUSH);
	okButton.setText(Messages.get("lbl.button.ok"));
	final GC gc = new GC(okButton);
	gc.setFont(okButton.getFont());
	final FontMetrics fontMetrics = gc.getFontMetrics();
	final int buttonWidth = org.eclipse.jface.dialogs.Dialog.convertHorizontalDLUsToPixels(fontMetrics, IDialogConstants.BUTTON_WIDTH);
	gc.dispose();
	GridDataFactory.swtDefaults().align(SWT.CENTER, SWT.CENTER).grab(true, false).span(2, 1).minSize(buttonWidth, SWT.DEFAULT).applyTo(okButton);
	okButton.setFocus();
	okButton.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent event) {
			shell.close();
		}
	});
	shell.setDefaultButton(okButton);
}
 
開發者ID:Albertus82,項目名稱:CyclesMod,代碼行數:44,代碼來源:AboutDialog.java

示例7: getBrowseDialog

import org.eclipse.swt.widgets.Dialog; //導入依賴的package包/類
public Dialog getBrowseDialog() {
    return browseDialog;
}
 
開發者ID:Elphel,項目名稱:vdt-plugin,代碼行數:4,代碼來源:BrowseableField.java

示例8: setBrowseDialog

import org.eclipse.swt.widgets.Dialog; //導入依賴的package包/類
public void setBrowseDialog(Dialog browseDialog) {
    this.browseDialog = browseDialog;
}
 
開發者ID:Elphel,項目名稱:vdt-plugin,代碼行數:4,代碼來源:BrowseableField.java

示例9: getDialog

import org.eclipse.swt.widgets.Dialog; //導入依賴的package包/類
public Dialog getDialog(Shell shell) {
    	System.out.println("OS FILE DIALOG");
//        return new FileDialog(shell);
        return new DirectoryDialog(shell);
    }
 
開發者ID:ybakos,項目名稱:proclipsing,代碼行數:6,代碼來源:OSHelper.java

示例10: getDialog

import org.eclipse.swt.widgets.Dialog; //導入依賴的package包/類
public Dialog getDialog(Shell shell) {
    return new FileDialog(shell);
}
 
開發者ID:ybakos,項目名稱:proclipsing,代碼行數:4,代碼來源:MacOSHelper.java

示例11: SaveWindowLocationAdapter

import org.eclipse.swt.widgets.Dialog; //導入依賴的package包/類
/**
 * コンストラクター
 *
 * @param dialogClass ウインドウ
 */
public SaveWindowLocationAdapter(Class<? extends Dialog> dialogClass) {
    this.dialogClass = dialogClass;
}
 
開發者ID:sanaehirotaka,項目名稱:logbook,代碼行數:9,代碼來源:SaveWindowLocationAdapter.java

示例12: SaveWindowLocationAdapter

import org.eclipse.swt.widgets.Dialog; //導入依賴的package包/類
/**
 * コンストラクター
 * 
 * @param dialog ウインドウ
 */
public SaveWindowLocationAdapter(Class<? extends Dialog> dialogClass) {
    this.dialogClass = dialogClass;
}
 
開發者ID:kyuntx,項目名稱:logbookpn,代碼行數:9,代碼來源:SaveWindowLocationAdapter.java


注:本文中的org.eclipse.swt.widgets.Dialog類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。