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


Java WindowUtils.showError方法代碼示例

本文整理匯總了Java中com.trollworks.toolkit.ui.widget.WindowUtils.showError方法的典型用法代碼示例。如果您正苦於以下問題:Java WindowUtils.showError方法的具體用法?Java WindowUtils.showError怎麽用?Java WindowUtils.showError使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.trollworks.toolkit.ui.widget.WindowUtils的用法示例。


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

示例1: actionPerformed

import com.trollworks.toolkit.ui.widget.WindowUtils; //導入方法依賴的package包/類
@Override
public void actionPerformed(ActionEvent event) {
    Object source = event.getSource();
    if (source == mPNGResolutionCombo) {
        Preferences.getInstance().setValue(MODULE, PNG_RESOLUTION_KEY, DPI[mPNGResolutionCombo.getSelectedIndex()]);
    } else if (source == mTextTemplatePicker) {
        File file = StdFileDialog.showOpenDialog(this, SELECT_TEXT_TEMPLATE);
        if (file != null) {
            mTextTemplatePath.setText(PathUtils.getFullPath(file));
        }
    } else if (source == mGurpsCalculatorLink && Desktop.isDesktopSupported()) {
        try {
            Desktop.getDesktop().browse(new URI(GURPS_CALCULATOR_URL));
        } catch (Exception exception) {
            WindowUtils.showError(this, MessageFormat.format(UNABLE_TO_OPEN_URL, GURPS_CALCULATOR_URL));
        }
    }
    adjustResetButton();
}
 
開發者ID:richardwilkes,項目名稱:gcs,代碼行數:20,代碼來源:OutputPreferences.java

示例2: pageSetup

import com.trollworks.toolkit.ui.widget.WindowUtils; //導入方法依賴的package包/類
/**
 * Presents the page setup dialog and allows the user to change the settings.
 *
 * @param proxy The {@link PrintProxy} representing the information that would be printed.
 * @return Whether the user canceled (or an error occurred).
 */
public boolean pageSetup(PrintProxy proxy) {
	if (useNativeDialogs()) {
		PageFormat format = mJob.pageDialog(createPageFormat());
		if (format != null) {
			adjustSettingsToPageFormat(format);
			proxy.adjustToPageSetupChanges();
			return true;
		}
	} else {
		PageSetupPanel panel = new PageSetupPanel(getPrintService(), mSet);
		if (WindowUtils.showOptionDialog(UIUtilities.getComponentForDialog(proxy), panel, PAGE_SETUP_TITLE, false, JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE, null, null, null) == JOptionPane.OK_OPTION) {
			try {
				PrintService service = panel.accept(mSet);
				if (service != null) {
					mJob.setPrintService(service);
				}
				proxy.adjustToPageSetupChanges();
				return true;
			} catch (PrinterException exception) {
				WindowUtils.showError(UIUtilities.getComponentForDialog(proxy), UNABLE_TO_SWITCH_PRINTERS);
			}
		}
	}
	return false;
}
 
開發者ID:Ayutac,項目名稱:toolkit,代碼行數:32,代碼來源:PrintManager.java

示例3: finalStartup

import com.trollworks.toolkit.ui.widget.WindowUtils; //導入方法依賴的package包/類
@Override
public void finalStartup() {
    super.finalStartup();
    setDefaultMenuBar(new StdMenuBar());
    if (Platform.isMacintosh() && App.getHomePath().toString().toLowerCase().contains("/apptranslocation/")) { //$NON-NLS-1$
        WindowUtils.showError(null, Text.wrapToCharacterCount(TRANSLOCATION_INSTRUCTIONS, 60) + XATTR_CMD);
    }
}
 
開發者ID:richardwilkes,項目名稱:gcs,代碼行數:9,代碼來源:GCSApp.java

示例4: saveTo

import com.trollworks.toolkit.ui.widget.WindowUtils; //導入方法依賴的package包/類
@Override
public File[] saveTo(File file) {
    ArrayList<File> result = new ArrayList<>();
    String extension = PathUtils.getExtension(file.getName());
    File textTemplate = TextTemplate.resolveTextTemplate(null);
    String templateExtension = PathUtils.getExtension(textTemplate.getName());
    if (FileType.PNG_EXTENSION.equals(extension)) {
        if (!mSheet.saveAsPNG(file, result)) {
            WindowUtils.showError(this, EXPORT_PNG_ERROR);
        }
    } else if (FileType.PDF_EXTENSION.equals(extension)) {
        if (mSheet.saveAsPDF(file)) {
            result.add(file);
        } else {
            WindowUtils.showError(this, EXPORT_PDF_ERROR);
        }
    } else if (templateExtension.equals(extension)) {
        if (new TextTemplate(mSheet).export(file, null)) {
            result.add(file);
        } else {
            WindowUtils.showError(this, EXPORT_TEXT_TEMPLATE_ERROR);
        }
    } else {
        return super.saveTo(file);
    }
    return result.toArray(new File[result.size()]);
}
 
開發者ID:richardwilkes,項目名稱:gcs,代碼行數:28,代碼來源:SheetDockable.java

示例5: choosePortrait

import com.trollworks.toolkit.ui.widget.WindowUtils; //導入方法依賴的package包/類
/** Allows the user to choose a portrait for their character. */
public void choosePortrait() {
    File file = SheetPreferences.choosePortrait();
    if (file != null) {
        try {
            mSheet.getCharacter().getDescription().setPortrait(StdImage.loadImage(file));
        } catch (Exception exception) {
            WindowUtils.showError(this, MessageFormat.format(BAD_IMAGE, PathUtils.getFullPath(file)));
        }
    }
}
 
開發者ID:richardwilkes,項目名稱:gcs,代碼行數:12,代碼來源:PortraitPanel.java

示例6: saveTo

import com.trollworks.toolkit.ui.widget.WindowUtils; //導入方法依賴的package包/類
@Override
public File[] saveTo(File file) {
    if (mDataFile.save(file)) {
        mDataFile.setFile(file);
        getDockContainer().updateTitle(this);
        return new File[] { file };
    }
    WindowUtils.showError(this, SAVE_ERROR);
    return new File[0];
}
 
開發者ID:richardwilkes,項目名稱:gcs,代碼行數:11,代碼來源:CommonDockable.java

示例7: goToUpdate

import com.trollworks.toolkit.ui.widget.WindowUtils; //導入方法依賴的package包/類
/** Go to the update location on the web, if a new version is available. */
public static void goToUpdate() {
	if (NEW_VERSION_AVAILABLE && Desktop.isDesktopSupported()) {
		try {
			Desktop.getDesktop().browse(new URI(UPDATE_URL));
		} catch (Exception exception) {
			WindowUtils.showError(null, exception.getMessage());
		}
	}
}
 
開發者ID:Ayutac,項目名稱:toolkit,代碼行數:11,代碼來源:UpdateChecker.java

示例8: actionPerformed

import com.trollworks.toolkit.ui.widget.WindowUtils; //導入方法依賴的package包/類
@Override
public void actionPerformed(ActionEvent event) {
	try {
		Desktop.getDesktop().open(mFile);
	} catch (IOException exception) {
		WindowUtils.showError(null, exception.getMessage());
	}
}
 
開發者ID:Ayutac,項目名稱:toolkit,代碼行數:9,代碼來源:OpenLocalFileCommand.java

示例9: actionPerformed

import com.trollworks.toolkit.ui.widget.WindowUtils; //導入方法依賴的package包/類
@Override
public void actionPerformed(ActionEvent event) {
	if (mURI != null) {
		try {
			Desktop.getDesktop().browse(mURI);
		} catch (IOException exception) {
			WindowUtils.showError(null, exception.getMessage());
		}
	}
}
 
開發者ID:Ayutac,項目名稱:toolkit,代碼行數:11,代碼來源:OpenURICommand.java

示例10: print

import com.trollworks.toolkit.ui.widget.WindowUtils; //導入方法依賴的package包/類
/** @param proxy The {@link PrintProxy} to print. */
public static void print(PrintProxy proxy) {
	if (proxy != null) {
		PrintManager mgr = proxy.getPrintManager();
		if (mgr != null) {
			mgr.print(proxy);
		} else {
			WindowUtils.showError(UIUtilities.getComponentForDialog(proxy), NO_PRINTER_SELECTED);
		}
	}
}
 
開發者ID:Ayutac,項目名稱:toolkit,代碼行數:12,代碼來源:PrintCommand.java

示例11: actionPerformed

import com.trollworks.toolkit.ui.widget.WindowUtils; //導入方法依賴的package包/類
@Override
public void actionPerformed(ActionEvent event) {
	PrintProxy proxy = getTarget(PrintProxy.class);
	if (proxy != null) {
		PrintManager mgr = proxy.getPrintManager();
		if (mgr != null) {
			mgr.pageSetup(proxy);
		} else {
			WindowUtils.showError(UIUtilities.getComponentForDialog(proxy), NO_PRINTER_SELECTED);
		}
	}
}
 
開發者ID:Ayutac,項目名稱:toolkit,代碼行數:13,代碼來源:PageSetupCommand.java


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