本文整理汇总了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();
}
示例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;
}
示例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);
}
}
示例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()]);
}
示例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)));
}
}
}
示例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];
}
示例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());
}
}
}
示例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());
}
}
示例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());
}
}
}
示例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);
}
}
}
示例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);
}
}
}