diff --git a/.hgtags b/.hgtags index 296cc4b01a89d29d8a0251a638b21d49de1ba7c4..d1ac29cc4ec1cd81a85bb16ceb1cf4bcbdbeb457 100644 --- a/.hgtags +++ b/.hgtags @@ -160,3 +160,5 @@ ddfe5562f61f54ed2121ac0c73b688b94f3e66b5 jdk8-b32 45da9cb055ee258dc09e69c1718e27eadea38e45 jdk8-b36 9e82ac15ab80370d6e021aea7b98c7c9626adb5e jdk8-b37 c45f3509a70796c54b48f32910d1caf435763416 jdk8-b38 +b6f52911752110a2889681923992c7a0baa52ccc jdk8-b39 +b88fc3359dc7edabfa8a228855d8cebf8843c055 jdk8-b40 diff --git a/make/com/apple/osxui/Makefile b/make/com/apple/osxui/Makefile index 63d78d2872ee197d6cef48f9b48247fbf8ffc5f6..0970061d1f7f90e88773b8a568a22a545c189e24 100644 --- a/make/com/apple/osxui/Makefile +++ b/make/com/apple/osxui/Makefile @@ -65,12 +65,8 @@ FILES_export = \ com/apple/laf/ScreenMenuPropertyHandler.java \ com/apple/laf/ScreenMenuPropertyListener.java -#RESOURCE_BUNDLES_COMPILED_PROPERTIES += \ -# com/apple/laf/resources/aqua.properties \ -# com/apple/laf/resources/aqua_de.properties \ -# com/apple/laf/resources/aqua_fr.properties \ -# com/apple/laf/resources/aqua_ja.properties - +RESOURCE_BUNDLES_COMPILED_PROPERTIES += \ + com/apple/laf/resources/aqua.properties # # Rules diff --git a/make/common/Release.gmk b/make/common/Release.gmk index d8ec1b713d7482fdfba192ba9384f15c999c65a8..4d8ddb1a6c7cef8fcfa33e22e886fe33290c8bf3 100644 --- a/make/common/Release.gmk +++ b/make/common/Release.gmk @@ -156,6 +156,7 @@ JDK_MAN_PAGES = \ jstack.1 \ jstat.1 \ jstatd.1 \ + jvisualvm.1 \ native2ascii.1 \ rmic.1 \ schemagen.1 \ @@ -1311,8 +1312,8 @@ $(TEMP_PREV_JDK_COMPARISON): install-previous-jdk $(DIRDIFF_JARFILE) @$(java-vm-cleanup) # Clean up names in the messages printed out -CAT_FILTER = $(SED) -e "s@$(JDK_IMAGE_DIR)@JDK_IMAGE@g" \ - -e "s@$(JRE_IMAGE_DIR)@JRE_IMAGE@g" +CAT_FILTER = $(SED) -e "s|$(JDK_IMAGE_DIR)|JDK_IMAGE|g" \ + -e "s|$(JRE_IMAGE_DIR)|JRE_IMAGE|g" # Report on the jre image comparison compare-image-jre: $(TEMP_PREV_JRE_COMPARISON) diff --git a/make/common/internal/Resources.gmk b/make/common/internal/Resources.gmk index 56a81fbf09ec70fb366eb5b89f7e8969be8defaf..fccfe273c630873bbad63a7401e1167e9819c4e6 100644 --- a/make/common/internal/Resources.gmk +++ b/make/common/internal/Resources.gmk @@ -197,6 +197,10 @@ $(GENSRCDIR)/%.java: $(SHARE_SRC)/classes/%.properties $(add-property-java-file) $(GENSRCDIR)/%.java: $(GENSRCDIR)/%.properties $(add-property-java-file) +ifdef PLATFORM_SRC_MACOS +$(GENSRCDIR)/%.java: $(PLATFORM_SRC_MACOS)/classes/%.properties + $(add-property-java-file) +endif ifndef OPENJDK $(GENSRCDIR)/%.java: $(CLOSED_PLATFORM_SRC)/classes/%.properties $(add-property-java-file) diff --git a/src/macosx/classes/com/apple/laf/AquaButtonLabeledUI.java b/src/macosx/classes/com/apple/laf/AquaButtonLabeledUI.java index 95503c8271d51cd933a6529d1657c5894f161aa2..d9ebdd0e11d491bdf6273cead6c66ce9affac631 100644 --- a/src/macosx/classes/com/apple/laf/AquaButtonLabeledUI.java +++ b/src/macosx/classes/com/apple/laf/AquaButtonLabeledUI.java @@ -30,6 +30,7 @@ import java.awt.image.BufferedImage; import javax.swing.*; import javax.swing.border.Border; +import javax.swing.plaf.UIResource; import javax.swing.plaf.basic.BasicHTML; import javax.swing.text.View; @@ -76,8 +77,11 @@ public abstract class AquaButtonLabeledUI extends AquaButtonToggleUI implements protected void setThemeBorder(final AbstractButton b) { super.setThemeBorder(b); - // Set the correct border - b.setBorder(AquaButtonBorder.getBevelButtonBorder()); + Border border = b.getBorder(); + if (border == null || border instanceof UIResource) { + // Set the correct border + b.setBorder(AquaButtonBorder.getBevelButtonBorder()); + } } protected abstract AquaButtonBorder getPainter(); diff --git a/src/macosx/classes/com/apple/laf/AquaLookAndFeel.java b/src/macosx/classes/com/apple/laf/AquaLookAndFeel.java index c7d970c13fd52216524ec9734567a5e872c93b92..3c872df2b26b6123e7185e4868b5212429480aaf 100644 --- a/src/macosx/classes/com/apple/laf/AquaLookAndFeel.java +++ b/src/macosx/classes/com/apple/laf/AquaLookAndFeel.java @@ -250,6 +250,7 @@ public class AquaLookAndFeel extends BasicLookAndFeel { */ private void initResourceBundle(final UIDefaults table) { table.setDefaultLocale(Locale.getDefault()); + table.addResourceBundle(PKG_PREFIX + "resources.aqua"); try { final ResourceBundle aquaProperties = MacOSXResourceBundle.getMacResourceBundle(PKG_PREFIX + "resources.aqua"); final Enumeration propertyKeys = aquaProperties.getKeys(); @@ -259,7 +260,6 @@ public class AquaLookAndFeel extends BasicLookAndFeel { table.put(key, aquaProperties.getString(key)); } } catch (final Exception e) { - table.addResourceBundle(PKG_PREFIX + "resources.aqua"); } } diff --git a/src/macosx/classes/com/apple/laf/AquaTabbedPaneUI.java b/src/macosx/classes/com/apple/laf/AquaTabbedPaneUI.java index f463d640fed2acc5f1e0b705aba3875a6c8fa128..7dbc187296de6c3c8672883cb4ca8efbd4da113d 100644 --- a/src/macosx/classes/com/apple/laf/AquaTabbedPaneUI.java +++ b/src/macosx/classes/com/apple/laf/AquaTabbedPaneUI.java @@ -318,7 +318,7 @@ public class AquaTabbedPaneUI extends AquaTabbedPaneCopyFromBasicUI { } // not for the scrolling tabs - if (tabIndex >= 0) { + if (component == null && tabIndex >= 0) { paintTitle(g2d, font, metrics, textRect, tabIndex, title); } diff --git a/src/macosx/classes/com/apple/laf/resources/aqua.properties b/src/macosx/classes/com/apple/laf/resources/aqua.properties index 30a840d9520d7244bb3071b726008cfdf62a3ebd..17f7a94584aa2839097925956ab8daaa10ff7452 100644 --- a/src/macosx/classes/com/apple/laf/resources/aqua.properties +++ b/src/macosx/classes/com/apple/laf/resources/aqua.properties @@ -36,45 +36,45 @@ # support. ############ FILE CHOOSER STRINGS ############# -FileChooser.fileDescriptionText=Generic File -FileChooser.directoryDescriptionText=Directory -FileChooser.newFolderErrorText=Error occured during folder creation +FileChooser.fileDescription.textAndMnemonic=Generic File +FileChooser.directoryDescription.textAndMnemonic=Directory +FileChooser.newFolderError.textAndMnemonic=Error occured during folder creation FileChooser.newFolderErrorSeparator= : -FileChooser.acceptAllFileFilterText=All Files -FileChooser.cancelButtonText=Cancel -FileChooser.saveButtonText=Save -FileChooser.openButtonText=Open -FileChooser.saveDialogTitleText=Save -FileChooser.openDialogTitleText=Open -FileChooser.updateButtonText=Update -FileChooser.helpButtonText=Help -FileChooser.directoryOpenButtonText=Open +FileChooser.acceptAllFileFilter.textAndMnemonic=All Files +FileChooser.cancelButton.textAndMnemonic=Cancel +FileChooser.saveButton.textAndMnemonic=Save +FileChooser.openButton.textAndMnemonic=Open +FileChooser.saveDialogTitle.textAndMnemonic=Save +FileChooser.openDialogTitle.textAndMnemonic=Open +FileChooser.updateButton.textAndMnemonic=Update +FileChooser.helpButton.textAndMnemonic=Help +FileChooser.directoryOpenButton.textAndMnemonic=Open # File Size Units FileChooser.fileSizeKiloBytes={0} KB FileChooser.fileSizeMegaBytes={0} MB FileChooser.fileSizeGigaBytes={0} GB -// Mac-specific strings -FileChooser.saveTitleText=Save -FileChooser.openTitleText=Open -FileChooser.newFolderExistsErrorText=That name is already taken -FileChooser.chooseButtonText=Choose +# Mac-specific strings +FileChooser.saveTitle.textAndMnemonic=Save +FileChooser.openTitle.textAndMnemonic=Open +FileChooser.newFolderExistsError.textAndMnemonic=That name is already taken +FileChooser.chooseButton.textAndMnemonic=Choose -FileChooser.newFolderButtonText=New Folder -FileChooser.newFolderTitleText=New Folder -FileChooser.fileNameLabelText=File: -FileChooser.saveDialogFileNameLabelText=Save As: -FileChooser.filesOfTypeLabelText=File Format: +FileChooser.newFolderButton.textAndMnemonic=New Folder +FileChooser.newFolderTitle.textAndMnemonic=New Folder +FileChooser.fileNameLabel.textAndMnemonic=File: +FileChooser.saveDialogFileNameLabel.textAndMnemonic=Save As: +FileChooser.filesOfTypeLabel.textAndMnemonic=File Format: FileChooser.desktopName=Desktop -FileChooser.newFolderPromptText=Name of new folder: +FileChooser.newFolderPrompt.textAndMnemonic=Name of new folder: FileChooser.untitledFolderName=untitled folder FileChooser.untitledFileName=untitled -FileChooser.createButtonText=Create +FileChooser.createButton.textAndMnemonic=Create -FileChooser.byDateText=Date Modified -FileChooser.byNameText=Name +FileChooser.byDate.textAndMnemonic=Date Modified +FileChooser.by.textAndMnemonic=Name FileChooser.newFolderAccessibleName=New Folder FileChooser.mac.newFolder=untitled folder @@ -82,76 +82,54 @@ FileChooser.mac.newFolder.subsequent=untitled folder {0} ############ COLOR CHOOSER STRINGS ############# -ColorChooser.previewText=Preview -ColorChooser.okText=OK -ColorChooser.cancelText=Cancel -ColorChooser.resetText=Reset -# VK_XXX constant for 'ColorChooser.resetText' button to make mnemonic -ColorChooser.resetMnemonic=82 -ColorChooser.sampleText=Sample Text Sample Text -ColorChooser.swatchesNameText=Swatches -ColorChooser.swatchesMnemonic=83 -ColorChooser.swatchesDisplayedMnemonicIndex=0 -ColorChooser.swatchesRecentText=Recent: -ColorChooser.hsbNameText=HSB -# Each of the ColorChooser types can define a mnemonic, as a KeyEvent.VK_XXX -# constant, and an index into the text to render the mnemonic as. The -# mnemonic is xxxMnemonic and the index of the character to underline is -# xxxDisplayedMnemonicIndex. -ColorChooser.hsbMnemonic=72 -ColorChooser.hsbDisplayedMnemonicIndex=0 -ColorChooser.hsbHueText=H -ColorChooser.hsbSaturationText=S -ColorChooser.hsbBrightnessText=B -ColorChooser.hsbRedText=R -ColorChooser.hsbGreenText=G -ColorChooser.hsbBlueText=B -ColorChooser.rgbNameText=RGB -ColorChooser.rgbMnemonic=71 -ColorChooser.rgbDisplayedMnemonicIndex=1 -ColorChooser.rgbRedText=Red -ColorChooser.rgbRedMnemonic=68 -ColorChooser.rgbGreenText=Green -ColorChooser.rgbGreenMnemonic=78 -ColorChooser.rgbBlueText=Blue -ColorChooser.rgbBlueMnemonic=66 +ColorChooser.preview.textAndMnemonic=Preview +ColorChooser.ok.textAndMnemonic=OK +ColorChooser.cancel.textAndMnemonic=Cancel +ColorChooser.reset.textAndMnemonic=&Reset +ColorChooser.sample.textAndMnemonic=Sample Text Sample Text +ColorChooser.swatches.textAndMnemonic=&Swatches +ColorChooser.swatchesRecent.textAndMnemonic=Recent: +ColorChooser.hsb.textAndMnemonic=&HSB +ColorChooser.hsbHue.textAndMnemonic=H +ColorChooser.hsbSaturation.textAndMnemonic=S +ColorChooser.hsbBrightness.textAndMnemonic=B +ColorChooser.hsbRed.textAndMnemonic=R +ColorChooser.hsbGreen.textAndMnemonic=G +ColorChooser.hsbBlue.textAndMnemonic=B +ColorChooser.rgb.textAndMnemonic=R&GB +ColorChooser.rgbRed.textAndMnemonic=Re&d +ColorChooser.rgbGreen.textAndMnemonic=Gree&n +ColorChooser.rgbBlue.textAndMnemonic=&Blue ############ OPTION PANE STRINGS ############# -# Mnemonic keys correspond to KeyEvent.VK_XXX constant # We only define mnemonics for YES/NO, but for completeness you can # define mnemonics for any of the buttons. -OptionPane.yesButtonText=Yes -OptionPane.yesButtonMnemonic=89 -OptionPane.noButtonText=No -OptionPane.noButtonMnemonic=78 -OptionPane.okButtonText=OK -OptionPane.okButtonMnemonic=0 -OptionPane.cancelButtonText=Cancel -OptionPane.cancelButtonMnemonic=0 -OptionPane.titleText=Select an Option +OptionPane.yesButton.textAndMnemonic=&Yes +OptionPane.noButton.textAndMnemonic=&No +OptionPane.okButton.textAndMnemonic=OK +OptionPane.cancelButton.textAndMnemonic=Cancel +OptionPane.title.textAndMnemonic=Select an Option # Title for the dialog for the showInputDialog methods. Only used if # the developer uses one of the variants that doesn't take a title. -OptionPane.inputDialogTitle=Input +OptionPane.inputDialog.titleAndMnemonic=Input # Title for the dialog for the showMessageDialog methods. Only used if # the developer uses one of the variants that doesn't take a title. -OptionPane.messageDialogTitle=Message +OptionPane.messageDialog.titleAndMnemonic=Message ############ Printing Dialog Strings ############ -PrintingDialog.titleProgressText=Printing -PrintingDialog.titleAbortingText=Printing (Aborting) +PrintingDialog.titleProgress.textAndMnemonic=Printing +PrintingDialog.titleAborting.textAndMnemonic=Printing (Aborting) -PrintingDialog.contentInitialText=Printing in progress... +PrintingDialog.contentInitial.textAndMnemonic=Printing in progress... # The following string will be formatted by a MessageFormat # and {0} will be replaced by page number being printed -PrintingDialog.contentProgressText=Printed page {0}... +PrintingDialog.contentProgress.textAndMnemonic=Printed page {0}... -PrintingDialog.contentAbortingText=Printing aborting... +PrintingDialog.contentAborting.textAndMnemonic=Printing aborting... -PrintingDialog.abortButtonText=Abort -PrintingDialog.abortButtonMnemonic=65 -PrintingDialog.abortButtonDisplayedMnemonicIndex=0 -PrintingDialog.abortButtonToolTipText=Abort Printing +PrintingDialog.abortButton.textAndMnemonic=&Abort +PrintingDialog.abortButtonToolTip.textAndMnemonic=Abort Printing ############ Internal Frame Strings ############ InternalFrame.iconButtonToolTip=Minimize @@ -160,42 +138,42 @@ InternalFrame.restoreButtonToolTip=Restore InternalFrame.closeButtonToolTip=Close ############ Internal Frame Title Pane Strings ############ -InternalFrameTitlePane.restoreButtonText=Restore -InternalFrameTitlePane.moveButtonText=Move -InternalFrameTitlePane.sizeButtonText=Size -InternalFrameTitlePane.minimizeButtonText=Minimize -InternalFrameTitlePane.maximizeButtonText=Maximize -InternalFrameTitlePane.closeButtonText=Close +InternalFrameTitlePane.restoreButton.textAndMnemonic=Restore +InternalFrameTitlePane.moveButton.textAndMnemonic=Move +InternalFrameTitlePane.sizeButton.textAndMnemonic=Size +InternalFrameTitlePane.minimizeButton.textAndMnemonic=Minimize +InternalFrameTitlePane.maximizeButton.textAndMnemonic=Maximize +InternalFrameTitlePane.closeButton.textAndMnemonic=Close ############ Text strings ############# # Used for html forms -FormView.submitButtonText=Submit Query -FormView.resetButtonText=Reset -FormView.browseFileButtonText=Browse... +FormView.submitButton.textAndMnemonic=Submit Query +FormView.resetButton.textAndMnemonic=Reset +FormView.browseFileButton.textAndMnemonic=Browse... ############ Abstract Document Strings ############ -AbstractDocument.styleChangeText=style change -AbstractDocument.additionText=addition -AbstractDocument.deletionText=deletion -AbstractDocument.undoText=Undo -AbstractDocument.redoText=Redo +AbstractDocument.styleChange.textAndMnemonic=style change +AbstractDocument.addition.textAndMnemonic=addition +AbstractDocument.deletion.textAndMnemonic=deletion +AbstractDocument.undo.textAndMnemonic=Undo +AbstractDocument.redo.textAndMnemonic=Redo ############ Abstract Button Strings ############ -AbstractButton.clickText=click +AbstractButton.click.textAndMnemonic=click ############ Abstract Undoable Edit Strings ############ -AbstractUndoableEdit.undoText=Undo -AbstractUndoableEdit.redoText=Redo +AbstractUndoableEdit.undo.textAndMnemonic=Undo +AbstractUndoableEdit.redo.textAndMnemonic=Redo ############ Combo Box Strings ############ -ComboBox.togglePopupText=togglePopup +ComboBox.togglePopup.textAndMnemonic=togglePopup ############ Progress Monitor Strings ############ -ProgressMonitor.progressText=Progress... +ProgressMonitor.progress.textAndMnemonic=Progress... ############ Split Pane Strings ############ -SplitPane.leftButtonText=left button -SplitPane.rightButtonText=right button +SplitPane.leftButton.textAndMnemonic=left button +SplitPane.rightButton.textAndMnemonic=right button # Used for Isindex IsindexView.prompt=This is a searchable index. Enter search keywords: diff --git a/src/macosx/classes/sun/awt/CGraphicsDevice.java b/src/macosx/classes/sun/awt/CGraphicsDevice.java index 1fda340c50921edcae57f6ac4a41dab2ec35bda3..02f743d3e727747e995df35de3730a8713932a90 100644 --- a/src/macosx/classes/sun/awt/CGraphicsDevice.java +++ b/src/macosx/classes/sun/awt/CGraphicsDevice.java @@ -40,7 +40,7 @@ public class CGraphicsDevice extends GraphicsDevice { private final int displayID; // Array of all GraphicsConfig instances for this device - private final CGraphicsConfig[] configs; + private final GraphicsConfiguration[] configs; // Default config (temporarily hard coded) private final int DEFAULT_CONFIG = 0; @@ -49,7 +49,7 @@ public class CGraphicsDevice extends GraphicsDevice { public CGraphicsDevice(int displayID) { this.displayID = displayID; - configs = new CGraphicsConfig[] { + configs = new GraphicsConfiguration[] { CGLGraphicsConfig.getConfig(this, 0) }; } @@ -66,7 +66,7 @@ public class CGraphicsDevice extends GraphicsDevice { */ @Override public GraphicsConfiguration[] getConfigurations() { - return configs; + return configs.clone(); } /** diff --git a/src/macosx/classes/sun/lwawt/LWComponentPeer.java b/src/macosx/classes/sun/lwawt/LWComponentPeer.java index a7b15e07c9640f77f985207b6443f5ebbeacf9f9..035cfe1596b86c59955fe98915c7c40eb096efe7 100644 --- a/src/macosx/classes/sun/lwawt/LWComponentPeer.java +++ b/src/macosx/classes/sun/lwawt/LWComponentPeer.java @@ -56,6 +56,8 @@ import sun.java2d.SunGraphics2D; import sun.java2d.opengl.OGLRenderQueue; import sun.java2d.pipe.Region; +import sun.util.logging.PlatformLogger; + import javax.swing.JComponent; import javax.swing.SwingUtilities; import javax.swing.RepaintManager; @@ -65,7 +67,10 @@ import sun.lwawt.macosx.CDropTarget; import com.sun.java.swing.SwingUtilities3; public abstract class LWComponentPeer - implements ComponentPeer, DropTargetPeer { + implements ComponentPeer, DropTargetPeer +{ + private static final PlatformLogger focusLog = PlatformLogger.getLogger("sun.lwawt.focus.LWComponentPeer"); + // State lock is to be used for modifications to this // peer's fields (e.g. bounds, background, font, etc.) // It should be the last lock in the lock chain @@ -372,7 +377,7 @@ public abstract class LWComponentPeer } @Override - public void dispose() { + public final void dispose() { if (disposed.compareAndSet(false, true)) { disposeImpl(); } @@ -885,7 +890,13 @@ public abstract class LWComponentPeer @Override public boolean requestFocus(Component lightweightChild, boolean temporary, boolean focusedWindowChangeAllowed, long time, - CausedFocusEvent.Cause cause) { + CausedFocusEvent.Cause cause) + { + if (focusLog.isLoggable(PlatformLogger.FINEST)) { + focusLog.finest("lightweightChild=" + lightweightChild + ", temporary=" + temporary + + ", focusedWindowChangeAllowed=" + focusedWindowChangeAllowed + + ", time= " + time + ", cause=" + cause); + } if (LWKeyboardFocusManagerPeer.getInstance(getAppContext()). processSynchronousLightweightTransfer(getTarget(), lightweightChild, temporary, focusedWindowChangeAllowed, time)) { @@ -901,19 +912,44 @@ public abstract class LWComponentPeer case LWKeyboardFocusManagerPeer.SNFH_SUCCESS_PROCEED: Window parentWindow = SunToolkit.getContainingWindow(getTarget()); if (parentWindow == null) { + focusLog.fine("request rejected, parentWindow is null"); LWKeyboardFocusManagerPeer.removeLastFocusRequest(getTarget()); return false; } LWWindowPeer parentPeer = (LWWindowPeer) parentWindow.getPeer(); if (parentPeer == null) { + focusLog.fine("request rejected, parentPeer is null"); LWKeyboardFocusManagerPeer.removeLastFocusRequest(getTarget()); return false; } + // A fix for 7145768. Ensure the parent window is currently natively focused. + // The more evident place to perform this check is in KFM.shouldNativelyFocusHeavyweight, + // however that is the shared code and this particular problem's reproducibility has + // platform specifics. So, it was decided to narrow down the fix to lwawt (OSX) in + // current release. TODO: consider fixing it in the shared code. + if (!focusedWindowChangeAllowed) { + LWWindowPeer decoratedPeer = parentPeer.isSimpleWindow() ? + LWWindowPeer.getOwnerFrameDialog(parentPeer) : parentPeer; + + if (decoratedPeer == null || !decoratedPeer.getPlatformWindow().isActive()) { + if (focusLog.isLoggable(PlatformLogger.FINE)) { + focusLog.fine("request rejected, focusedWindowChangeAllowed==false, " + + "decoratedPeer is inactive: " + decoratedPeer); + } + LWKeyboardFocusManagerPeer.removeLastFocusRequest(getTarget()); + return false; + } + } + boolean res = parentPeer.requestWindowFocus(cause); // If parent window can be made focused and has been made focused (synchronously) // then we can proceed with children, otherwise we retreat if (!res || !parentWindow.isFocused()) { + if (focusLog.isLoggable(PlatformLogger.FINE)) { + focusLog.fine("request rejected, res= " + res + ", parentWindow.isFocused()=" + + parentWindow.isFocused()); + } LWKeyboardFocusManagerPeer.removeLastFocusRequest(getTarget()); return false; } @@ -940,8 +976,8 @@ public abstract class LWComponentPeer @Override public Image createImage(int w, int h) { - // TODO: accelerated image - return getGraphicsConfiguration().createCompatibleImage(w, h); + CGraphicsConfig gc = (CGraphicsConfig)getGraphicsConfiguration(); + return gc.createAcceleratedImage(getTarget(), w, h); } @Override diff --git a/src/macosx/classes/sun/lwawt/LWCursorManager.java b/src/macosx/classes/sun/lwawt/LWCursorManager.java index 1c34353c7b9f136392a324c804419a006887f963..de1b537856a9c6fdca0a5d2a888fb15296209c4a 100644 --- a/src/macosx/classes/sun/lwawt/LWCursorManager.java +++ b/src/macosx/classes/sun/lwawt/LWCursorManager.java @@ -88,20 +88,20 @@ public abstract class LWCursorManager { } else { cursor = (c != null) ? c.getCursor() : null; } - // TODO: default cursor for modal blocked windows setCursor(cursor); } /** * Returns the first visible, enabled and showing component under cursor. + * Returns null for modal blocked windows. * * @param cursorPos Current cursor position. - * @return Component + * @return Component or null. */ private static final Component findComponent(final Point cursorPos) { final LWComponentPeer peer = LWWindowPeer.getPeerUnderCursor(); Component c = null; - if (peer != null) { + if (peer != null && peer.getWindowPeerOrSelf().getBlocker() == null) { c = peer.getTarget(); if (c instanceof Container) { final Point p = peer.getLocationOnScreen(); diff --git a/src/macosx/classes/sun/lwawt/LWTextComponentPeer.java b/src/macosx/classes/sun/lwawt/LWTextComponentPeer.java index 5884b11926173253441995dca041e0147cc17c63..01de62b6c967cdeff819c74c072a8e9c024f9af9 100644 --- a/src/macosx/classes/sun/lwawt/LWTextComponentPeer.java +++ b/src/macosx/classes/sun/lwawt/LWTextComponentPeer.java @@ -81,6 +81,18 @@ abstract class LWTextComponentPeer { +@interface AWTWindow : NSObject { @private JNFWeakJObjectWrapper *javaPlatformWindow; CMenuBar *javaMenuBar; NSSize javaMinSize; NSSize javaMaxSize; jint styleBits; + BOOL isEnabled; } +// An instance of either AWTWindow_Normal or AWTWindow_Panel +@property (nonatomic, retain) NSWindow *nsWindow; + @property (nonatomic, retain) JNFWeakJObjectWrapper *javaPlatformWindow; @property (nonatomic, retain) CMenuBar *javaMenuBar; @property (nonatomic) NSSize javaMinSize; @property (nonatomic) NSSize javaMaxSize; @property (nonatomic) jint styleBits; +@property (nonatomic) BOOL isEnabled; - (id) initWithPlatformWindow:(JNFWeakJObjectWrapper *)javaPlatformWindow styleBits:(jint)styleBits frameRect:(NSRect)frameRect contentView:(NSView *)contentView; -- (void) adjustGrowBoxWindow; - (BOOL) isTopmostWindowUnderMouse; + +// NSWindow overrides delegate methods +- (BOOL) canBecomeKeyWindow; +- (BOOL) canBecomeMainWindow; +- (BOOL) worksWhenModal; +- (void)sendEvent:(NSEvent *)event; + +@end + +@interface AWTWindow_Normal : NSWindow +- (id) initWithDelegate:(AWTWindow *)delegate + frameRect:(NSRect)rect + styleMask:(NSUInteger)styleMask + contentView:(NSView *)view; +@end + +@interface AWTWindow_Panel : NSPanel +- (id) initWithDelegate:(AWTWindow *)delegate + frameRect:(NSRect)rect + styleMask:(NSUInteger)styleMask + contentView:(NSView *)view; @end #endif _AWTWINDOW_H diff --git a/src/macosx/native/sun/awt/AWTWindow.m b/src/macosx/native/sun/awt/AWTWindow.m index 7add839f8e609d849a31b6adf9c49398139a3c6f..5f570a752cc2ed3874793207f646d9b9650cbd28 100644 --- a/src/macosx/native/sun/awt/AWTWindow.m +++ b/src/macosx/native/sun/awt/AWTWindow.m @@ -51,22 +51,76 @@ static JNF_CLASS_CACHE(jc_CPlatformWindow, "sun/lwawt/macosx/CPlatformWindow"); +// -------------------------------------------------------------- +// NSWindow/NSPanel descendants implementation +#define AWT_NS_WINDOW_IMPLEMENTATION \ +- (id) initWithDelegate:(AWTWindow *)delegate \ + frameRect:(NSRect)contectRect \ + styleMask:(NSUInteger)styleMask \ + contentView:(NSView *)view \ +{ \ + self = [super initWithContentRect:contectRect \ + styleMask:styleMask \ + backing:NSBackingStoreBuffered \ + defer:NO]; \ + \ + if (self == nil) return nil; \ + \ + [self setDelegate:delegate]; \ + [self setContentView:view]; \ + [self setInitialFirstResponder:view]; \ + [self setReleasedWhenClosed:NO]; \ + [self setPreservesContentDuringLiveResize:YES]; \ + \ + return self; \ +} \ + \ +/* NSWindow overrides */ \ +- (BOOL) canBecomeKeyWindow { \ + return [(AWTWindow*)[self delegate] canBecomeKeyWindow]; \ +} \ + \ +- (BOOL) canBecomeMainWindow { \ + return [(AWTWindow*)[self delegate] canBecomeMainWindow]; \ +} \ + \ +- (BOOL) worksWhenModal { \ + return [(AWTWindow*)[self delegate] worksWhenModal]; \ +} \ + \ +- (void)sendEvent:(NSEvent *)event { \ + [(AWTWindow*)[self delegate] sendEvent:event]; \ + [super sendEvent:event]; \ +} + +@implementation AWTWindow_Normal +AWT_NS_WINDOW_IMPLEMENTATION +@end +@implementation AWTWindow_Panel +AWT_NS_WINDOW_IMPLEMENTATION +@end +// END of NSWindow/NSPanel descendants implementation +// -------------------------------------------------------------- + + @implementation AWTWindow +@synthesize nsWindow; @synthesize javaPlatformWindow; @synthesize javaMenuBar; @synthesize javaMinSize; @synthesize javaMaxSize; @synthesize styleBits; +@synthesize isEnabled; - (void) updateMinMaxSize:(BOOL)resizable { if (resizable) { - [self setMinSize:self.javaMinSize]; - [self setMaxSize:self.javaMaxSize]; + [self.nsWindow setMinSize:self.javaMinSize]; + [self.nsWindow setMaxSize:self.javaMaxSize]; } else { - NSRect currentFrame = [self frame]; - [self setMinSize:currentFrame.size]; - [self setMaxSize:currentFrame.size]; + NSRect currentFrame = [self.nsWindow frame]; + [self.nsWindow setMinSize:currentFrame.size]; + [self.nsWindow setMaxSize:currentFrame.size]; } } @@ -97,38 +151,38 @@ static JNF_CLASS_CACHE(jc_CPlatformWindow, "sun/lwawt/macosx/CPlatformWindow"); if (IS(mask, RESIZABLE)) { BOOL resizable = IS(bits, RESIZABLE); [self updateMinMaxSize:resizable]; - [self setShowsResizeIndicator:resizable]; + [self.nsWindow setShowsResizeIndicator:resizable]; } if (IS(mask, HAS_SHADOW)) { - [self setHasShadow:IS(bits, HAS_SHADOW)]; + [self.nsWindow setHasShadow:IS(bits, HAS_SHADOW)]; } if (IS(mask, ZOOMABLE)) { - [[self standardWindowButton:NSWindowZoomButton] setEnabled:IS(bits, ZOOMABLE)]; + [[self.nsWindow standardWindowButton:NSWindowZoomButton] setEnabled:IS(bits, ZOOMABLE)]; } if (IS(mask, ALWAYS_ON_TOP)) { - [self setLevel:IS(bits, ALWAYS_ON_TOP) ? NSFloatingWindowLevel : NSNormalWindowLevel]; + [self.nsWindow setLevel:IS(bits, ALWAYS_ON_TOP) ? NSFloatingWindowLevel : NSNormalWindowLevel]; } if (IS(mask, HIDES_ON_DEACTIVATE)) { - [self setHidesOnDeactivate:IS(bits, HIDES_ON_DEACTIVATE)]; + [self.nsWindow setHidesOnDeactivate:IS(bits, HIDES_ON_DEACTIVATE)]; } if (IS(mask, DRAGGABLE_BACKGROUND)) { - [self setMovableByWindowBackground:IS(bits, DRAGGABLE_BACKGROUND)]; + [self.nsWindow setMovableByWindowBackground:IS(bits, DRAGGABLE_BACKGROUND)]; } if (IS(mask, DOCUMENT_MODIFIED)) { - [self setDocumentEdited:IS(bits, DOCUMENT_MODIFIED)]; + [self.nsWindow setDocumentEdited:IS(bits, DOCUMENT_MODIFIED)]; } - if ([self respondsToSelector:@selector(toggleFullScreen:)]) { + if ([self.nsWindow respondsToSelector:@selector(toggleFullScreen:)]) { if (IS(mask, FULLSCREENABLE)) { - [self setCollectionBehavior:(1 << 7) /*NSWindowCollectionBehaviorFullScreenPrimary*/]; + [self.nsWindow setCollectionBehavior:(1 << 7) /*NSWindowCollectionBehaviorFullScreenPrimary*/]; } else { - [self setCollectionBehavior:NSWindowCollectionBehaviorDefault]; + [self.nsWindow setCollectionBehavior:NSWindowCollectionBehaviorDefault]; } } @@ -150,42 +204,55 @@ AWT_ASSERT_APPKIT_THREAD; contentRect.size.height = 1.0; } - self = [super initWithContentRect:contentRect - styleMask:styleMask - backing:NSBackingStoreBuffered - defer:NO]; + self = [super init]; if (self == nil) return nil; // no hope + if (IS(bits, UTILITY) || + IS(bits, NONACTIVATING) || + IS(bits, HUD) || + IS(bits, HIDES_ON_DEACTIVATE)) + { + self.nsWindow = [[AWTWindow_Panel alloc] initWithDelegate:self + frameRect:contentRect + styleMask:styleMask + contentView:view]; + } + else + { + // These windows will appear in the window list in the dock icon menu + self.nsWindow = [[AWTWindow_Normal alloc] initWithDelegate:self + frameRect:contentRect + styleMask:styleMask + contentView:view]; + } + + if (self.nsWindow == nil) return nil; // no hope either + + self.isEnabled = YES; self.javaPlatformWindow = platformWindow; self.styleBits = bits; [self setPropertiesForStyleBits:styleBits mask:MASK(_METHOD_PROP_BITMASK)]; - [self setDelegate:self]; - [self setContentView:view]; - [self setInitialFirstResponder:view]; - [self setReleasedWhenClosed:NO]; - [self setPreservesContentDuringLiveResize:YES]; - return self; } -// checks that this window is under the mouse cursor and this point is not overlapped by others windows +// checks that this window is under the mouse cursor and this point is not overlapped by others windows - (BOOL) isTopmostWindowUnderMouse { - - int currentWinID = [self windowNumber]; - - NSRect screenRect = [[NSScreen mainScreen] frame]; + + int currentWinID = [self.nsWindow windowNumber]; + + NSRect screenRect = [[NSScreen mainScreen] frame]; NSPoint nsMouseLocation = [NSEvent mouseLocation]; - CGPoint cgMouseLocation = CGPointMake(nsMouseLocation.x, screenRect.size.height - nsMouseLocation.y); - + CGPoint cgMouseLocation = CGPointMake(nsMouseLocation.x, screenRect.size.height - nsMouseLocation.y); + NSMutableArray *windows = (NSMutableArray *)CGWindowListCopyWindowInfo(kCGWindowListOptionOnScreenOnly | kCGWindowListExcludeDesktopElements, kCGNullWindowID); - - + + for (NSDictionary *window in windows) { int layer = [[window objectForKey:(id)kCGWindowLayer] intValue]; if (layer == 0) { - int winID = [[window objectForKey:(id)kCGWindowNumber] intValue]; + int winID = [[window objectForKey:(id)kCGWindowNumber] intValue]; CGRect rect; CGRectMakeWithDictionaryRepresentation((CFDictionaryRef)[window objectForKey:(id)kCGWindowBounds], &rect); if (CGRectContainsPoint(rect, cgMouseLocation)) { @@ -199,35 +266,35 @@ AWT_ASSERT_APPKIT_THREAD; } - (void) synthesizeMouseEnteredExitedEvents { - + int eventType = 0; BOOL isUnderMouse = [self isTopmostWindowUnderMouse]; - BOOL mouseIsOver = [[self contentView] mouseIsOver]; - + BOOL mouseIsOver = [[self.nsWindow contentView] mouseIsOver]; + if (isUnderMouse && !mouseIsOver) { eventType = NSMouseEntered; } else if (!isUnderMouse && mouseIsOver) { - eventType = NSMouseExited; + eventType = NSMouseExited; } else { return; } - - NSPoint screenLocation = [NSEvent mouseLocation]; - NSPoint windowLocation = [self convertScreenToBase: screenLocation]; + + NSPoint screenLocation = [NSEvent mouseLocation]; + NSPoint windowLocation = [self.nsWindow convertScreenToBase: screenLocation]; int modifierFlags = (eventType == NSMouseEntered) ? NSMouseEnteredMask : NSMouseExitedMask; - + NSEvent *mouseEvent = [NSEvent enterExitEventWithType: eventType location: windowLocation modifierFlags: modifierFlags timestamp: 0 - windowNumber: [self windowNumber] + windowNumber: [self.nsWindow windowNumber] context: nil eventNumber: 0 trackingNumber: 0 userData: nil ]; - - [[self contentView] deliverJavaMouseEvent: mouseEvent]; + + [[self.nsWindow contentView] deliverJavaMouseEvent: mouseEvent]; } - (void) dealloc { @@ -236,19 +303,20 @@ AWT_ASSERT_APPKIT_THREAD; JNIEnv *env = [ThreadUtilities getJNIEnv]; [self.javaPlatformWindow setJObject:nil withEnv:env]; + self.nsWindow = nil; + [super dealloc]; } - // NSWindow overrides - (BOOL) canBecomeKeyWindow { AWT_ASSERT_APPKIT_THREAD; - return IS(self.styleBits, SHOULD_BECOME_KEY); + return self.isEnabled && IS(self.styleBits, SHOULD_BECOME_KEY); } - (BOOL) canBecomeMainWindow { AWT_ASSERT_APPKIT_THREAD; - return IS(self.styleBits, SHOULD_BECOME_MAIN); + return self.isEnabled && IS(self.styleBits, SHOULD_BECOME_MAIN); } - (BOOL) worksWhenModal { @@ -270,7 +338,7 @@ AWT_ASSERT_APPKIT_THREAD; if (awtWindow != NULL) { // translate the point into Java coordinates NSPoint loc = [event locationInWindow]; - loc.y = [self frame].size.height - loc.y; + loc.y = [self.nsWindow frame].size.height - loc.y; // send up to the GestureHandler to recursively dispatch on the AWT event thread static JNF_CLASS_CACHE(jc_GestureHandler, "com/apple/eawt/event/GestureHandler"); @@ -333,7 +401,7 @@ AWT_ASSERT_APPKIT_THREAD; // TODO: create generic AWT assert } - NSRect frame = ConvertNSScreenRect(env, [self frame]); + NSRect frame = ConvertNSScreenRect(env, [self.nsWindow frame]); static JNF_MEMBER_CACHE(jm_deliverMoveResizeEvent, jc_CPlatformWindow, "deliverMoveResizeEvent", "(IIII)V"); JNFCallVoidMethod(env, platformWindow, jm_deliverMoveResizeEvent, @@ -523,8 +591,8 @@ AWT_ASSERT_APPKIT_THREAD; if ([event type] == NSLeftMouseDown || [event type] == NSRightMouseDown || [event type] == NSOtherMouseDown) { NSPoint p = [NSEvent mouseLocation]; - NSRect frame = [self frame]; - NSRect contentRect = [self contentRectForFrameRect:frame]; + NSRect frame = [self.nsWindow frame]; + NSRect contentRect = [self.nsWindow contentRectForFrameRect:frame]; // Check if the click happened in the non-client area (title bar) if (p.y >= (frame.origin.y + contentRect.size.height)) { @@ -535,15 +603,14 @@ AWT_ASSERT_APPKIT_THREAD; JNFCallVoidMethod(env, platformWindow, jm_deliverNCMouseDown); } } - [super sendEvent:event]; } - (void)constrainSize:(NSSize*)size { float minWidth = 0.f, minHeight = 0.f; if (IS(self.styleBits, DECORATED)) { - NSRect frame = [self frame]; - NSRect contentRect = [NSWindow contentRectForFrameRect:frame styleMask:[self styleMask]]; + NSRect frame = [self.nsWindow frame]; + NSRect contentRect = [NSWindow contentRectForFrameRect:frame styleMask:[self.nsWindow styleMask]]; float top = frame.size.height - contentRect.size.height; float left = contentRect.origin.x - frame.origin.x; @@ -562,6 +629,27 @@ AWT_ASSERT_APPKIT_THREAD; size->height = MAX(size->height, minHeight); } +- (void) setEnabled: (BOOL)flag { + self.isEnabled = flag; + + if (IS(self.styleBits, CLOSEABLE)) { + [[self.nsWindow standardWindowButton:NSWindowCloseButton] setEnabled: flag]; + } + + if (IS(self.styleBits, MINIMIZABLE)) { + [[self.nsWindow standardWindowButton:NSWindowMiniaturizeButton] setEnabled: flag]; + } + + if (IS(self.styleBits, ZOOMABLE)) { + [[self.nsWindow standardWindowButton:NSWindowZoomButton] setEnabled: flag]; + } + + if (IS(self.styleBits, RESIZABLE)) { + [self updateMinMaxSize:flag]; + [self.nsWindow setShowsResizeIndicator:flag]; + } +} + @end // AWTWindow @@ -596,7 +684,7 @@ AWT_ASSERT_NOT_APPKIT_THREAD; JNF_COCOA_EXIT(env); - return ptr_to_jlong(window); + return ptr_to_jlong(window ? window.nsWindow : nil); } /* @@ -610,17 +698,19 @@ JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeSetNSWindowSt JNF_COCOA_ENTER(env); AWT_ASSERT_NOT_APPKIT_THREAD; - AWTWindow *window = OBJC(windowPtr); + NSWindow *nsWindow = OBJC(windowPtr); [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ AWT_ASSERT_APPKIT_THREAD; + AWTWindow *window = (AWTWindow*)[nsWindow delegate]; + // scans the bit field, and only updates the values requested by the mask // (this implicity handles the _CALLBACK_PROP_BITMASK case, since those are passive reads) jint newBits = window.styleBits & ~mask | bits & mask; // resets the NSWindow's style mask if the mask intersects any of those bits if (mask & MASK(_STYLE_PROP_BITMASK)) { - [window setStyleMask:[AWTWindow styleMaskForStyleBits:newBits]]; + [nsWindow setStyleMask:[AWTWindow styleMaskForStyleBits:newBits]]; } // calls methods on NSWindow to change other properties, based on the mask @@ -645,12 +735,14 @@ JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeSetNSWindowMe JNF_COCOA_ENTER(env); AWT_ASSERT_NOT_APPKIT_THREAD; - AWTWindow *window = OBJC(windowPtr); + NSWindow *nsWindow = OBJC(windowPtr); CMenuBar *menuBar = OBJC(menuBarPtr); [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ AWT_ASSERT_APPKIT_THREAD; - if ([window isKeyWindow]) [window.javaMenuBar deactivate]; + AWTWindow *window = (AWTWindow*)[nsWindow delegate]; + + if ([nsWindow isKeyWindow]) [window.javaMenuBar deactivate]; window.javaMenuBar = menuBar; // if ([self isKeyWindow]) { @@ -674,15 +766,15 @@ JNIEXPORT jobject JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeGetNSWindo JNF_COCOA_ENTER(env); AWT_ASSERT_NOT_APPKIT_THREAD; - AWTWindow *window = OBJC(windowPtr); + NSWindow *nsWindow = OBJC(windowPtr); __block NSRect contentRect = NSZeroRect; __block NSRect frame = NSZeroRect; [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){ AWT_ASSERT_APPKIT_THREAD; - frame = [window frame]; - contentRect = [NSWindow contentRectForFrameRect:frame styleMask:[window styleMask]]; + frame = [nsWindow frame]; + contentRect = [NSWindow contentRectForFrameRect:frame styleMask:[nsWindow styleMask]]; }]; jint top = (jint)(frame.size.height - contentRect.size.height); @@ -712,24 +804,26 @@ AWT_ASSERT_NOT_APPKIT_THREAD; NSRect jrect = NSMakeRect(originX, originY, width, height); // TODO: not sure we need displayIfNeeded message in our view - AWTWindow *window = OBJC(windowPtr); + NSWindow *nsWindow = OBJC(windowPtr); [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ AWT_ASSERT_APPKIT_THREAD; + AWTWindow *window = (AWTWindow*)[nsWindow delegate]; + NSRect rect = ConvertNSScreenRect(NULL, jrect); [window constrainSize:&rect.size]; - [window setFrame:rect display:YES]; + [nsWindow setFrame:rect display:YES]; // only start tracking events if pointer is above the toplevel // TODO: should post an Entered event if YES. NSPoint mLocation = [NSEvent mouseLocation]; - [window setAcceptsMouseMovedEvents:NSPointInRect(mLocation, rect)]; + [nsWindow setAcceptsMouseMovedEvents:NSPointInRect(mLocation, rect)]; // ensure we repaint the whole window after the resize operation // (this will also re-enable screen updates, which were disabled above) // TODO: send PaintEvent - + [window synthesizeMouseEnteredExitedEvents]; }]; @@ -752,10 +846,12 @@ AWT_ASSERT_NOT_APPKIT_THREAD; if (maxW < 1) maxW = 1; if (maxH < 1) maxH = 1; - AWTWindow *window = OBJC(windowPtr); + NSWindow *nsWindow = OBJC(windowPtr); [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ AWT_ASSERT_APPKIT_THREAD; + AWTWindow *window = (AWTWindow*)[nsWindow delegate]; + NSSize min = { minW, minH }; NSSize max = { maxW, maxH }; @@ -781,11 +877,11 @@ JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativePushNSWindowT JNF_COCOA_ENTER(env); AWT_ASSERT_NOT_APPKIT_THREAD; - AWTWindow *window = OBJC(windowPtr); + NSWindow *nsWindow = OBJC(windowPtr); [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ AWT_ASSERT_APPKIT_THREAD; - [window orderBack:nil]; + [nsWindow orderBack:nil]; }]; JNF_COCOA_EXIT(env); @@ -802,14 +898,14 @@ JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativePushNSWindowT JNF_COCOA_ENTER(env); AWT_ASSERT_NOT_APPKIT_THREAD; - AWTWindow *window = OBJC(windowPtr); + NSWindow *nsWindow = OBJC(windowPtr); [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ AWT_ASSERT_APPKIT_THREAD; - if (![window isKeyWindow]) { - [window makeKeyAndOrderFront:window]; + if (![nsWindow isKeyWindow]) { + [nsWindow makeKeyAndOrderFront:nsWindow]; } else { - [window orderFront:window]; + [nsWindow orderFront:nsWindow]; } }]; @@ -827,8 +923,8 @@ JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeSetNSWindowTi JNF_COCOA_ENTER(env); AWT_ASSERT_NOT_APPKIT_THREAD; - AWTWindow *window = OBJC(windowPtr); - [window performSelectorOnMainThread:@selector(setTitle:) + NSWindow *nsWindow = OBJC(windowPtr); + [nsWindow performSelectorOnMainThread:@selector(setTitle:) withObject:JNFJavaToNSString(env, jtitle) waitUntilDone:NO]; @@ -846,11 +942,11 @@ JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeSetNSWindowAl JNF_COCOA_ENTER(env); AWT_ASSERT_NOT_APPKIT_THREAD; - AWTWindow *window = OBJC(windowPtr); + NSWindow *nsWindow = OBJC(windowPtr); [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ AWT_ASSERT_APPKIT_THREAD; - [window setAlphaValue:alpha]; + [nsWindow setAlphaValue:alpha]; }]; JNF_COCOA_EXIT(env); @@ -867,11 +963,11 @@ JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeRevalidateNSW JNF_COCOA_ENTER(env); AWT_ASSERT_NOT_APPKIT_THREAD; - AWTWindow *window = OBJC(windowPtr); + NSWindow *nsWindow = OBJC(windowPtr); [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ AWT_ASSERT_APPKIT_THREAD; - [window invalidateShadow]; + [nsWindow invalidateShadow]; }]; JNF_COCOA_EXIT(env); @@ -890,8 +986,8 @@ JNIEXPORT jint JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeScreenOn_1App JNF_COCOA_ENTER(env); AWT_ASSERT_APPKIT_THREAD; - AWTWindow *window = OBJC(windowPtr); - NSDictionary *props = [[window screen] deviceDescription]; + NSWindow *nsWindow = OBJC(windowPtr); + NSDictionary *props = [[nsWindow screen] deviceDescription]; ret = [[props objectForKey:@"NSScreenNumber"] intValue]; JNF_COCOA_EXIT(env); @@ -910,12 +1006,12 @@ JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeSetNSWindowMi JNF_COCOA_ENTER(env); AWT_ASSERT_NOT_APPKIT_THREAD; - AWTWindow *window = OBJC(windowPtr); + NSWindow *nsWindow = OBJC(windowPtr); NSImage *image = OBJC(nsImagePtr); [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ AWT_ASSERT_APPKIT_THREAD; - [window setMiniwindowImage:image]; + [nsWindow setMiniwindowImage:image]; }]; JNF_COCOA_EXIT(env); @@ -932,12 +1028,12 @@ JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeSetNSWindowRe JNF_COCOA_ENTER(env); AWT_ASSERT_NOT_APPKIT_THREAD; - AWTWindow *window = OBJC(windowPtr); + NSWindow *nsWindow = OBJC(windowPtr); NSURL *url = (filename == NULL) ? nil : [NSURL fileURLWithPath:JNFNormalizedNSStringForPath(env, filename)]; [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ AWT_ASSERT_APPKIT_THREAD; - [window setRepresentedURL:url]; + [nsWindow setRepresentedURL:url]; }]; JNF_COCOA_EXIT(env); @@ -969,14 +1065,16 @@ JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeSynthesizeMou { JNF_COCOA_ENTER(env); AWT_ASSERT_NOT_APPKIT_THREAD; - - AWTWindow *window = OBJC(windowPtr); + + NSWindow *nsWindow = OBJC(windowPtr); [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ AWT_ASSERT_APPKIT_THREAD; - + + AWTWindow *window = (AWTWindow*)[nsWindow delegate]; + [window synthesizeMouseEnteredExitedEvents]; }]; - + JNF_COCOA_EXIT(env); } @@ -993,8 +1091,8 @@ JNIEXPORT jint JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeGetScreenNSWi JNF_COCOA_ENTER(env); AWT_ASSERT_APPKIT_THREAD; - AWTWindow *window = OBJC(windowPtr); - NSScreen* screen = [window screen]; + NSWindow *nsWindow = OBJC(windowPtr); + NSScreen* screen = [nsWindow screen]; //+++gdb NOTE: This is using a linear search of the screens. If it should // prove to be a bottleneck, this can definitely be improved. However, @@ -1025,12 +1123,12 @@ JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow__1toggleFullScreenM { JNF_COCOA_ENTER(env); - AWTWindow *window = OBJC(windowPtr); + NSWindow *nsWindow = OBJC(windowPtr); SEL toggleFullScreenSelector = @selector(toggleFullScreen:); - if (![window respondsToSelector:toggleFullScreenSelector]) return; + if (![nsWindow respondsToSelector:toggleFullScreenSelector]) return; [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ - [window performSelector:toggleFullScreenSelector withObject:nil]; + [nsWindow performSelector:toggleFullScreenSelector withObject:nil]; }]; JNF_COCOA_EXIT(env); @@ -1044,15 +1142,31 @@ JNIEXPORT jboolean JNICALL Java_sun_lwawt_macosx_CMouseInfoPeer_nativeIsWindowUn JNF_COCOA_ENTER(env); AWT_ASSERT_NOT_APPKIT_THREAD; - AWTWindow *aWindow = OBJC(windowPtr); + NSWindow *nsWindow = OBJC(windowPtr); [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^() { AWT_ASSERT_APPKIT_THREAD; - NSPoint pt = [aWindow mouseLocationOutsideOfEventStream]; - underMouse = [[aWindow contentView] hitTest:pt] != nil; + NSPoint pt = [nsWindow mouseLocationOutsideOfEventStream]; + underMouse = [[nsWindow contentView] hitTest:pt] != nil; }]; JNF_COCOA_EXIT(env); return underMouse; } + +JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeSetEnabled +(JNIEnv *env, jclass clazz, jlong windowPtr, jboolean isEnabled) +{ +JNF_COCOA_ENTER(env); + + NSWindow *nsWindow = OBJC(windowPtr); + [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ + AWTWindow *window = (AWTWindow*)[nsWindow delegate]; + + [window setEnabled: isEnabled]; + }]; + +JNF_COCOA_EXIT(env); +} + diff --git a/src/macosx/native/sun/awt/CFileDialog.h b/src/macosx/native/sun/awt/CFileDialog.h index c90158992178ead7218540952d2441bf3a6cc980..14ed63d24bf51d7bc8bcaddfb69202bb77b199ca 100644 --- a/src/macosx/native/sun/awt/CFileDialog.h +++ b/src/macosx/native/sun/awt/CFileDialog.h @@ -46,11 +46,14 @@ // File dialog's mode jint fMode; + // Indicates whether the user can select multiple files + BOOL fMultipleMode; + // Should we navigate into apps? BOOL fNavigateApps; - // panel's filename - NSString *fReturnedFilename; + // Contains the absolute paths of the selected files as URLs + NSArray *fURLs; } // Allocator @@ -60,6 +63,7 @@ directory:(NSString *)inPath file:(NSString *)inFile mode:(jint)inMode + multipleMode:(BOOL)inMultipleMode shouldNavigate:(BOOL)inNavigateApps withEnv:(JNIEnv*)env; @@ -69,7 +73,7 @@ // Get dialog return value - (BOOL) userClickedOK; -// Filename user chose -- (NSString *) filename; +// Returns the absolute paths of the selected files as URLs +- (NSArray *) URLs; @end diff --git a/src/macosx/native/sun/awt/CFileDialog.m b/src/macosx/native/sun/awt/CFileDialog.m index 129ffd940b5742546b4b9dd0ef7ab74182b2a341..283cc8cb781945bca546c320bd7d5dcb8bcfcd3a 100644 --- a/src/macosx/native/sun/awt/CFileDialog.m +++ b/src/macosx/native/sun/awt/CFileDialog.m @@ -41,6 +41,7 @@ directory:(NSString *)inPath file:(NSString *)inFile mode:(jint)inMode + multipleMode:(BOOL)inMultipleMode shouldNavigate:(BOOL)inNavigateApps withEnv:(JNIEnv*)env; { @@ -54,6 +55,7 @@ fTitle = inTitle; [fTitle retain]; fMode = inMode; + fMultipleMode = inMultipleMode; fNavigateApps = inNavigateApps; fPanelResult = NSCancelButton; } @@ -79,8 +81,8 @@ [fTitle release]; fTitle = nil; - [fReturnedFilename release]; - fReturnedFilename = nil; + [fURLs release]; + fURLs = nil; [super dealloc]; } @@ -105,7 +107,7 @@ if (fMode == java_awt_FileDialog_LOAD) { NSOpenPanel *openPanel = (NSOpenPanel *)thePanel; - [openPanel setAllowsMultipleSelection:NO]; + [openPanel setAllowsMultipleSelection:fMultipleMode]; [openPanel setCanChooseFiles:YES]; [openPanel setCanChooseDirectories:NO]; [openPanel setCanCreateDirectories:YES]; @@ -114,8 +116,16 @@ [thePanel setDelegate:self]; fPanelResult = [thePanel runModalForDirectory:fDirectory file:fFile]; [thePanel setDelegate:nil]; - fReturnedFilename = [thePanel filename]; - [fReturnedFilename retain]; + + if ([self userClickedOK]) { + if (fMode == java_awt_FileDialog_LOAD) { + NSOpenPanel *openPanel = (NSOpenPanel *)thePanel; + fURLs = [openPanel URLs]; + } else { + fURLs = [NSArray arrayWithObject:[thePanel URL]]; + } + [fURLs retain]; + } } [self disposer]; @@ -158,8 +168,8 @@ return fPanelResult == NSOKButton; } -- (NSString *)filename { - return [[fReturnedFilename retain] autorelease]; +- (NSArray *)URLs { + return [[fURLs retain] autorelease]; } @end @@ -167,13 +177,14 @@ * Class: sun_lwawt_macosx_CFileDialog * Method: nativeRunFileDialog * Signature: (Ljava/lang/String;ILjava/io/FilenameFilter; - * Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; + * Ljava/lang/String;Ljava/lang/String;)[Ljava/lang/String; */ -JNIEXPORT jstring JNICALL +JNIEXPORT jobjectArray JNICALL Java_sun_lwawt_macosx_CFileDialog_nativeRunFileDialog -(JNIEnv *env, jobject peer, jstring title, jint mode, jboolean navigateApps, jboolean hasFilter, jstring directory, jstring file) +(JNIEnv *env, jobject peer, jstring title, jint mode, jboolean multipleMode, + jboolean navigateApps, jboolean hasFilter, jstring directory, jstring file) { - jstring returnValue = NULL; + jobjectArray returnValue = NULL; JNF_COCOA_ENTER(env); NSString *dialogTitle = JNFJavaToNSString(env, title); @@ -187,6 +198,7 @@ JNF_COCOA_ENTER(env); directory:JNFJavaToNSString(env, directory) file:JNFJavaToNSString(env, file) mode:mode + multipleMode:multipleMode shouldNavigate:navigateApps withEnv:env]; @@ -196,8 +208,18 @@ JNF_COCOA_ENTER(env); waitUntilDone:YES]; if ([dialogDelegate userClickedOK]) { - NSString *filename = [dialogDelegate filename]; - returnValue = JNFNSToJavaString(env, filename); + NSArray *urls = [dialogDelegate URLs]; + jsize count = [urls count]; + + jclass stringClass = (*env)->FindClass(env, "java/lang/String"); + returnValue = (*env)->NewObjectArray(env, count, stringClass, NULL); + (*env)->DeleteLocalRef(env, stringClass); + + [urls enumerateObjectsUsingBlock:^(id url, NSUInteger index, BOOL *stop) { + jstring filename = JNFNormalizedJavaStringForPath(env, [url path]); + (*env)->SetObjectArrayElement(env, returnValue, index, filename); + (*env)->DeleteLocalRef(env, filename); + }]; } [dialogDelegate release]; diff --git a/src/macosx/native/sun/awt/CImage.m b/src/macosx/native/sun/awt/CImage.m index 64a6f3c4ec15612fffa3ac73b56d474a31a650dc..330e9943f62e027e47e5541373c31f7153f022cd 100644 --- a/src/macosx/native/sun/awt/CImage.m +++ b/src/macosx/native/sun/awt/CImage.m @@ -163,7 +163,6 @@ AWT_ASSERT_ANY_THREAD; if ([reps count]) { NSImage *nsImage = [[NSImage alloc] initWithSize:NSMakeSize(0, 0)]; [nsImage addRepresentations: reps]; - [reps release]; if (nsImage != nil) { CFRetain(nsImage); // GC diff --git a/src/macosx/native/sun/awt/LWCToolkit.m b/src/macosx/native/sun/awt/LWCToolkit.m index 8a95cd38d3de78b72143d765a652731ab6af3306..173154a151c38f0d9113aa3c64e37116561a6aa7 100644 --- a/src/macosx/native/sun/awt/LWCToolkit.m +++ b/src/macosx/native/sun/awt/LWCToolkit.m @@ -42,6 +42,7 @@ jint* gButtonDownMasks; @implementation AWTToolkit static long eventCount; +static bool shouldKeepRunningNestedLoop = NO; + (long) getEventCount{ return eventCount; @@ -456,3 +457,36 @@ Java_sun_font_FontManager_populateFontFileNameMap { } + +/* + * Class: sun_lwawt_macosx_LWCToolkit + * Method: startNativeNestedEventLoop + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_sun_lwawt_macosx_LWCToolkit_startNativeNestedEventLoop +(JNIEnv *env, jclass cls) +{ + if(!shouldKeepRunningNestedLoop) { + NSRunLoop *theRL = [NSRunLoop currentRunLoop]; + NSApplication * app = [NSApplication sharedApplication]; + shouldKeepRunningNestedLoop = YES; + while (shouldKeepRunningNestedLoop && [theRL runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]]) + { + NSEvent * event = [app nextEventMatchingMask: 0xFFFFFFFF untilDate:nil inMode:NSDefaultRunLoopMode dequeue:YES]; + if (event != nil) { + [app sendEvent: event]; + } + } + } +} + +/* + * Class: sun_lwawt_macosx_LWCToolkit + * Method: stopNativeNestedEventLoop + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_sun_lwawt_macosx_LWCToolkit_stopNativeNestedEventLoop +(JNIEnv *env, jclass cls) +{ + shouldKeepRunningNestedLoop = NO; +} diff --git a/src/macosx/native/sun/java2d/opengl/CGLSurfaceData.m b/src/macosx/native/sun/java2d/opengl/CGLSurfaceData.m index 34ba33c496a40020c3d8ee2ea762ae23bf949ef9..cc8de1aa8ec7b276a6cc98ea0d21db73c86c2188 100644 --- a/src/macosx/native/sun/java2d/opengl/CGLSurfaceData.m +++ b/src/macosx/native/sun/java2d/opengl/CGLSurfaceData.m @@ -204,7 +204,8 @@ JNF_COCOA_ENTER(env); if (!CGLSD_MakeCurrentToScratch(env, oglc)) { return NULL; } - } else if ([NSOpenGLContext currentContext] == nil) { + // make sure our context is current + } else if ([NSOpenGLContext currentContext] != ctxinfo->context) { [ctxinfo->context makeCurrentContext]; } diff --git a/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif.properties b/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif.properties index d3fee304abe61f5c9d4298c9ae57eea65b0098c5..fed806c17dd91194251a6ec855f986d7281ed8d1 100644 --- a/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif.properties +++ b/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif.properties @@ -18,28 +18,23 @@ ############ FILE CHOOSER STRINGS ############# -FileChooser.acceptAllFileFilterText=* -FileChooser.cancelButtonText=Cancel -FileChooser.saveButtonText=Save -FileChooser.openButtonText=OK -FileChooser.saveDialogTitleText=Save -FileChooser.openDialogTitleText=Open -FileChooser.updateButtonText=Update -FileChooser.helpButtonText=Help -FileChooser.pathLabelText=Enter path or folder name: -FileChooser.pathLabelMnemonic=80 -FileChooser.filterLabelText=Filter -FileChooser.filterLabelMnemonic=82 -FileChooser.foldersLabelText=Folders -FileChooser.foldersLabelMnemonic=76 -FileChooser.filesLabelText=Files -FileChooser.filesLabelMnemonic=73 -FileChooser.enterFileNameLabelText=Enter file name: -FileChooser.enterFileNameLabelMnemonic=78 -FileChooser.enterFolderNameLabelText=Enter folder name: +FileChooser.acceptAllFileFilter.textAndMnemonic=* +FileChooser.cancelButton.textAndMnemonic=Cancel +FileChooser.saveButton.textAndMnemonic=Save +FileChooser.openButton.textAndMnemonic=OK +FileChooser.saveDialogTitle.textAndMnemonic=Save +FileChooser.openDialogTitle.textAndMnemonic=Open +FileChooser.updateButton.textAndMnemonic=Update +FileChooser.helpButton.textAndMnemonic=Help +FileChooser.pathLabel.textAndMnemonic=Enter &path or folder name: +FileChooser.filterLabel.textAndMnemonic=Filte&r +FileChooser.foldersLabel.textAndMnemonic=Fo&lders +FileChooser.filesLabel.textAndMnemonic=F&iles +FileChooser.enterFileNameLabel.textAndMnemonic=E&nter file name: +FileChooser.enterFolderNameLabel.textAndMnemonic=Enter folder name: -FileChooser.cancelButtonToolTipText=Abort file chooser dialog. -FileChooser.saveButtonToolTipText=Save selected file. -FileChooser.openButtonToolTipText=Open selected file. -FileChooser.updateButtonToolTipText=Update directory listing. -FileChooser.helpButtonToolTipText=FileChooser help. +FileChooser.cancelButtonToolTip.textAndMnemonic=Abort file chooser dialog. +FileChooser.saveButtonToolTip.textAndMnemonic=Save selected file. +FileChooser.openButtonToolTip.textAndMnemonic=Open selected file. +FileChooser.updateButtonToolTip.textAndMnemonic=Update directory listing. +FileChooser.helpButtonToolTip.textAndMnemonic=FileChooser help. diff --git a/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_de.properties b/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_de.properties index e7723574a6d93478185ad1d59962125a9adc46c2..1d2cc250ed34b328ea0625ba610365c8ec70b07d 100644 --- a/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_de.properties +++ b/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_de.properties @@ -18,28 +18,23 @@ ############ FILE CHOOSER STRINGS ############# -FileChooser.acceptAllFileFilterText=* -FileChooser.cancelButtonText=Abbrechen -FileChooser.saveButtonText=Speichern -FileChooser.openButtonText=OK -FileChooser.saveDialogTitleText=Speichern -FileChooser.openDialogTitleText=\u00D6ffnen -FileChooser.updateButtonText=Aktualisieren -FileChooser.helpButtonText=Hilfe -FileChooser.pathLabelText=Pfad- oder Ordnernamen eingeben: -FileChooser.pathLabelMnemonic=80 -FileChooser.filterLabelText=Filter -FileChooser.filterLabelMnemonic=82 -FileChooser.foldersLabelText=Ordner -FileChooser.foldersLabelMnemonic=76 -FileChooser.filesLabelText=Dateien -FileChooser.filesLabelMnemonic=73 -FileChooser.enterFileNameLabelText=Dateinamen eingeben: -FileChooser.enterFileNameLabelMnemonic=78 -FileChooser.enterFolderNameLabelText=Ordnernamen eingeben: +FileChooser.acceptAllFileFilter.textAndMnemonic=* +FileChooser.cancelButton.textAndMnemonic=Abbrechen +FileChooser.saveButton.textAndMnemonic=Speichern +FileChooser.openButton.textAndMnemonic=OK +FileChooser.saveDialogTitle.textAndMnemonic=Speichern +FileChooser.openDialogTitle.textAndMnemonic=\u00D6ffnen +FileChooser.updateButton.textAndMnemonic=Aktualisieren +FileChooser.helpButton.textAndMnemonic=Hilfe +FileChooser.pathLabel.textAndMnemonic=&Pfad- oder Ordnernamen eingeben: +FileChooser.filterLabel.textAndMnemonic=Filte&r +FileChooser.foldersLabel.textAndMnemonic=Ordner(&L) +FileChooser.filesLabel.textAndMnemonic=Date&ien +FileChooser.enterFileNameLabel.textAndMnemonic=Datei&namen eingeben: +FileChooser.enterFolderNameLabel.textAndMnemonic=Ordnernamen eingeben: -FileChooser.cancelButtonToolTipText=Dialogfeld f\u00FCr Dateiauswahl schlie\u00DFen. -FileChooser.saveButtonToolTipText=Ausgew\u00E4hlte Datei speichern. -FileChooser.openButtonToolTipText=Ausgew\u00E4hlte Datei \u00F6ffnen. -FileChooser.updateButtonToolTipText=Verzeichnisliste aktualisieren. -FileChooser.helpButtonToolTipText=FileChooser-Hilfe. +FileChooser.cancelButtonToolTip.textAndMnemonic=Dialogfeld f\u00FCr Dateiauswahl schlie\u00DFen. +FileChooser.saveButtonToolTip.textAndMnemonic=Ausgew\u00E4hlte Datei speichern. +FileChooser.openButtonToolTip.textAndMnemonic=Ausgew\u00E4hlte Datei \u00F6ffnen. +FileChooser.updateButtonToolTip.textAndMnemonic=Verzeichnisliste aktualisieren. +FileChooser.helpButtonToolTip.textAndMnemonic=FileChooser-Hilfe. diff --git a/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_es.properties b/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_es.properties index 6d9aa8f16bacf6ab6d85a3d818af877a2210688c..2add8f218bb5070d95692c68aa6039da2c83eeb7 100644 --- a/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_es.properties +++ b/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_es.properties @@ -18,28 +18,23 @@ ############ FILE CHOOSER STRINGS ############# -FileChooser.acceptAllFileFilterText=* -FileChooser.cancelButtonText=Cancelar -FileChooser.saveButtonText=Guardar -FileChooser.openButtonText=Aceptar -FileChooser.saveDialogTitleText=Guardar -FileChooser.openDialogTitleText=Abrir -FileChooser.updateButtonText=Actualizar -FileChooser.helpButtonText=Ayuda -FileChooser.pathLabelText=Introducir nombre de la ruta de acceso o carpeta: -FileChooser.pathLabelMnemonic=80 -FileChooser.filterLabelText=Filtro -FileChooser.filterLabelMnemonic=82 -FileChooser.foldersLabelText=Carpetas -FileChooser.foldersLabelMnemonic=76 -FileChooser.filesLabelText=Archivos -FileChooser.filesLabelMnemonic=73 -FileChooser.enterFileNameLabelText=Introducir nombre de archivo: -FileChooser.enterFileNameLabelMnemonic=78 -FileChooser.enterFolderNameLabelText=Introducir nombre de carpeta: +FileChooser.acceptAllFileFilter.textAndMnemonic=* +FileChooser.cancelButton.textAndMnemonic=Cancelar +FileChooser.saveButton.textAndMnemonic=Guardar +FileChooser.openButton.textAndMnemonic=Aceptar +FileChooser.saveDialogTitle.textAndMnemonic=Guardar +FileChooser.openDialogTitle.textAndMnemonic=Abrir +FileChooser.updateButton.textAndMnemonic=Actualizar +FileChooser.helpButton.textAndMnemonic=Ayuda +FileChooser.pathLabel.textAndMnemonic=Introducir nombre de la ruta de acceso o car&peta: +FileChooser.filterLabel.textAndMnemonic=Filt&ro +FileChooser.foldersLabel.textAndMnemonic=Carpetas(&L) +FileChooser.filesLabel.textAndMnemonic=Arch&ivos +FileChooser.enterFileNameLabel.textAndMnemonic=I&ntroducir nombre de archivo: +FileChooser.enterFolderNameLabel.textAndMnemonic=Introducir nombre de carpeta: -FileChooser.cancelButtonToolTipText=Abortar cuadro de di\u00E1logo del selector de archivos. -FileChooser.saveButtonToolTipText=Guardar archivo seleccionado. -FileChooser.openButtonToolTipText=Abrir archivo seleccionado. -FileChooser.updateButtonToolTipText=Actualizar lista de directorios. -FileChooser.helpButtonToolTipText=Ayuda del selector de archivos. +FileChooser.cancelButtonToolTip.textAndMnemonic=Abortar cuadro de di\u00E1logo del selector de archivos. +FileChooser.saveButtonToolTip.textAndMnemonic=Guardar archivo seleccionado. +FileChooser.openButtonToolTip.textAndMnemonic=Abrir archivo seleccionado. +FileChooser.updateButtonToolTip.textAndMnemonic=Actualizar lista de directorios. +FileChooser.helpButtonToolTip.textAndMnemonic=Ayuda del selector de archivos. diff --git a/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_fr.properties b/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_fr.properties index 392ecee5bd29c6e5c85b40934ffe1122e611e493..2d9f97885dd0cdf45c329d6e8652e6f6aba49472 100644 --- a/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_fr.properties +++ b/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_fr.properties @@ -18,28 +18,23 @@ ############ FILE CHOOSER STRINGS ############# -FileChooser.acceptAllFileFilterText=* -FileChooser.cancelButtonText=Annuler -FileChooser.saveButtonText=Enregistrer -FileChooser.openButtonText=OK -FileChooser.saveDialogTitleText=Enregistrer -FileChooser.openDialogTitleText=Ouvrir -FileChooser.updateButtonText=Mettre \u00E0 jour -FileChooser.helpButtonText=Aide -FileChooser.pathLabelText=Entrez le chemin ou le nom du dossier : -FileChooser.pathLabelMnemonic=80 -FileChooser.filterLabelText=Filtre -FileChooser.filterLabelMnemonic=82 -FileChooser.foldersLabelText=Dossiers -FileChooser.foldersLabelMnemonic=76 -FileChooser.filesLabelText=Fichiers -FileChooser.filesLabelMnemonic=73 -FileChooser.enterFileNameLabelText=Entrez le nom du fichier : -FileChooser.enterFileNameLabelMnemonic=78 -FileChooser.enterFolderNameLabelText=Entrez le nom du dossier : +FileChooser.acceptAllFileFilter.textAndMnemonic=* +FileChooser.cancelButton.textAndMnemonic=Annuler +FileChooser.saveButton.textAndMnemonic=Enregistrer +FileChooser.openButton.textAndMnemonic=OK +FileChooser.saveDialogTitle.textAndMnemonic=Enregistrer +FileChooser.openDialogTitle.textAndMnemonic=Ouvrir +FileChooser.updateButton.textAndMnemonic=Mettre \u00E0 jour +FileChooser.helpButton.textAndMnemonic=Aide +FileChooser.pathLabel.textAndMnemonic=Entrez le chemin ou le nom du dossier (&P): +FileChooser.filterLabel.textAndMnemonic=Filt&re +FileChooser.foldersLabel.textAndMnemonic=Dossiers(&L) +FileChooser.filesLabel.textAndMnemonic=F&ichiers +FileChooser.enterFileNameLabel.textAndMnemonic=E&ntrez le nom du fichier : +FileChooser.enterFolderNameLabel.textAndMnemonic=Entrez le nom du dossier : -FileChooser.cancelButtonToolTipText=Ferme la bo\u00EEte de dialogue du s\u00E9lecteur de fichiers. -FileChooser.saveButtonToolTipText=Enregistre le fichier s\u00E9lectionn\u00E9. -FileChooser.openButtonToolTipText=Ouvre le fichier s\u00E9lectionn\u00E9. -FileChooser.updateButtonToolTipText=Met \u00E0 jour la liste des r\u00E9pertoires. -FileChooser.helpButtonToolTipText=Aide du s\u00E9lecteur de fichiers +FileChooser.cancelButtonToolTip.textAndMnemonic=Ferme la bo\u00EEte de dialogue du s\u00E9lecteur de fichiers. +FileChooser.saveButtonToolTip.textAndMnemonic=Enregistre le fichier s\u00E9lectionn\u00E9. +FileChooser.openButtonToolTip.textAndMnemonic=Ouvre le fichier s\u00E9lectionn\u00E9. +FileChooser.updateButtonToolTip.textAndMnemonic=Met \u00E0 jour la liste des r\u00E9pertoires. +FileChooser.helpButtonToolTip.textAndMnemonic=Aide du s\u00E9lecteur de fichiers diff --git a/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_it.properties b/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_it.properties index 9763045aee222a4f09d98f72e05a4e23a63303f3..352a9d708cfe262364c61fe6bf8960321481f4fc 100644 --- a/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_it.properties +++ b/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_it.properties @@ -18,28 +18,23 @@ ############ FILE CHOOSER STRINGS ############# -FileChooser.acceptAllFileFilterText=* -FileChooser.cancelButtonText=Annulla -FileChooser.saveButtonText=Salva -FileChooser.openButtonText=OK -FileChooser.saveDialogTitleText=Salva -FileChooser.openDialogTitleText=Apri -FileChooser.updateButtonText=Aggiorna -FileChooser.helpButtonText=? -FileChooser.pathLabelText=Percorso o nome cartella: -FileChooser.pathLabelMnemonic=80 -FileChooser.filterLabelText=Filtro -FileChooser.filterLabelMnemonic=82 -FileChooser.foldersLabelText=Cartelle -FileChooser.foldersLabelMnemonic=76 -FileChooser.filesLabelText=File -FileChooser.filesLabelMnemonic=73 -FileChooser.enterFileNameLabelText=Nome file: -FileChooser.enterFileNameLabelMnemonic=78 -FileChooser.enterFolderNameLabelText=Nome cartella: +FileChooser.acceptAllFileFilter.textAndMnemonic=* +FileChooser.cancelButton.textAndMnemonic=Annulla +FileChooser.saveButton.textAndMnemonic=Salva +FileChooser.openButton.textAndMnemonic=OK +FileChooser.saveDialogTitle.textAndMnemonic=Salva +FileChooser.openDialogTitle.textAndMnemonic=Apri +FileChooser.updateButton.textAndMnemonic=Aggiorna +FileChooser.helpButton.textAndMnemonic=? +FileChooser.pathLabel.textAndMnemonic=&Percorso o nome cartella: +FileChooser.filterLabel.textAndMnemonic=Filt&ro +FileChooser.foldersLabel.textAndMnemonic=Carte&lle +FileChooser.filesLabel.textAndMnemonic=F&ile +FileChooser.enterFileNameLabel.textAndMnemonic=&Nome file: +FileChooser.enterFolderNameLabel.textAndMnemonic=Nome cartella: -FileChooser.cancelButtonToolTipText=Chiude la finestra di dialogo di selezione file. -FileChooser.saveButtonToolTipText=Salva il file selezionato. -FileChooser.openButtonToolTipText=Apre il file selezionato. -FileChooser.updateButtonToolTipText=Aggiorna lista directory. -FileChooser.helpButtonToolTipText=Guida FileChooser. +FileChooser.cancelButtonToolTip.textAndMnemonic=Chiude la finestra di dialogo di selezione file. +FileChooser.saveButtonToolTip.textAndMnemonic=Salva il file selezionato. +FileChooser.openButtonToolTip.textAndMnemonic=Apre il file selezionato. +FileChooser.updateButtonToolTip.textAndMnemonic=Aggiorna lista directory. +FileChooser.helpButtonToolTip.textAndMnemonic=Guida FileChooser. diff --git a/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_ja.properties b/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_ja.properties index 97b505b57415d30e28170b9b98a34e508052b31e..9b28788a64574d72cfcda0e31bd8c5a362cc842b 100644 --- a/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_ja.properties +++ b/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_ja.properties @@ -18,28 +18,23 @@ ############ FILE CHOOSER STRINGS ############# -FileChooser.acceptAllFileFilterText=* -FileChooser.cancelButtonText=\u53D6\u6D88 -FileChooser.saveButtonText=\u4FDD\u5B58 -FileChooser.openButtonText=OK -FileChooser.saveDialogTitleText=\u4FDD\u5B58 -FileChooser.openDialogTitleText=\u958B\u304F -FileChooser.updateButtonText=\u66F4\u65B0 -FileChooser.helpButtonText=\u30D8\u30EB\u30D7 -FileChooser.pathLabelText=\u30D1\u30B9\u307E\u305F\u306F\u30D5\u30A9\u30EB\u30C0\u540D\u3092\u5165\u529B: -FileChooser.pathLabelMnemonic=80 -FileChooser.filterLabelText=\u30D5\u30A3\u30EB\u30BF -FileChooser.filterLabelMnemonic=82 -FileChooser.foldersLabelText=\u30D5\u30A9\u30EB\u30C0 -FileChooser.foldersLabelMnemonic=76 -FileChooser.filesLabelText=\u30D5\u30A1\u30A4\u30EB -FileChooser.filesLabelMnemonic=73 -FileChooser.enterFileNameLabelText=\u30D5\u30A1\u30A4\u30EB\u540D\u3092\u5165\u529B: -FileChooser.enterFileNameLabelMnemonic=78 -FileChooser.enterFolderNameLabelText=\u30D5\u30A9\u30EB\u30C0\u540D\u3092\u5165\u529B: +FileChooser.acceptAllFileFilter.textAndMnemonic=* +FileChooser.cancelButton.textAndMnemonic=\u53D6\u6D88 +FileChooser.saveButton.textAndMnemonic=\u4FDD\u5B58 +FileChooser.openButton.textAndMnemonic=OK +FileChooser.saveDialogTitle.textAndMnemonic=\u4FDD\u5B58 +FileChooser.openDialogTitle.textAndMnemonic=\u958B\u304F +FileChooser.updateButton.textAndMnemonic=\u66F4\u65B0 +FileChooser.helpButton.textAndMnemonic=\u30D8\u30EB\u30D7 +FileChooser.pathLabel.textAndMnemonic=\u30D1\u30B9\u307E\u305F\u306F\u30D5\u30A9\u30EB\u30C0\u540D\u3092\u5165\u529B(&P): +FileChooser.filterLabel.textAndMnemonic=\u30D5\u30A3\u30EB\u30BF(&R) +FileChooser.foldersLabel.textAndMnemonic=\u30D5\u30A9\u30EB\u30C0(&L) +FileChooser.filesLabel.textAndMnemonic=\u30D5\u30A1\u30A4\u30EB(&I) +FileChooser.enterFileNameLabel.textAndMnemonic=\u30D5\u30A1\u30A4\u30EB\u540D\u3092\u5165\u529B(&N): +FileChooser.enterFolderNameLabel.textAndMnemonic=\u30D5\u30A9\u30EB\u30C0\u540D\u3092\u5165\u529B: -FileChooser.cancelButtonToolTipText=\u30D5\u30A1\u30A4\u30EB\u30FB\u30C1\u30E5\u30FC\u30B6\u30FB\u30C0\u30A4\u30A2\u30ED\u30B0\u3092\u7D42\u4E86\u3057\u307E\u3059\u3002 -FileChooser.saveButtonToolTipText=\u9078\u629E\u3057\u305F\u30D5\u30A1\u30A4\u30EB\u3092\u4FDD\u5B58\u3057\u307E\u3059\u3002 -FileChooser.openButtonToolTipText=\u9078\u629E\u3057\u305F\u30D5\u30A1\u30A4\u30EB\u3092\u958B\u304D\u307E\u3059\u3002 -FileChooser.updateButtonToolTipText=\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u30EA\u30B9\u30C8\u3092\u66F4\u65B0\u3057\u307E\u3059\u3002 -FileChooser.helpButtonToolTipText=FileChooser\u306E\u30D8\u30EB\u30D7\u3067\u3059\u3002 +FileChooser.cancelButtonToolTip.textAndMnemonic=\u30D5\u30A1\u30A4\u30EB\u30FB\u30C1\u30E5\u30FC\u30B6\u30FB\u30C0\u30A4\u30A2\u30ED\u30B0\u3092\u7D42\u4E86\u3057\u307E\u3059\u3002 +FileChooser.saveButtonToolTip.textAndMnemonic=\u9078\u629E\u3057\u305F\u30D5\u30A1\u30A4\u30EB\u3092\u4FDD\u5B58\u3057\u307E\u3059\u3002 +FileChooser.openButtonToolTip.textAndMnemonic=\u9078\u629E\u3057\u305F\u30D5\u30A1\u30A4\u30EB\u3092\u958B\u304D\u307E\u3059\u3002 +FileChooser.updateButtonToolTip.textAndMnemonic=\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u30EA\u30B9\u30C8\u3092\u66F4\u65B0\u3057\u307E\u3059\u3002 +FileChooser.helpButtonToolTip.textAndMnemonic=FileChooser\u306E\u30D8\u30EB\u30D7\u3067\u3059\u3002 diff --git a/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_ko.properties b/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_ko.properties index 61c06c6949dd8a74a6b2fd41dae5625977b76985..f7e2625e9c986d8a4f1ba9d0b65991d3f52ff5c1 100644 --- a/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_ko.properties +++ b/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_ko.properties @@ -18,28 +18,23 @@ ############ FILE CHOOSER STRINGS ############# -FileChooser.acceptAllFileFilterText=* -FileChooser.cancelButtonText=\uCDE8\uC18C -FileChooser.saveButtonText=\uC800\uC7A5 -FileChooser.openButtonText=\uD655\uC778 -FileChooser.saveDialogTitleText=\uC800\uC7A5 -FileChooser.openDialogTitleText=\uC5F4\uAE30 -FileChooser.updateButtonText=\uAC31\uC2E0 -FileChooser.helpButtonText=\uB3C4\uC6C0\uB9D0 -FileChooser.pathLabelText=\uACBD\uB85C \uB610\uB294 \uD3F4\uB354 \uC774\uB984 \uC785\uB825: -FileChooser.pathLabelMnemonic=80 -FileChooser.filterLabelText=\uD544\uD130 -FileChooser.filterLabelMnemonic=82 -FileChooser.foldersLabelText=\uD3F4\uB354 -FileChooser.foldersLabelMnemonic=76 -FileChooser.filesLabelText=\uD30C\uC77C -FileChooser.filesLabelMnemonic=73 -FileChooser.enterFileNameLabelText=\uD30C\uC77C \uC774\uB984 \uC785\uB825: -FileChooser.enterFileNameLabelMnemonic=78 -FileChooser.enterFolderNameLabelText=\uD3F4\uB354 \uC774\uB984 \uC785\uB825: +FileChooser.acceptAllFileFilter.textAndMnemonic=* +FileChooser.cancelButton.textAndMnemonic=\uCDE8\uC18C +FileChooser.saveButton.textAndMnemonic=\uC800\uC7A5 +FileChooser.openButton.textAndMnemonic=\uD655\uC778 +FileChooser.saveDialogTitle.textAndMnemonic=\uC800\uC7A5 +FileChooser.openDialogTitle.textAndMnemonic=\uC5F4\uAE30 +FileChooser.updateButton.textAndMnemonic=\uAC31\uC2E0 +FileChooser.helpButton.textAndMnemonic=\uB3C4\uC6C0\uB9D0 +FileChooser.pathLabel.textAndMnemonic=\uACBD\uB85C \uB610\uB294 \uD3F4\uB354 \uC774\uB984 \uC785\uB825(&P): +FileChooser.filterLabel.textAndMnemonic=\uD544\uD130(&R) +FileChooser.foldersLabel.textAndMnemonic=\uD3F4\uB354(&L) +FileChooser.filesLabel.textAndMnemonic=\uD30C\uC77C(&I) +FileChooser.enterFileNameLabel.textAndMnemonic=\uD30C\uC77C \uC774\uB984 \uC785\uB825(&N): +FileChooser.enterFolderNameLabel.textAndMnemonic=\uD3F4\uB354 \uC774\uB984 \uC785\uB825: -FileChooser.cancelButtonToolTipText=\uD30C\uC77C \uC120\uD0DD\uAE30 \uB300\uD654\uC0C1\uC790\uB97C \uC911\uB2E8\uD569\uB2C8\uB2E4. -FileChooser.saveButtonToolTipText=\uC120\uD0DD\uB41C \uD30C\uC77C\uC744 \uC800\uC7A5\uD569\uB2C8\uB2E4. -FileChooser.openButtonToolTipText=\uC120\uD0DD\uB41C \uD30C\uC77C\uC744 \uC5FD\uB2C8\uB2E4. -FileChooser.updateButtonToolTipText=\uB514\uB809\uD1A0\uB9AC \uBAA9\uB85D\uC744 \uAC31\uC2E0\uD569\uB2C8\uB2E4. -FileChooser.helpButtonToolTipText=FileChooser \uB3C4\uC6C0\uB9D0\uC785\uB2C8\uB2E4. +FileChooser.cancelButtonToolTip.textAndMnemonic=\uD30C\uC77C \uC120\uD0DD\uAE30 \uB300\uD654\uC0C1\uC790\uB97C \uC911\uB2E8\uD569\uB2C8\uB2E4. +FileChooser.saveButtonToolTip.textAndMnemonic=\uC120\uD0DD\uB41C \uD30C\uC77C\uC744 \uC800\uC7A5\uD569\uB2C8\uB2E4. +FileChooser.openButtonToolTip.textAndMnemonic=\uC120\uD0DD\uB41C \uD30C\uC77C\uC744 \uC5FD\uB2C8\uB2E4. +FileChooser.updateButtonToolTip.textAndMnemonic=\uB514\uB809\uD1A0\uB9AC \uBAA9\uB85D\uC744 \uAC31\uC2E0\uD569\uB2C8\uB2E4. +FileChooser.helpButtonToolTip.textAndMnemonic=FileChooser \uB3C4\uC6C0\uB9D0\uC785\uB2C8\uB2E4. diff --git a/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_pt_BR.properties b/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_pt_BR.properties index 6e40ef51c062081821cb4d8bdad4d8f139d2b381..a1af5396196d8ab56a5fc35e5f6fe8d223bcb431 100644 --- a/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_pt_BR.properties +++ b/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_pt_BR.properties @@ -18,28 +18,23 @@ ############ FILE CHOOSER STRINGS ############# -FileChooser.acceptAllFileFilterText=* -FileChooser.cancelButtonText=Cancelar -FileChooser.saveButtonText=Salvar -FileChooser.openButtonText=OK -FileChooser.saveDialogTitleText=Salvar -FileChooser.openDialogTitleText=Abrir -FileChooser.updateButtonText=Atualizar -FileChooser.helpButtonText=Ajuda -FileChooser.pathLabelText=Informar caminho ou nome da pasta: -FileChooser.pathLabelMnemonic=80 -FileChooser.filterLabelText=Filtro -FileChooser.filterLabelMnemonic=82 -FileChooser.foldersLabelText=Pastas -FileChooser.foldersLabelMnemonic=76 -FileChooser.filesLabelText=Arquivos -FileChooser.filesLabelMnemonic=73 -FileChooser.enterFileNameLabelText=Informar nome do arquivo: -FileChooser.enterFileNameLabelMnemonic=78 -FileChooser.enterFolderNameLabelText=Informar nome da pasta: +FileChooser.acceptAllFileFilter.textAndMnemonic=* +FileChooser.cancelButton.textAndMnemonic=Cancelar +FileChooser.saveButton.textAndMnemonic=Salvar +FileChooser.openButton.textAndMnemonic=OK +FileChooser.saveDialogTitle.textAndMnemonic=Salvar +FileChooser.openDialogTitle.textAndMnemonic=Abrir +FileChooser.updateButton.textAndMnemonic=Atualizar +FileChooser.helpButton.textAndMnemonic=Ajuda +FileChooser.pathLabel.textAndMnemonic=Informar caminho ou nome da &pasta: +FileChooser.filterLabel.textAndMnemonic=Filt&ro +FileChooser.foldersLabel.textAndMnemonic=Pastas(&L) +FileChooser.filesLabel.textAndMnemonic=Arqu&ivos +FileChooser.enterFileNameLabel.textAndMnemonic=I&nformar nome do arquivo: +FileChooser.enterFolderNameLabel.textAndMnemonic=Informar nome da pasta: -FileChooser.cancelButtonToolTipText=Abortar caixa de di\u00E1logo do seletor de arquivos. -FileChooser.saveButtonToolTipText=Salvar arquivo selecionado. -FileChooser.openButtonToolTipText=Abrir arquivo selecionado. -FileChooser.updateButtonToolTipText=Atualizar lista de diret\u00F3rios. -FileChooser.helpButtonToolTipText=Ajuda do FileChooser. +FileChooser.cancelButtonToolTip.textAndMnemonic=Abortar caixa de di\u00E1logo do seletor de arquivos. +FileChooser.saveButtonToolTip.textAndMnemonic=Salvar arquivo selecionado. +FileChooser.openButtonToolTip.textAndMnemonic=Abrir arquivo selecionado. +FileChooser.updateButtonToolTip.textAndMnemonic=Atualizar lista de diret\u00F3rios. +FileChooser.helpButtonToolTip.textAndMnemonic=Ajuda do FileChooser. diff --git a/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_sv.properties b/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_sv.properties index 4cd736baa9dd681ea44481acd4e7a34444dee500..3592f4dca7e7a4e1fd49cdf76edc24e44dda011c 100644 --- a/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_sv.properties +++ b/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_sv.properties @@ -18,28 +18,23 @@ ############ FILE CHOOSER STRINGS ############# -FileChooser.acceptAllFileFilterText=* -FileChooser.cancelButtonText=Avbryt -FileChooser.saveButtonText=Spara -FileChooser.openButtonText=OK -FileChooser.saveDialogTitleText=Spara -FileChooser.openDialogTitleText=\u00D6ppna -FileChooser.updateButtonText=Uppdatera -FileChooser.helpButtonText=Hj\u00E4lp -FileChooser.pathLabelText=Ange s\u00F6kv\u00E4g eller mappnamn: -FileChooser.pathLabelMnemonic=80 -FileChooser.filterLabelText=Filter -FileChooser.filterLabelMnemonic=82 -FileChooser.foldersLabelText=Mappar -FileChooser.foldersLabelMnemonic=76 -FileChooser.filesLabelText=Filer -FileChooser.filesLabelMnemonic=73 -FileChooser.enterFileNameLabelText=Ange filnamn: -FileChooser.enterFileNameLabelMnemonic=78 -FileChooser.enterFolderNameLabelText=Ange ett mappnamn: +FileChooser.acceptAllFileFilter.textAndMnemonic=* +FileChooser.cancelButton.textAndMnemonic=Avbryt +FileChooser.saveButton.textAndMnemonic=Spara +FileChooser.openButton.textAndMnemonic=OK +FileChooser.saveDialogTitle.textAndMnemonic=Spara +FileChooser.openDialogTitle.textAndMnemonic=\u00D6ppna +FileChooser.updateButton.textAndMnemonic=Uppdatera +FileChooser.helpButton.textAndMnemonic=Hj\u00E4lp +FileChooser.pathLabel.textAndMnemonic=Ange s\u00F6kv\u00E4g eller mappnamn(&P): +FileChooser.filterLabel.textAndMnemonic=Filte&r +FileChooser.foldersLabel.textAndMnemonic=Mappar(&L) +FileChooser.filesLabel.textAndMnemonic=F&iler +FileChooser.enterFileNameLabel.textAndMnemonic=A&nge filnamn: +FileChooser.enterFolderNameLabel.textAndMnemonic=Ange ett mappnamn: -FileChooser.cancelButtonToolTipText=Avbryt dialogrutan Filv\u00E4ljare. -FileChooser.saveButtonToolTipText=Spara vald fil. -FileChooser.openButtonToolTipText=\u00D6ppna vald fil. -FileChooser.updateButtonToolTipText=Uppdatera kataloglistan. -FileChooser.helpButtonToolTipText=Hj\u00E4lp - Filv\u00E4ljare. +FileChooser.cancelButtonToolTip.textAndMnemonic=Avbryt dialogrutan Filv\u00E4ljare. +FileChooser.saveButtonToolTip.textAndMnemonic=Spara vald fil. +FileChooser.openButtonToolTip.textAndMnemonic=\u00D6ppna vald fil. +FileChooser.updateButtonToolTip.textAndMnemonic=Uppdatera kataloglistan. +FileChooser.helpButtonToolTip.textAndMnemonic=Hj\u00E4lp - Filv\u00E4ljare. diff --git a/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_zh_CN.properties b/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_zh_CN.properties index 121fe60a8ff34797c172928766b9436dd27281ff..c2c1ecdfc9f4dfe3e6d4d7d99eb01985b31e86d0 100644 --- a/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_zh_CN.properties +++ b/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_zh_CN.properties @@ -18,28 +18,23 @@ ############ FILE CHOOSER STRINGS ############# -FileChooser.acceptAllFileFilterText=* -FileChooser.cancelButtonText=\u53D6\u6D88 -FileChooser.saveButtonText=\u4FDD\u5B58 -FileChooser.openButtonText=\u786E\u5B9A -FileChooser.saveDialogTitleText=\u4FDD\u5B58 -FileChooser.openDialogTitleText=\u6253\u5F00 -FileChooser.updateButtonText=\u66F4\u65B0 -FileChooser.helpButtonText=\u5E2E\u52A9 -FileChooser.pathLabelText=\u952E\u5165\u8DEF\u5F84\u6216\u6587\u4EF6\u5939\u540D: -FileChooser.pathLabelMnemonic=80 -FileChooser.filterLabelText=\u7B5B\u9009\u5668 -FileChooser.filterLabelMnemonic=82 -FileChooser.foldersLabelText=\u6587\u4EF6\u5939 -FileChooser.foldersLabelMnemonic=76 -FileChooser.filesLabelText=\u6587\u4EF6 -FileChooser.filesLabelMnemonic=73 -FileChooser.enterFileNameLabelText=\u952E\u5165\u6587\u4EF6\u540D: -FileChooser.enterFileNameLabelMnemonic=78 -FileChooser.enterFolderNameLabelText=\u8F93\u5165\u6587\u4EF6\u5939\u540D: +FileChooser.acceptAllFileFilter.textAndMnemonic=* +FileChooser.cancelButton.textAndMnemonic=\u53D6\u6D88 +FileChooser.saveButton.textAndMnemonic=\u4FDD\u5B58 +FileChooser.openButton.textAndMnemonic=\u786E\u5B9A +FileChooser.saveDialogTitle.textAndMnemonic=\u4FDD\u5B58 +FileChooser.openDialogTitle.textAndMnemonic=\u6253\u5F00 +FileChooser.updateButton.textAndMnemonic=\u66F4\u65B0 +FileChooser.helpButton.textAndMnemonic=\u5E2E\u52A9 +FileChooser.pathLabel.textAndMnemonic=\u952E\u5165\u8DEF\u5F84\u6216\u6587\u4EF6\u5939\u540D: (&P) +FileChooser.filterLabel.textAndMnemonic=\u7B5B\u9009\u5668(&R) +FileChooser.foldersLabel.textAndMnemonic=\u6587\u4EF6\u5939(&L) +FileChooser.filesLabel.textAndMnemonic=\u6587\u4EF6(&I) +FileChooser.enterFileNameLabel.textAndMnemonic=\u952E\u5165\u6587\u4EF6\u540D: (&N) +FileChooser.enterFolderNameLabel.textAndMnemonic=\u8F93\u5165\u6587\u4EF6\u5939\u540D: -FileChooser.cancelButtonToolTipText=\u4E2D\u6B62\u6587\u4EF6\u9009\u62E9\u5668\u5BF9\u8BDD\u6846\u3002 -FileChooser.saveButtonToolTipText=\u4FDD\u5B58\u6240\u9009\u6587\u4EF6\u3002 -FileChooser.openButtonToolTipText=\u6253\u5F00\u6240\u9009\u6587\u4EF6\u3002 -FileChooser.updateButtonToolTipText=\u66F4\u65B0\u76EE\u5F55\u5217\u8868\u3002 -FileChooser.helpButtonToolTipText=FileChooser \u5E2E\u52A9\u3002 +FileChooser.cancelButtonToolTip.textAndMnemonic=\u4E2D\u6B62\u6587\u4EF6\u9009\u62E9\u5668\u5BF9\u8BDD\u6846\u3002 +FileChooser.saveButtonToolTip.textAndMnemonic=\u4FDD\u5B58\u6240\u9009\u6587\u4EF6\u3002 +FileChooser.openButtonToolTip.textAndMnemonic=\u6253\u5F00\u6240\u9009\u6587\u4EF6\u3002 +FileChooser.updateButtonToolTip.textAndMnemonic=\u66F4\u65B0\u76EE\u5F55\u5217\u8868\u3002 +FileChooser.helpButtonToolTip.textAndMnemonic=FileChooser \u5E2E\u52A9\u3002 diff --git a/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_zh_TW.properties b/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_zh_TW.properties index 1b2d9d76c4bc136108e44f74a02c0cb32bce4b3d..6e77bbaf126f5f49d41980c0c9c5b3d1f8780200 100644 --- a/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_zh_TW.properties +++ b/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_zh_TW.properties @@ -18,28 +18,23 @@ ############ FILE CHOOSER STRINGS ############# -FileChooser.acceptAllFileFilterText=* -FileChooser.cancelButtonText=\u53D6\u6D88 -FileChooser.saveButtonText=\u5132\u5B58 -FileChooser.openButtonText=\u78BA\u5B9A -FileChooser.saveDialogTitleText=\u5132\u5B58 -FileChooser.openDialogTitleText=\u958B\u555F -FileChooser.updateButtonText=\u66F4\u65B0 -FileChooser.helpButtonText=\u8AAA\u660E -FileChooser.pathLabelText=\u8F38\u5165\u8DEF\u5F91\u6216\u8CC7\u6599\u593E\u540D\u7A31: -FileChooser.pathLabelMnemonic=80 -FileChooser.filterLabelText=\u7BE9\u9078 -FileChooser.filterLabelMnemonic=82 -FileChooser.foldersLabelText=\u8CC7\u6599\u593E -FileChooser.foldersLabelMnemonic=76 -FileChooser.filesLabelText=\u6A94\u6848 -FileChooser.filesLabelMnemonic=73 -FileChooser.enterFileNameLabelText=\u8F38\u5165\u6A94\u6848\u540D\u7A31: -FileChooser.enterFileNameLabelMnemonic=78 -FileChooser.enterFolderNameLabelText=\u8F38\u5165\u8CC7\u6599\u593E\u540D\u7A31: +FileChooser.acceptAllFileFilter.textAndMnemonic=* +FileChooser.cancelButton.textAndMnemonic=\u53D6\u6D88 +FileChooser.saveButton.textAndMnemonic=\u5132\u5B58 +FileChooser.openButton.textAndMnemonic=\u78BA\u5B9A +FileChooser.saveDialogTitle.textAndMnemonic=\u5132\u5B58 +FileChooser.openDialogTitle.textAndMnemonic=\u958B\u555F +FileChooser.updateButton.textAndMnemonic=\u66F4\u65B0 +FileChooser.helpButton.textAndMnemonic=\u8AAA\u660E +FileChooser.pathLabel.textAndMnemonic=\u8F38\u5165\u8DEF\u5F91\u6216\u8CC7\u6599\u593E\u540D\u7A31(&P): +FileChooser.filterLabel.textAndMnemonic=\u7BE9\u9078(&R) +FileChooser.foldersLabel.textAndMnemonic=\u8CC7\u6599\u593E(&L) +FileChooser.filesLabel.textAndMnemonic=\u6A94\u6848(&I) +FileChooser.enterFileNameLabel.textAndMnemonic=\u8F38\u5165\u6A94\u6848\u540D\u7A31(&N): +FileChooser.enterFolderNameLabel.textAndMnemonic=\u8F38\u5165\u8CC7\u6599\u593E\u540D\u7A31: -FileChooser.cancelButtonToolTipText=\u4E2D\u6B62\u6A94\u6848\u9078\u64C7\u5668\u5C0D\u8A71\u65B9\u584A\u3002 -FileChooser.saveButtonToolTipText=\u5132\u5B58\u9078\u53D6\u7684\u6A94\u6848\u3002 -FileChooser.openButtonToolTipText=\u958B\u555F\u9078\u53D6\u7684\u6A94\u6848\u3002 -FileChooser.updateButtonToolTipText=\u66F4\u65B0\u76EE\u9304\u6E05\u55AE\u3002 -FileChooser.helpButtonToolTipText=\u300C\u6A94\u6848\u9078\u64C7\u5668\u300D\u8AAA\u660E\u3002 +FileChooser.cancelButtonToolTip.textAndMnemonic=\u4E2D\u6B62\u6A94\u6848\u9078\u64C7\u5668\u5C0D\u8A71\u65B9\u584A\u3002 +FileChooser.saveButtonToolTip.textAndMnemonic=\u5132\u5B58\u9078\u53D6\u7684\u6A94\u6848\u3002 +FileChooser.openButtonToolTip.textAndMnemonic=\u958B\u555F\u9078\u53D6\u7684\u6A94\u6848\u3002 +FileChooser.updateButtonToolTip.textAndMnemonic=\u66F4\u65B0\u76EE\u9304\u6E05\u55AE\u3002 +FileChooser.helpButtonToolTip.textAndMnemonic=\u300C\u6A94\u6848\u9078\u64C7\u5668\u300D\u8AAA\u660E\u3002 diff --git a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows.properties b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows.properties index 0f27244f37a6c0483a081495bbf216c6f070432d..7f36db65a472e633416fe59bc9f75124225fd99d 100644 --- a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows.properties +++ b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows.properties @@ -18,34 +18,30 @@ ############ FILE CHOOSER STRINGS ############# -FileChooser.lookInLabelText=Look in: -FileChooser.lookInLabelMnemonic=73 -FileChooser.saveInLabelText=Save in: -FileChooser.fileNameLabelText=File name: -FileChooser.fileNameLabelMnemonic=78 -FileChooser.folderNameLabelText=Folder name: -FileChooser.folderNameLabelMnemonic=78 -FileChooser.filesOfTypeLabelText=Files of type: -FileChooser.filesOfTypeLabelMnemonic=84 -FileChooser.upFolderToolTipText=Up One Level +FileChooser.lookInLabel.textAndMnemonic=Look &in: +FileChooser.saveInLabel.textAndMnemonic=Save in: +FileChooser.fileNameLabel.textAndMnemonic=File &name: +FileChooser.folderNameLabel.textAndMnemonic=Folder &name: +FileChooser.filesOfTypeLabel.textAndMnemonic=Files of &type: +FileChooser.upFolderToolTip.textAndMnemonic=Up One Level FileChooser.upFolderAccessibleName=Up -FileChooser.homeFolderToolTipText=Home +FileChooser.homeFolderToolTip.textAndMnemonic=Home FileChooser.homeFolderAccessibleName=Home -FileChooser.newFolderToolTipText=Create New Folder +FileChooser.newFolderToolTip.textAndMnemonic=Create New Folder FileChooser.newFolderAccessibleName=New Folder -FileChooser.newFolderActionLabelText=New Folder -FileChooser.listViewButtonToolTipText=List +FileChooser.newFolderActionLabel.textAndMnemonic=New Folder +FileChooser.listViewButtonToolTip.textAndMnemonic=List FileChooser.listViewButtonAccessibleName=List -FileChooser.listViewActionLabelText=List -FileChooser.detailsViewButtonToolTipText=Details +FileChooser.listViewActionLabel.textAndMnemonic=List +FileChooser.detailsViewButtonToolTip.textAndMnemonic=Details FileChooser.detailsViewButtonAccessibleName=Details FileChooser.viewMenuButtonToolTipText = View Menu FileChooser.viewMenuButtonAccessibleName = View Menu -FileChooser.detailsViewActionLabelText=Details -FileChooser.refreshActionLabelText=Refresh -FileChooser.viewMenuLabelText=View -FileChooser.fileNameHeaderText=Name -FileChooser.fileSizeHeaderText=Size -FileChooser.fileTypeHeaderText=Type -FileChooser.fileDateHeaderText=Modified -FileChooser.fileAttrHeaderText=Attributes +FileChooser.detailsViewActionLabel.textAndMnemonic=Details +FileChooser.refreshActionLabel.textAndMnemonic=Refresh +FileChooser.viewMenuLabel.textAndMnemonic=View +FileChooser.fileNameHeader.textAndMnemonic=Name +FileChooser.fileSizeHeader.textAndMnemonic=Size +FileChooser.fileTypeHeader.textAndMnemonic=Type +FileChooser.fileDateHeader.textAndMnemonic=Modified +FileChooser.fileAttrHeader.textAndMnemonic=Attributes diff --git a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_de.properties b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_de.properties index b9d8c341f47f9d19ae036f333c2879cb50523d73..0fb049947375743276489da015eafd91f189bd15 100644 --- a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_de.properties +++ b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_de.properties @@ -18,34 +18,30 @@ ############ FILE CHOOSER STRINGS ############# -FileChooser.lookInLabelText=Suchen in: -FileChooser.lookInLabelMnemonic=73 -FileChooser.saveInLabelText=Speichern in: -FileChooser.fileNameLabelText=Dateiname: -FileChooser.fileNameLabelMnemonic=78 -FileChooser.folderNameLabelText=Ordnername: -FileChooser.folderNameLabelMnemonic=78 -FileChooser.filesOfTypeLabelText=Dateityp: -FileChooser.filesOfTypeLabelMnemonic=84 -FileChooser.upFolderToolTipText=Eine Ebene h\u00F6her +FileChooser.lookInLabel.textAndMnemonic=Suchen &in: +FileChooser.saveInLabel.textAndMnemonic=Speichern in: +FileChooser.fileNameLabel.textAndMnemonic=Datei&name: +FileChooser.folderNameLabel.textAndMnemonic=Ord&nername: +FileChooser.filesOfTypeLabel.textAndMnemonic=Da&teityp: +FileChooser.upFolderToolTip.textAndMnemonic=Eine Ebene h\u00F6her FileChooser.upFolderAccessibleName=Nach oben -FileChooser.homeFolderToolTipText=Home +FileChooser.homeFolderToolTip.textAndMnemonic=Home FileChooser.homeFolderAccessibleName=Home -FileChooser.newFolderToolTipText=Neuen Ordner erstellen +FileChooser.newFolderToolTip.textAndMnemonic=Neuen Ordner erstellen FileChooser.newFolderAccessibleName=Neuer Ordner -FileChooser.newFolderActionLabelText=Neuer Ordner -FileChooser.listViewButtonToolTipText=Liste +FileChooser.newFolderActionLabel.textAndMnemonic=Neuer Ordner +FileChooser.listViewButtonToolTip.textAndMnemonic=Liste FileChooser.listViewButtonAccessibleName=Liste -FileChooser.listViewActionLabelText=Liste -FileChooser.detailsViewButtonToolTipText=Details +FileChooser.listViewActionLabel.textAndMnemonic=Liste +FileChooser.detailsViewButtonToolTip.textAndMnemonic=Details FileChooser.detailsViewButtonAccessibleName=Details FileChooser.viewMenuButtonToolTipText = Ansichtsmen\u00FC FileChooser.viewMenuButtonAccessibleName = Ansichtsmen\u00FC -FileChooser.detailsViewActionLabelText=Details -FileChooser.refreshActionLabelText=Aktualisieren -FileChooser.viewMenuLabelText=Ansicht -FileChooser.fileNameHeaderText=Name -FileChooser.fileSizeHeaderText=Gr\u00F6\u00DFe -FileChooser.fileTypeHeaderText=Typ -FileChooser.fileDateHeaderText=Ge\u00E4ndert -FileChooser.fileAttrHeaderText=Attribute +FileChooser.detailsViewActionLabel.textAndMnemonic=Details +FileChooser.refreshActionLabel.textAndMnemonic=Aktualisieren +FileChooser.viewMenuLabel.textAndMnemonic=Ansicht +FileChooser.fileNameHeader.textAndMnemonic=Name +FileChooser.fileSizeHeader.textAndMnemonic=Gr\u00F6\u00DFe +FileChooser.fileTypeHeader.textAndMnemonic=Typ +FileChooser.fileDateHeader.textAndMnemonic=Ge\u00E4ndert +FileChooser.fileAttrHeader.textAndMnemonic=Attribute diff --git a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_es.properties b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_es.properties index d7b610e746dd547409a168d148d61508e30fc873..4e68630f090e19b0584a33604c6d041ce63ccc3c 100644 --- a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_es.properties +++ b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_es.properties @@ -18,34 +18,30 @@ ############ FILE CHOOSER STRINGS ############# -FileChooser.lookInLabelText=Buscar en: -FileChooser.lookInLabelMnemonic=73 -FileChooser.saveInLabelText=Guardar en: -FileChooser.fileNameLabelText=Nombre de Archivo: -FileChooser.fileNameLabelMnemonic=78 -FileChooser.folderNameLabelText=Nombre de la Carpeta: -FileChooser.folderNameLabelMnemonic=78 -FileChooser.filesOfTypeLabelText=Archivos de Tipo: -FileChooser.filesOfTypeLabelMnemonic=84 -FileChooser.upFolderToolTipText=Subir un Nivel +FileChooser.lookInLabel.textAndMnemonic=Buscar en(&I): +FileChooser.saveInLabel.textAndMnemonic=Guardar en: +FileChooser.fileNameLabel.textAndMnemonic=&Nombre de Archivo: +FileChooser.folderNameLabel.textAndMnemonic=&Nombre de la Carpeta: +FileChooser.filesOfTypeLabel.textAndMnemonic=Archivos de &Tipo: +FileChooser.upFolderToolTip.textAndMnemonic=Subir un Nivel FileChooser.upFolderAccessibleName=Arriba -FileChooser.homeFolderToolTipText=Inicio +FileChooser.homeFolderToolTip.textAndMnemonic=Inicio FileChooser.homeFolderAccessibleName=Inicio -FileChooser.newFolderToolTipText=Crear Nueva Carpeta +FileChooser.newFolderToolTip.textAndMnemonic=Crear Nueva Carpeta FileChooser.newFolderAccessibleName=Nueva Carpeta -FileChooser.newFolderActionLabelText=Nueva Carpeta -FileChooser.listViewButtonToolTipText=Lista +FileChooser.newFolderActionLabel.textAndMnemonic=Nueva Carpeta +FileChooser.listViewButtonToolTip.textAndMnemonic=Lista FileChooser.listViewButtonAccessibleName=Lista -FileChooser.listViewActionLabelText=Lista -FileChooser.detailsViewButtonToolTipText=Detalles +FileChooser.listViewActionLabel.textAndMnemonic=Lista +FileChooser.detailsViewButtonToolTip.textAndMnemonic=Detalles FileChooser.detailsViewButtonAccessibleName=Detalles FileChooser.viewMenuButtonToolTipText = Men\u00FA Ver FileChooser.viewMenuButtonAccessibleName = Men\u00FA Ver -FileChooser.detailsViewActionLabelText=Detalles -FileChooser.refreshActionLabelText=Refrescar -FileChooser.viewMenuLabelText=Ver -FileChooser.fileNameHeaderText=Nombre -FileChooser.fileSizeHeaderText=Tama\u00F1o -FileChooser.fileTypeHeaderText=Tipo -FileChooser.fileDateHeaderText=Modificado -FileChooser.fileAttrHeaderText=Atributos +FileChooser.detailsViewActionLabel.textAndMnemonic=Detalles +FileChooser.refreshActionLabel.textAndMnemonic=Refrescar +FileChooser.viewMenuLabel.textAndMnemonic=Ver +FileChooser.fileNameHeader.textAndMnemonic=Nombre +FileChooser.fileSizeHeader.textAndMnemonic=Tama\u00F1o +FileChooser.fileTypeHeader.textAndMnemonic=Tipo +FileChooser.fileDateHeader.textAndMnemonic=Modificado +FileChooser.fileAttrHeader.textAndMnemonic=Atributos diff --git a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_fr.properties b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_fr.properties index 39736484777f713959863d39e64d1b1fb2f7ef0e..b410f5f492680b5d58b54757ffd9f2b430f211b0 100644 --- a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_fr.properties +++ b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_fr.properties @@ -18,34 +18,30 @@ ############ FILE CHOOSER STRINGS ############# -FileChooser.lookInLabelText=Rechercher dans : -FileChooser.lookInLabelMnemonic=73 -FileChooser.saveInLabelText=Enregistrer dans : -FileChooser.fileNameLabelText=Nom du fichier : -FileChooser.fileNameLabelMnemonic=78 -FileChooser.folderNameLabelText=Nom du dossier : -FileChooser.folderNameLabelMnemonic=78 -FileChooser.filesOfTypeLabelText=Fichiers de type : -FileChooser.filesOfTypeLabelMnemonic=84 -FileChooser.upFolderToolTipText=Remonte d'un niveau. +FileChooser.lookInLabel.textAndMnemonic=Rechercher dans (&I): +FileChooser.saveInLabel.textAndMnemonic=Enregistrer dans : +FileChooser.fileNameLabel.textAndMnemonic=&Nom du fichier : +FileChooser.folderNameLabel.textAndMnemonic=&Nom du dossier : +FileChooser.filesOfTypeLabel.textAndMnemonic=Fichiers de &type : +FileChooser.upFolderToolTip.textAndMnemonic=Remonte d'un niveau. FileChooser.upFolderAccessibleName=Monter -FileChooser.homeFolderToolTipText=R\u00E9pertoire d'origine +FileChooser.homeFolderToolTip.textAndMnemonic=R\u00E9pertoire d'origine FileChooser.homeFolderAccessibleName=R\u00E9pertoire d'origine -FileChooser.newFolderToolTipText=Cr\u00E9e un dossier. +FileChooser.newFolderToolTip.textAndMnemonic=Cr\u00E9e un dossier. FileChooser.newFolderAccessibleName=Nouveau dossier -FileChooser.newFolderActionLabelText=Nouveau dossier -FileChooser.listViewButtonToolTipText=Liste +FileChooser.newFolderActionLabel.textAndMnemonic=Nouveau dossier +FileChooser.listViewButtonToolTip.textAndMnemonic=Liste FileChooser.listViewButtonAccessibleName=Liste -FileChooser.listViewActionLabelText=Liste -FileChooser.detailsViewButtonToolTipText=D\u00E9tails +FileChooser.listViewActionLabel.textAndMnemonic=Liste +FileChooser.detailsViewButtonToolTip.textAndMnemonic=D\u00E9tails FileChooser.detailsViewButtonAccessibleName=D\u00E9tails FileChooser.viewMenuButtonToolTipText = Menu Affichage FileChooser.viewMenuButtonAccessibleName = Menu Affichage -FileChooser.detailsViewActionLabelText=D\u00E9tails -FileChooser.refreshActionLabelText=Actualiser -FileChooser.viewMenuLabelText=Affichage -FileChooser.fileNameHeaderText=Nom -FileChooser.fileSizeHeaderText=Taille -FileChooser.fileTypeHeaderText=Type -FileChooser.fileDateHeaderText=Modifi\u00E9 -FileChooser.fileAttrHeaderText=Attributs +FileChooser.detailsViewActionLabel.textAndMnemonic=D\u00E9tails +FileChooser.refreshActionLabel.textAndMnemonic=Actualiser +FileChooser.viewMenuLabel.textAndMnemonic=Affichage +FileChooser.fileNameHeader.textAndMnemonic=Nom +FileChooser.fileSizeHeader.textAndMnemonic=Taille +FileChooser.fileTypeHeader.textAndMnemonic=Type +FileChooser.fileDateHeader.textAndMnemonic=Modifi\u00E9 +FileChooser.fileAttrHeader.textAndMnemonic=Attributs diff --git a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_it.properties b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_it.properties index 5e3e6f12634f960ffcb741a85c71ee7528bc9823..dc9e9c02a98b2feb47376dd8c6df05e4abb01821 100644 --- a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_it.properties +++ b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_it.properties @@ -18,34 +18,30 @@ ############ FILE CHOOSER STRINGS ############# -FileChooser.lookInLabelText=Cerca in: -FileChooser.lookInLabelMnemonic=73 -FileChooser.saveInLabelText=Salva in: -FileChooser.fileNameLabelText=Nome file: -FileChooser.fileNameLabelMnemonic=78 -FileChooser.folderNameLabelText=Nome della cartella: -FileChooser.folderNameLabelMnemonic=78 -FileChooser.filesOfTypeLabelText=Tipo file: -FileChooser.filesOfTypeLabelMnemonic=84 -FileChooser.upFolderToolTipText=Cartella superiore +FileChooser.lookInLabel.textAndMnemonic=Cerca &in: +FileChooser.saveInLabel.textAndMnemonic=Salva in: +FileChooser.fileNameLabel.textAndMnemonic=&Nome file: +FileChooser.folderNameLabel.textAndMnemonic=&Nome della cartella: +FileChooser.filesOfTypeLabel.textAndMnemonic=&Tipo file: +FileChooser.upFolderToolTip.textAndMnemonic=Cartella superiore FileChooser.upFolderAccessibleName=Superiore -FileChooser.homeFolderToolTipText=Home +FileChooser.homeFolderToolTip.textAndMnemonic=Home FileChooser.homeFolderAccessibleName=Home -FileChooser.newFolderToolTipText=Crea nuova cartella +FileChooser.newFolderToolTip.textAndMnemonic=Crea nuova cartella FileChooser.newFolderAccessibleName=Nuova cartella -FileChooser.newFolderActionLabelText=Nuova cartella -FileChooser.listViewButtonToolTipText=Lista +FileChooser.newFolderActionLabel.textAndMnemonic=Nuova cartella +FileChooser.listViewButtonToolTip.textAndMnemonic=Lista FileChooser.listViewButtonAccessibleName=Lista -FileChooser.listViewActionLabelText=Lista -FileChooser.detailsViewButtonToolTipText=Dettagli +FileChooser.listViewActionLabel.textAndMnemonic=Lista +FileChooser.detailsViewButtonToolTip.textAndMnemonic=Dettagli FileChooser.detailsViewButtonAccessibleName=Dettagli FileChooser.viewMenuButtonToolTipText = Visualizza menu FileChooser.viewMenuButtonAccessibleName = Visualizza menu -FileChooser.detailsViewActionLabelText=Dettagli -FileChooser.refreshActionLabelText=Aggiorna -FileChooser.viewMenuLabelText=Visualizza -FileChooser.fileNameHeaderText=Nome -FileChooser.fileSizeHeaderText=Dimensioni -FileChooser.fileTypeHeaderText=Tipo -FileChooser.fileDateHeaderText=Modificato -FileChooser.fileAttrHeaderText=Attributi +FileChooser.detailsViewActionLabel.textAndMnemonic=Dettagli +FileChooser.refreshActionLabel.textAndMnemonic=Aggiorna +FileChooser.viewMenuLabel.textAndMnemonic=Visualizza +FileChooser.fileNameHeader.textAndMnemonic=Nome +FileChooser.fileSizeHeader.textAndMnemonic=Dimensioni +FileChooser.fileTypeHeader.textAndMnemonic=Tipo +FileChooser.fileDateHeader.textAndMnemonic=Modificato +FileChooser.fileAttrHeader.textAndMnemonic=Attributi diff --git a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_ja.properties b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_ja.properties index adc5d930d69741374813f12d7f70aa35b46ddef9..edeaac2e862c8cc9f6493cadc4122e0294052958 100644 --- a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_ja.properties +++ b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_ja.properties @@ -18,34 +18,30 @@ ############ FILE CHOOSER STRINGS ############# -FileChooser.lookInLabelText=\u53C2\u7167: -FileChooser.lookInLabelMnemonic=73 -FileChooser.saveInLabelText=\u4FDD\u5B58: -FileChooser.fileNameLabelText=\u30D5\u30A1\u30A4\u30EB\u540D: -FileChooser.fileNameLabelMnemonic=78 -FileChooser.folderNameLabelText=\u30D5\u30A9\u30EB\u30C0\u540D: -FileChooser.folderNameLabelMnemonic=78 -FileChooser.filesOfTypeLabelText=\u30D5\u30A1\u30A4\u30EB\u306E\u30BF\u30A4\u30D7: -FileChooser.filesOfTypeLabelMnemonic=84 -FileChooser.upFolderToolTipText=1\u30EC\u30D9\u30EB\u4E0A\u3078 +FileChooser.lookInLabel.textAndMnemonic=\u53C2\u7167(&I): +FileChooser.saveInLabel.textAndMnemonic=\u4FDD\u5B58: +FileChooser.fileNameLabel.textAndMnemonic=\u30D5\u30A1\u30A4\u30EB\u540D(&N): +FileChooser.folderNameLabel.textAndMnemonic=\u30D5\u30A9\u30EB\u30C0\u540D(&N): +FileChooser.filesOfTypeLabel.textAndMnemonic=\u30D5\u30A1\u30A4\u30EB\u306E\u30BF\u30A4\u30D7(&T): +FileChooser.upFolderToolTip.textAndMnemonic=1\u30EC\u30D9\u30EB\u4E0A\u3078 FileChooser.upFolderAccessibleName=\u4E0A\u3078 -FileChooser.homeFolderToolTipText=\u30DB\u30FC\u30E0 +FileChooser.homeFolderToolTip.textAndMnemonic=\u30DB\u30FC\u30E0 FileChooser.homeFolderAccessibleName=\u30DB\u30FC\u30E0 -FileChooser.newFolderToolTipText=\u65B0\u898F\u30D5\u30A9\u30EB\u30C0\u306E\u4F5C\u6210 +FileChooser.newFolderToolTip.textAndMnemonic=\u65B0\u898F\u30D5\u30A9\u30EB\u30C0\u306E\u4F5C\u6210 FileChooser.newFolderAccessibleName=\u65B0\u898F\u30D5\u30A9\u30EB\u30C0 -FileChooser.newFolderActionLabelText=\u65B0\u898F\u30D5\u30A9\u30EB\u30C0 -FileChooser.listViewButtonToolTipText=\u30EA\u30B9\u30C8 +FileChooser.newFolderActionLabel.textAndMnemonic=\u65B0\u898F\u30D5\u30A9\u30EB\u30C0 +FileChooser.listViewButtonToolTip.textAndMnemonic=\u30EA\u30B9\u30C8 FileChooser.listViewButtonAccessibleName=\u30EA\u30B9\u30C8 -FileChooser.listViewActionLabelText=\u30EA\u30B9\u30C8 -FileChooser.detailsViewButtonToolTipText=\u8A73\u7D30 +FileChooser.listViewActionLabel.textAndMnemonic=\u30EA\u30B9\u30C8 +FileChooser.detailsViewButtonToolTip.textAndMnemonic=\u8A73\u7D30 FileChooser.detailsViewButtonAccessibleName=\u8A73\u7D30 FileChooser.viewMenuButtonToolTipText = \u8868\u793A\u30E1\u30CB\u30E5\u30FC FileChooser.viewMenuButtonAccessibleName = \u8868\u793A\u30E1\u30CB\u30E5\u30FC -FileChooser.detailsViewActionLabelText=\u8A73\u7D30 -FileChooser.refreshActionLabelText=\u30EA\u30D5\u30EC\u30C3\u30B7\u30E5 -FileChooser.viewMenuLabelText=\u8868\u793A -FileChooser.fileNameHeaderText=\u540D\u524D -FileChooser.fileSizeHeaderText=\u30B5\u30A4\u30BA -FileChooser.fileTypeHeaderText=\u30BF\u30A4\u30D7 -FileChooser.fileDateHeaderText=\u4FEE\u6B63\u65E5 -FileChooser.fileAttrHeaderText=\u5C5E\u6027 +FileChooser.detailsViewActionLabel.textAndMnemonic=\u8A73\u7D30 +FileChooser.refreshActionLabel.textAndMnemonic=\u30EA\u30D5\u30EC\u30C3\u30B7\u30E5 +FileChooser.viewMenuLabel.textAndMnemonic=\u8868\u793A +FileChooser.fileNameHeader.textAndMnemonic=\u540D\u524D +FileChooser.fileSizeHeader.textAndMnemonic=\u30B5\u30A4\u30BA +FileChooser.fileTypeHeader.textAndMnemonic=\u30BF\u30A4\u30D7 +FileChooser.fileDateHeader.textAndMnemonic=\u4FEE\u6B63\u65E5 +FileChooser.fileAttrHeader.textAndMnemonic=\u5C5E\u6027 diff --git a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_ko.properties b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_ko.properties index 6922556c77ee0784017e5024c73560c784fbd751..94a1054bcefbef8706fc28569f7fde83819f4fd5 100644 --- a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_ko.properties +++ b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_ko.properties @@ -18,34 +18,30 @@ ############ FILE CHOOSER STRINGS ############# -FileChooser.lookInLabelText=\uAC80\uC0C9 \uC704\uCE58: -FileChooser.lookInLabelMnemonic=73 -FileChooser.saveInLabelText=\uC800\uC7A5 \uC704\uCE58: -FileChooser.fileNameLabelText=\uD30C\uC77C \uC774\uB984: -FileChooser.fileNameLabelMnemonic=78 -FileChooser.folderNameLabelText=\uD3F4\uB354 \uC774\uB984: -FileChooser.folderNameLabelMnemonic=78 -FileChooser.filesOfTypeLabelText=\uD30C\uC77C \uC720\uD615: -FileChooser.filesOfTypeLabelMnemonic=84 -FileChooser.upFolderToolTipText=\uD55C \uB808\uBCA8 \uC704\uB85C +FileChooser.lookInLabel.textAndMnemonic=\uAC80\uC0C9 \uC704\uCE58(&I): +FileChooser.saveInLabel.textAndMnemonic=\uC800\uC7A5 \uC704\uCE58: +FileChooser.fileNameLabel.textAndMnemonic=\uD30C\uC77C \uC774\uB984(&N): +FileChooser.folderNameLabel.textAndMnemonic=\uD3F4\uB354 \uC774\uB984(&N): +FileChooser.filesOfTypeLabel.textAndMnemonic=\uD30C\uC77C \uC720\uD615(&T): +FileChooser.upFolderToolTip.textAndMnemonic=\uD55C \uB808\uBCA8 \uC704\uB85C FileChooser.upFolderAccessibleName=\uC704\uB85C -FileChooser.homeFolderToolTipText=\uD648 +FileChooser.homeFolderToolTip.textAndMnemonic=\uD648 FileChooser.homeFolderAccessibleName=\uD648 -FileChooser.newFolderToolTipText=\uC0C8 \uD3F4\uB354 \uC0DD\uC131 +FileChooser.newFolderToolTip.textAndMnemonic=\uC0C8 \uD3F4\uB354 \uC0DD\uC131 FileChooser.newFolderAccessibleName=\uC0C8 \uD3F4\uB354 -FileChooser.newFolderActionLabelText=\uC0C8 \uD3F4\uB354 -FileChooser.listViewButtonToolTipText=\uBAA9\uB85D +FileChooser.newFolderActionLabel.textAndMnemonic=\uC0C8 \uD3F4\uB354 +FileChooser.listViewButtonToolTip.textAndMnemonic=\uBAA9\uB85D FileChooser.listViewButtonAccessibleName=\uBAA9\uB85D -FileChooser.listViewActionLabelText=\uBAA9\uB85D -FileChooser.detailsViewButtonToolTipText=\uC138\uBD80 \uC815\uBCF4 +FileChooser.listViewActionLabel.textAndMnemonic=\uBAA9\uB85D +FileChooser.detailsViewButtonToolTip.textAndMnemonic=\uC138\uBD80 \uC815\uBCF4 FileChooser.detailsViewButtonAccessibleName=\uC138\uBD80 \uC815\uBCF4 FileChooser.viewMenuButtonToolTipText = \uBCF4\uAE30 \uBA54\uB274 FileChooser.viewMenuButtonAccessibleName = \uBCF4\uAE30 \uBA54\uB274 -FileChooser.detailsViewActionLabelText=\uC138\uBD80 \uC815\uBCF4 -FileChooser.refreshActionLabelText=\uC0C8\uB85C \uACE0\uCE68 -FileChooser.viewMenuLabelText=\uBCF4\uAE30 -FileChooser.fileNameHeaderText=\uC774\uB984 -FileChooser.fileSizeHeaderText=\uD06C\uAE30 -FileChooser.fileTypeHeaderText=\uC720\uD615 -FileChooser.fileDateHeaderText=\uC218\uC815 \uB0A0\uC9DC -FileChooser.fileAttrHeaderText=\uC18D\uC131 +FileChooser.detailsViewActionLabel.textAndMnemonic=\uC138\uBD80 \uC815\uBCF4 +FileChooser.refreshActionLabel.textAndMnemonic=\uC0C8\uB85C \uACE0\uCE68 +FileChooser.viewMenuLabel.textAndMnemonic=\uBCF4\uAE30 +FileChooser.fileNameHeader.textAndMnemonic=\uC774\uB984 +FileChooser.fileSizeHeader.textAndMnemonic=\uD06C\uAE30 +FileChooser.fileTypeHeader.textAndMnemonic=\uC720\uD615 +FileChooser.fileDateHeader.textAndMnemonic=\uC218\uC815 \uB0A0\uC9DC +FileChooser.fileAttrHeader.textAndMnemonic=\uC18D\uC131 diff --git a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_pt_BR.properties b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_pt_BR.properties index 7faf8c19c80c385afba4035cc2910abe8b6774c5..44ecb60ed6e998b152f44efb0eb6c7119969ddfb 100644 --- a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_pt_BR.properties +++ b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_pt_BR.properties @@ -18,34 +18,30 @@ ############ FILE CHOOSER STRINGS ############# -FileChooser.lookInLabelText=Consultar em: -FileChooser.lookInLabelMnemonic=73 -FileChooser.saveInLabelText=Salvar em: -FileChooser.fileNameLabelText=Nome do arquivo: -FileChooser.fileNameLabelMnemonic=78 -FileChooser.folderNameLabelText=Nome da pasta: -FileChooser.folderNameLabelMnemonic=78 -FileChooser.filesOfTypeLabelText=Arquivos do tipo: -FileChooser.filesOfTypeLabelMnemonic=84 -FileChooser.upFolderToolTipText=Um N\u00EDvel Acima +FileChooser.lookInLabel.textAndMnemonic=Consultar em(&I): +FileChooser.saveInLabel.textAndMnemonic=Salvar em: +FileChooser.fileNameLabel.textAndMnemonic=&Nome do arquivo: +FileChooser.folderNameLabel.textAndMnemonic=&Nome da pasta: +FileChooser.filesOfTypeLabel.textAndMnemonic=Arquivos do &tipo: +FileChooser.upFolderToolTip.textAndMnemonic=Um N\u00EDvel Acima FileChooser.upFolderAccessibleName=Acima -FileChooser.homeFolderToolTipText=In\u00EDcio +FileChooser.homeFolderToolTip.textAndMnemonic=In\u00EDcio FileChooser.homeFolderAccessibleName=In\u00EDcio -FileChooser.newFolderToolTipText=Criar Nova Pasta +FileChooser.newFolderToolTip.textAndMnemonic=Criar Nova Pasta FileChooser.newFolderAccessibleName=Nova Pasta -FileChooser.newFolderActionLabelText=Nova Pasta -FileChooser.listViewButtonToolTipText=Lista +FileChooser.newFolderActionLabel.textAndMnemonic=Nova Pasta +FileChooser.listViewButtonToolTip.textAndMnemonic=Lista FileChooser.listViewButtonAccessibleName=Lista -FileChooser.listViewActionLabelText=Lista -FileChooser.detailsViewButtonToolTipText=Detalhes +FileChooser.listViewActionLabel.textAndMnemonic=Lista +FileChooser.detailsViewButtonToolTip.textAndMnemonic=Detalhes FileChooser.detailsViewButtonAccessibleName=Detalhes FileChooser.viewMenuButtonToolTipText = Exibir Menu FileChooser.viewMenuButtonAccessibleName = Exibir Menu -FileChooser.detailsViewActionLabelText=Detalhes -FileChooser.refreshActionLabelText=Atualizar -FileChooser.viewMenuLabelText=Exibir -FileChooser.fileNameHeaderText=Nome -FileChooser.fileSizeHeaderText=Tamanho -FileChooser.fileTypeHeaderText=Tipo -FileChooser.fileDateHeaderText=Modificado -FileChooser.fileAttrHeaderText=Atributos +FileChooser.detailsViewActionLabel.textAndMnemonic=Detalhes +FileChooser.refreshActionLabel.textAndMnemonic=Atualizar +FileChooser.viewMenuLabel.textAndMnemonic=Exibir +FileChooser.fileNameHeader.textAndMnemonic=Nome +FileChooser.fileSizeHeader.textAndMnemonic=Tamanho +FileChooser.fileTypeHeader.textAndMnemonic=Tipo +FileChooser.fileDateHeader.textAndMnemonic=Modificado +FileChooser.fileAttrHeader.textAndMnemonic=Atributos diff --git a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_sv.properties b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_sv.properties index 4e83498093f135b612f3e5516685a4fa6d8047b5..e44a096a29eaadc46ede1dcb612ddd75850553d1 100644 --- a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_sv.properties +++ b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_sv.properties @@ -18,34 +18,30 @@ ############ FILE CHOOSER STRINGS ############# -FileChooser.lookInLabelText=Leta i: -FileChooser.lookInLabelMnemonic=73 -FileChooser.saveInLabelText=Spara i: -FileChooser.fileNameLabelText=Filnamn: -FileChooser.fileNameLabelMnemonic=78 -FileChooser.folderNameLabelText=Mapp: -FileChooser.folderNameLabelMnemonic=78 -FileChooser.filesOfTypeLabelText=Filformat: -FileChooser.filesOfTypeLabelMnemonic=84 -FileChooser.upFolderToolTipText=Upp en niv\u00E5 +FileChooser.lookInLabel.textAndMnemonic=Leta &i: +FileChooser.saveInLabel.textAndMnemonic=Spara i: +FileChooser.fileNameLabel.textAndMnemonic=Fil&namn: +FileChooser.folderNameLabel.textAndMnemonic=Mapp(&N): +FileChooser.filesOfTypeLabel.textAndMnemonic=Filforma&t: +FileChooser.upFolderToolTip.textAndMnemonic=Upp en niv\u00E5 FileChooser.upFolderAccessibleName=Upp -FileChooser.homeFolderToolTipText=Hem +FileChooser.homeFolderToolTip.textAndMnemonic=Hem FileChooser.homeFolderAccessibleName=Hem -FileChooser.newFolderToolTipText=Skapa ny mapp +FileChooser.newFolderToolTip.textAndMnemonic=Skapa ny mapp FileChooser.newFolderAccessibleName=Ny mapp -FileChooser.newFolderActionLabelText=Ny mapp -FileChooser.listViewButtonToolTipText=Lista +FileChooser.newFolderActionLabel.textAndMnemonic=Ny mapp +FileChooser.listViewButtonToolTip.textAndMnemonic=Lista FileChooser.listViewButtonAccessibleName=Lista -FileChooser.listViewActionLabelText=Lista -FileChooser.detailsViewButtonToolTipText=Detaljer +FileChooser.listViewActionLabel.textAndMnemonic=Lista +FileChooser.detailsViewButtonToolTip.textAndMnemonic=Detaljer FileChooser.detailsViewButtonAccessibleName=Detaljer FileChooser.viewMenuButtonToolTipText = Menyn Visa FileChooser.viewMenuButtonAccessibleName = Menyn Visa -FileChooser.detailsViewActionLabelText=Detaljer -FileChooser.refreshActionLabelText=F\u00F6rnya -FileChooser.viewMenuLabelText=Vy -FileChooser.fileNameHeaderText=Namn -FileChooser.fileSizeHeaderText=Storlek -FileChooser.fileTypeHeaderText=Typ -FileChooser.fileDateHeaderText=\u00C4ndrad -FileChooser.fileAttrHeaderText=Attribut +FileChooser.detailsViewActionLabel.textAndMnemonic=Detaljer +FileChooser.refreshActionLabel.textAndMnemonic=F\u00F6rnya +FileChooser.viewMenuLabel.textAndMnemonic=Vy +FileChooser.fileNameHeader.textAndMnemonic=Namn +FileChooser.fileSizeHeader.textAndMnemonic=Storlek +FileChooser.fileTypeHeader.textAndMnemonic=Typ +FileChooser.fileDateHeader.textAndMnemonic=\u00C4ndrad +FileChooser.fileAttrHeader.textAndMnemonic=Attribut diff --git a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_zh_CN.properties b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_zh_CN.properties index 3a4c0cd6942087aff7a5767daa6a3240f22d89f7..3dfa7533aa3d2bfa9aeab1d45fc39efd95854695 100644 --- a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_zh_CN.properties +++ b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_zh_CN.properties @@ -18,34 +18,30 @@ ############ FILE CHOOSER STRINGS ############# -FileChooser.lookInLabelText=\u67E5\u770B: -FileChooser.lookInLabelMnemonic=73 -FileChooser.saveInLabelText=\u4FDD\u5B58: -FileChooser.fileNameLabelText=\u6587\u4EF6\u540D: -FileChooser.fileNameLabelMnemonic=78 -FileChooser.folderNameLabelText=\u6587\u4EF6\u5939\u540D: -FileChooser.folderNameLabelMnemonic=78 -FileChooser.filesOfTypeLabelText=\u6587\u4EF6\u7C7B\u578B: -FileChooser.filesOfTypeLabelMnemonic=84 -FileChooser.upFolderToolTipText=\u5411\u4E0A\u4E00\u7EA7 +FileChooser.lookInLabel.textAndMnemonic=\u67E5\u770B: (&I) +FileChooser.saveInLabel.textAndMnemonic=\u4FDD\u5B58: +FileChooser.fileNameLabel.textAndMnemonic=\u6587\u4EF6\u540D: (&N) +FileChooser.folderNameLabel.textAndMnemonic=\u6587\u4EF6\u5939\u540D: (&N) +FileChooser.filesOfTypeLabel.textAndMnemonic=\u6587\u4EF6\u7C7B\u578B: (&T) +FileChooser.upFolderToolTip.textAndMnemonic=\u5411\u4E0A\u4E00\u7EA7 FileChooser.upFolderAccessibleName=\u5411\u4E0A -FileChooser.homeFolderToolTipText=\u4E3B\u76EE\u5F55 +FileChooser.homeFolderToolTip.textAndMnemonic=\u4E3B\u76EE\u5F55 FileChooser.homeFolderAccessibleName=\u4E3B\u76EE\u5F55 -FileChooser.newFolderToolTipText=\u521B\u5EFA\u65B0\u6587\u4EF6\u5939 +FileChooser.newFolderToolTip.textAndMnemonic=\u521B\u5EFA\u65B0\u6587\u4EF6\u5939 FileChooser.newFolderAccessibleName=\u65B0\u5EFA\u6587\u4EF6\u5939 -FileChooser.newFolderActionLabelText=\u65B0\u5EFA\u6587\u4EF6\u5939 -FileChooser.listViewButtonToolTipText=\u5217\u8868 +FileChooser.newFolderActionLabel.textAndMnemonic=\u65B0\u5EFA\u6587\u4EF6\u5939 +FileChooser.listViewButtonToolTip.textAndMnemonic=\u5217\u8868 FileChooser.listViewButtonAccessibleName=\u5217\u8868 -FileChooser.listViewActionLabelText=\u5217\u8868 -FileChooser.detailsViewButtonToolTipText=\u8BE6\u7EC6\u8D44\u6599 +FileChooser.listViewActionLabel.textAndMnemonic=\u5217\u8868 +FileChooser.detailsViewButtonToolTip.textAndMnemonic=\u8BE6\u7EC6\u8D44\u6599 FileChooser.detailsViewButtonAccessibleName=\u8BE6\u7EC6\u8D44\u6599 FileChooser.viewMenuButtonToolTipText = \u67E5\u770B\u83DC\u5355 FileChooser.viewMenuButtonAccessibleName = \u67E5\u770B\u83DC\u5355 -FileChooser.detailsViewActionLabelText=\u8BE6\u7EC6\u8D44\u6599 -FileChooser.refreshActionLabelText=\u5237\u65B0 -FileChooser.viewMenuLabelText=\u89C6\u56FE -FileChooser.fileNameHeaderText=\u540D\u79F0 -FileChooser.fileSizeHeaderText=\u5927\u5C0F -FileChooser.fileTypeHeaderText=\u7C7B\u578B -FileChooser.fileDateHeaderText=\u4FEE\u6539\u65E5\u671F -FileChooser.fileAttrHeaderText=\u5C5E\u6027 +FileChooser.detailsViewActionLabel.textAndMnemonic=\u8BE6\u7EC6\u8D44\u6599 +FileChooser.refreshActionLabel.textAndMnemonic=\u5237\u65B0 +FileChooser.viewMenuLabel.textAndMnemonic=\u89C6\u56FE +FileChooser.fileNameHeader.textAndMnemonic=\u540D\u79F0 +FileChooser.fileSizeHeader.textAndMnemonic=\u5927\u5C0F +FileChooser.fileTypeHeader.textAndMnemonic=\u7C7B\u578B +FileChooser.fileDateHeader.textAndMnemonic=\u4FEE\u6539\u65E5\u671F +FileChooser.fileAttrHeader.textAndMnemonic=\u5C5E\u6027 diff --git a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_zh_TW.properties b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_zh_TW.properties index e4c8ad0c081b852b9a96b0b92182f44e08bacdbb..099caadda8c486d8f31b5c7eaf5251fa0fd65a10 100644 --- a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_zh_TW.properties +++ b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_zh_TW.properties @@ -18,34 +18,30 @@ ############ FILE CHOOSER STRINGS ############# -FileChooser.lookInLabelText=\u67E5\u8A62: -FileChooser.lookInLabelMnemonic=73 -FileChooser.saveInLabelText=\u5132\u5B58\u65BC: -FileChooser.fileNameLabelText=\u6A94\u6848\u540D\u7A31: -FileChooser.fileNameLabelMnemonic=78 -FileChooser.folderNameLabelText=\u8CC7\u6599\u593E\u540D\u7A31: -FileChooser.folderNameLabelMnemonic=78 -FileChooser.filesOfTypeLabelText=\u6A94\u6848\u985E\u578B: -FileChooser.filesOfTypeLabelMnemonic=84 -FileChooser.upFolderToolTipText=\u5F80\u4E0A\u4E00\u5C64 +FileChooser.lookInLabel.textAndMnemonic=\u67E5\u8A62(&I): +FileChooser.saveInLabel.textAndMnemonic=\u5132\u5B58\u65BC: +FileChooser.fileNameLabel.textAndMnemonic=\u6A94\u6848\u540D\u7A31(&N): +FileChooser.folderNameLabel.textAndMnemonic=\u8CC7\u6599\u593E\u540D\u7A31(&N): +FileChooser.filesOfTypeLabel.textAndMnemonic=\u6A94\u6848\u985E\u578B(&T): +FileChooser.upFolderToolTip.textAndMnemonic=\u5F80\u4E0A\u4E00\u5C64 FileChooser.upFolderAccessibleName=\u5F80\u4E0A -FileChooser.homeFolderToolTipText=\u4E3B\u76EE\u9304 +FileChooser.homeFolderToolTip.textAndMnemonic=\u4E3B\u76EE\u9304 FileChooser.homeFolderAccessibleName=\u4E3B\u76EE\u9304 -FileChooser.newFolderToolTipText=\u5EFA\u7ACB\u65B0\u8CC7\u6599\u593E +FileChooser.newFolderToolTip.textAndMnemonic=\u5EFA\u7ACB\u65B0\u8CC7\u6599\u593E FileChooser.newFolderAccessibleName=\u65B0\u8CC7\u6599\u593E -FileChooser.newFolderActionLabelText=\u65B0\u8CC7\u6599\u593E -FileChooser.listViewButtonToolTipText=\u6E05\u55AE +FileChooser.newFolderActionLabel.textAndMnemonic=\u65B0\u8CC7\u6599\u593E +FileChooser.listViewButtonToolTip.textAndMnemonic=\u6E05\u55AE FileChooser.listViewButtonAccessibleName=\u6E05\u55AE -FileChooser.listViewActionLabelText=\u6E05\u55AE -FileChooser.detailsViewButtonToolTipText=\u8A73\u7D30\u8CC7\u8A0A +FileChooser.listViewActionLabel.textAndMnemonic=\u6E05\u55AE +FileChooser.detailsViewButtonToolTip.textAndMnemonic=\u8A73\u7D30\u8CC7\u8A0A FileChooser.detailsViewButtonAccessibleName=\u8A73\u7D30\u8CC7\u8A0A FileChooser.viewMenuButtonToolTipText = \u6AA2\u8996\u529F\u80FD\u8868 FileChooser.viewMenuButtonAccessibleName = \u6AA2\u8996\u529F\u80FD\u8868 -FileChooser.detailsViewActionLabelText=\u8A73\u7D30\u8CC7\u8A0A -FileChooser.refreshActionLabelText=\u91CD\u65B0\u6574\u7406 -FileChooser.viewMenuLabelText=\u6AA2\u8996 -FileChooser.fileNameHeaderText=\u540D\u7A31 -FileChooser.fileSizeHeaderText=\u5927\u5C0F -FileChooser.fileTypeHeaderText=\u985E\u578B -FileChooser.fileDateHeaderText=\u4FEE\u6539\u65E5\u671F -FileChooser.fileAttrHeaderText=\u5C6C\u6027 +FileChooser.detailsViewActionLabel.textAndMnemonic=\u8A73\u7D30\u8CC7\u8A0A +FileChooser.refreshActionLabel.textAndMnemonic=\u91CD\u65B0\u6574\u7406 +FileChooser.viewMenuLabel.textAndMnemonic=\u6AA2\u8996 +FileChooser.fileNameHeader.textAndMnemonic=\u540D\u7A31 +FileChooser.fileSizeHeader.textAndMnemonic=\u5927\u5C0F +FileChooser.fileTypeHeader.textAndMnemonic=\u985E\u578B +FileChooser.fileDateHeader.textAndMnemonic=\u4FEE\u6539\u65E5\u671F +FileChooser.fileAttrHeader.textAndMnemonic=\u5C6C\u6027 diff --git a/src/share/classes/java/awt/Component.java b/src/share/classes/java/awt/Component.java index 63fe2a80be99c2d3d1688a7a2b876ec0d9d4b758..df80032a1a983c31ef51a740672d79c2228db722 100644 --- a/src/share/classes/java/awt/Component.java +++ b/src/share/classes/java/awt/Component.java @@ -7169,6 +7169,9 @@ public abstract class Component implements ImageObserver, MenuContainer, * Set from its parent. If all ancestors of this Component have null * specified for the Set, then the current KeyboardFocusManager's default * Set is used. + *

+ * This method may throw a {@code ClassCastException} if any {@code Object} + * in {@code keystrokes} is not an {@code AWTKeyStroke}. * * @param id one of KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, * KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, or @@ -7182,8 +7185,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, * KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, or * KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS, or if keystrokes - * contains null, or if any Object in keystrokes is not an - * AWTKeyStroke, or if any keystroke represents a KEY_TYPED event, + * contains null, or if any keystroke represents a KEY_TYPED event, * or if any keystroke already maps to another focus traversal * operation for this Component * @since 1.4 @@ -7831,7 +7833,7 @@ public abstract class Component implements ImageObserver, MenuContainer, if (focusLog.isLoggable(PlatformLogger.FINER)) { focusLog.finer("clear global focus owner"); } - KeyboardFocusManager.getCurrentKeyboardFocusManager().clearGlobalFocusOwner(); + KeyboardFocusManager.getCurrentKeyboardFocusManager().clearGlobalFocusOwnerPriv(); } if (focusLog.isLoggable(PlatformLogger.FINER)) { focusLog.finer("returning result: " + res); @@ -7912,7 +7914,7 @@ public abstract class Component implements ImageObserver, MenuContainer, if (focusLog.isLoggable(PlatformLogger.FINER)) { focusLog.finer("clear global focus owner"); } - KeyboardFocusManager.getCurrentKeyboardFocusManager().clearGlobalFocusOwner(); + KeyboardFocusManager.getCurrentKeyboardFocusManager().clearGlobalFocusOwnerPriv(); } if (focusLog.isLoggable(PlatformLogger.FINER)) { focusLog.finer("returning result: " + res); @@ -7945,11 +7947,11 @@ public abstract class Component implements ImageObserver, MenuContainer, if (rootAncestor != null) { Container rootAncestorRootAncestor = rootAncestor.getFocusCycleRootAncestor(); + Container fcr = (rootAncestorRootAncestor != null) ? + rootAncestorRootAncestor : rootAncestor; + KeyboardFocusManager.getCurrentKeyboardFocusManager(). - setGlobalCurrentFocusCycleRoot( - (rootAncestorRootAncestor != null) - ? rootAncestorRootAncestor - : rootAncestor); + setGlobalCurrentFocusCycleRootPriv(fcr); rootAncestor.requestFocus(CausedFocusEvent.Cause.TRAVERSAL_UP); } else { Window window = getContainingWindow(); @@ -7959,7 +7961,7 @@ public abstract class Component implements ImageObserver, MenuContainer, getDefaultComponent(window); if (toFocus != null) { KeyboardFocusManager.getCurrentKeyboardFocusManager(). - setGlobalCurrentFocusCycleRoot(window); + setGlobalCurrentFocusCycleRootPriv(window); toFocus.requestFocus(CausedFocusEvent.Cause.TRAVERSAL_UP); } } diff --git a/src/share/classes/java/awt/Container.java b/src/share/classes/java/awt/Container.java index 03b0f7faa04fb48fd0163cefc91a54992ad68906..65c7ceaec5fed944b027b9ba9e4693f44c2aa788 100644 --- a/src/share/classes/java/awt/Container.java +++ b/src/share/classes/java/awt/Container.java @@ -3093,6 +3093,9 @@ public class Container extends Component { * Set from its parent. If all ancestors of this Container have null * specified for the Set, then the current KeyboardFocusManager's default * Set is used. + *

+ * This method may throw a {@code ClassCastException} if any {@code Object} + * in {@code keystrokes} is not an {@code AWTKeyStroke}. * * @param id one of KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, * KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, @@ -3109,8 +3112,7 @@ public class Container extends Component { * KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, * KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS, or * KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS, or if keystrokes - * contains null, or if any Object in keystrokes is not an - * AWTKeyStroke, or if any keystroke represents a KEY_TYPED event, + * contains null, or if any keystroke represents a KEY_TYPED event, * or if any keystroke already maps to another focus traversal * operation for this Container * @since 1.4 @@ -3243,7 +3245,7 @@ public class Container extends Component { if (root != currentFocusCycleRoot) { KeyboardFocusManager.getCurrentKeyboardFocusManager(). - setGlobalCurrentFocusCycleRoot(root); + setGlobalCurrentFocusCycleRootPriv(root); } return root; } @@ -3300,7 +3302,7 @@ public class Container extends Component { Container cont = kfm.getCurrentFocusCycleRoot(); if (cont == this || isParentOf(cont)) { - kfm.setGlobalCurrentFocusCycleRoot(null); + kfm.setGlobalCurrentFocusCycleRootPriv(null); } } @@ -3504,7 +3506,7 @@ public class Container extends Component { public void transferFocusDownCycle() { if (isFocusCycleRoot()) { KeyboardFocusManager.getCurrentKeyboardFocusManager(). - setGlobalCurrentFocusCycleRoot(this); + setGlobalCurrentFocusCycleRootPriv(this); Component toFocus = getFocusTraversalPolicy(). getDefaultComponent(this); if (toFocus != null) { diff --git a/src/share/classes/java/awt/DefaultKeyboardFocusManager.java b/src/share/classes/java/awt/DefaultKeyboardFocusManager.java index 4f9ef90f5a4491bee4c1191134b54a40932312de..109e70d9d8a69eea661f02f06e60ee0ef6c6c6c1 100644 --- a/src/share/classes/java/awt/DefaultKeyboardFocusManager.java +++ b/src/share/classes/java/awt/DefaultKeyboardFocusManager.java @@ -116,7 +116,7 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager { } else if (fe.getOppositeComponent() != null && doRestoreFocus(fe.getOppositeComponent(), vetoedComponent, false)) { } else { - clearGlobalFocusOwner(); + clearGlobalFocusOwnerPriv(); } } private void restoreFocus(WindowEvent we) { @@ -130,7 +130,7 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager { { // do nothing, everything is done in restoreFocus() } else { - clearGlobalFocusOwner(); + clearGlobalFocusOwnerPriv(); } } private boolean restoreFocus(Window aWindow, Component vetoedComponent, @@ -141,7 +141,7 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager { if (toFocus != null && toFocus != vetoedComponent && doRestoreFocus(toFocus, vetoedComponent, false)) { return true; } else if (clearOnFailure) { - clearGlobalFocusOwner(); + clearGlobalFocusOwnerPriv(); return true; } else { return false; @@ -164,7 +164,7 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager { { return true; } else if (clearOnFailure) { - clearGlobalFocusOwner(); + clearGlobalFocusOwnerPriv(); return true; } else { return false; diff --git a/src/share/classes/java/awt/Dialog.java b/src/share/classes/java/awt/Dialog.java index a388c70e7f5dffaee097e6116109ddc47aab84e3..47f2f221c0d4ecadd59b557d555128415a2c03f7 100644 --- a/src/share/classes/java/awt/Dialog.java +++ b/src/share/classes/java/awt/Dialog.java @@ -670,7 +670,7 @@ public class Dialog extends Window { this.title = title; setModalityType(modalityType); - SunToolkit.checkAndSetPolicy(this, false); + SunToolkit.checkAndSetPolicy(this); } /** @@ -721,7 +721,7 @@ public class Dialog extends Window { this.title = title; setModalityType(modalityType); - SunToolkit.checkAndSetPolicy(this, false); + SunToolkit.checkAndSetPolicy(this); } /** @@ -1037,7 +1037,7 @@ public class Dialog extends Window { predictedFocusOwner = getMostRecentFocusOwner(); if (conditionalShow(predictedFocusOwner, time)) { modalFilter = ModalEventFilter.createFilterForDialog(this); - Conditional cond = new Conditional() { + final Conditional cond = new Conditional() { @Override public boolean evaluate() { return windowClosingException == null; @@ -1067,7 +1067,12 @@ public class Dialog extends Window { modalityPushed(); try { - EventQueue eventQueue = Toolkit.getDefaultToolkit().getSystemEventQueue(); + final EventQueue eventQueue = AccessController.doPrivileged( + new PrivilegedAction() { + public EventQueue run() { + return Toolkit.getDefaultToolkit().getSystemEventQueue(); + } + }); secondaryLoop = eventQueue.createSecondaryLoop(cond, modalFilter, 0); if (!secondaryLoop.enter()) { secondaryLoop = null; diff --git a/src/share/classes/java/awt/FileDialog.java b/src/share/classes/java/awt/FileDialog.java index ebff2c45fee3e6a31821ba5c1b37ceb04348298f..3739570abb521d3f93073cafb604e12d893c2c78 100644 --- a/src/share/classes/java/awt/FileDialog.java +++ b/src/share/classes/java/awt/FileDialog.java @@ -147,8 +147,8 @@ public class FileDialog extends Dialog { static { AWTAccessor.setFileDialogAccessor( new AWTAccessor.FileDialogAccessor() { - public void setFiles(FileDialog fileDialog, String directory, String files[]) { - fileDialog.setFiles(directory, files); + public void setFiles(FileDialog fileDialog, File files[]) { + fileDialog.setFiles(files); } public void setFile(FileDialog fileDialog, String file) { fileDialog.file = ("".equals(file)) ? null : file; @@ -446,13 +446,9 @@ public class FileDialog extends Dialog { * @see #getFiles * @since 1.7 */ - private void setFiles(String directory, String files[]) { + private void setFiles(File files[]) { synchronized (getObjectLock()) { - int filesNumber = (files != null) ? files.length : 0; - this.files = new File[filesNumber]; - for (int i = 0; i < filesNumber; i++) { - this.files[i] = new File(directory, files[i]); - } + this.files = files; } } diff --git a/src/share/classes/java/awt/Frame.java b/src/share/classes/java/awt/Frame.java index 4c6a46938c2dc9bdceaf110571e8ef00fbdf2c11..1a3173730e5ea28344fb8dd2aa37d850cb0be3c0 100644 --- a/src/share/classes/java/awt/Frame.java +++ b/src/share/classes/java/awt/Frame.java @@ -449,7 +449,7 @@ public class Frame extends Window implements MenuContainer { private void init(String title, GraphicsConfiguration gc) { this.title = title; - SunToolkit.checkAndSetPolicy(this, false); + SunToolkit.checkAndSetPolicy(this); } /** diff --git a/src/share/classes/java/awt/KeyboardFocusManager.java b/src/share/classes/java/awt/KeyboardFocusManager.java index 3ccf5b70d3603dce872ccadec18049c52d9d61e3..5e7792a26d8de02fd866eaafe0af687863c48a20 100644 --- a/src/share/classes/java/awt/KeyboardFocusManager.java +++ b/src/share/classes/java/awt/KeyboardFocusManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -246,15 +246,7 @@ public abstract class KeyboardFocusManager public static void setCurrentKeyboardFocusManager( KeyboardFocusManager newManager) throws SecurityException { - SecurityManager security = System.getSecurityManager(); - if (security != null) { - if (replaceKeyboardFocusManagerPermission == null) { - replaceKeyboardFocusManagerPermission = - new AWTPermission("replaceKeyboardFocusManager"); - } - security. - checkPermission(replaceKeyboardFocusManagerPermission); - } + checkReplaceKFMPermission(); KeyboardFocusManager oldManager = null; @@ -398,11 +390,6 @@ public abstract class KeyboardFocusManager */ private static java.util.Map mostRecentFocusOwners = new WeakHashMap(); - /** - * Error String for initializing SecurityExceptions. - */ - private static final String notPrivileged = "this KeyboardFocusManager is not installed in the current thread's context"; - /** * We cache the permission used to verify that the calling thread is * permitted to access the global focus state. @@ -503,17 +490,13 @@ public abstract class KeyboardFocusManager * @see #setGlobalFocusOwner * @throws SecurityException if this KeyboardFocusManager is not the * current KeyboardFocusManager for the calling thread's context + * and if the calling thread does not have "replaceKeyboardFocusManager" + * permission */ protected Component getGlobalFocusOwner() throws SecurityException { synchronized (KeyboardFocusManager.class) { - if (this == getCurrentKeyboardFocusManager()) { - return focusOwner; - } else { - if (focusLog.isLoggable(PlatformLogger.FINER)) { - focusLog.finer("This manager is " + this + ", current is " + getCurrentKeyboardFocusManager()); - } - throw new SecurityException(notPrivileged); - } + checkKFMSecurity(); + return focusOwner; } } @@ -538,15 +521,23 @@ public abstract class KeyboardFocusManager * @see Component#requestFocus() * @see Component#requestFocusInWindow() * @see Component#isFocusable + * @throws SecurityException if this KeyboardFocusManager is not the + * current KeyboardFocusManager for the calling thread's context + * and if the calling thread does not have "replaceKeyboardFocusManager" + * permission * @beaninfo * bound: true */ - protected void setGlobalFocusOwner(Component focusOwner) { + protected void setGlobalFocusOwner(Component focusOwner) + throws SecurityException + { Component oldFocusOwner = null; boolean shouldFire = false; if (focusOwner == null || focusOwner.isFocusable()) { synchronized (KeyboardFocusManager.class) { + checkKFMSecurity(); + oldFocusOwner = getFocusOwner(); try { @@ -583,6 +574,27 @@ public abstract class KeyboardFocusManager } } + /** + * Clears the focus owner at both the Java and native levels if the + * focus owner exists and resides in the same context as the calling thread, + * otherwise the method returns silently. + *

+ * The focus owner component will receive a permanent FOCUS_LOST event. + * After this operation completes, the native windowing system will discard + * all user-generated KeyEvents until the user selects a new Component to + * receive focus, or a Component is given focus explicitly via a call to + * {@code requestFocus()}. This operation does not change the focused or + * active Windows. + * + * @see Component#requestFocus() + * @see java.awt.event.FocusEvent#FOCUS_LOST + */ + public void clearFocusOwner() { + if (getFocusOwner() != null) { + clearGlobalFocusOwner(); + } + } + /** * Clears the global focus owner at both the Java and native levels. If * there exists a focus owner, that Component will receive a permanent @@ -591,11 +603,26 @@ public abstract class KeyboardFocusManager * a new Component to receive focus, or a Component is given focus * explicitly via a call to requestFocus(). This operation * does not change the focused or active Windows. + *

+ * If a SecurityManager is installed, the calling thread must be granted + * the "replaceKeyboardFocusManager" AWTPermission. If this permission is + * not granted, this method will throw a SecurityException, and the current + * focus owner will not be cleared. + *

+ * This method is intended to be used only by KeyboardFocusManager set as + * current KeyboardFocusManager for the calling thread's context. It is not + * for general client use. * + * @see KeyboardFocusManager#clearFocusOwner * @see Component#requestFocus() * @see java.awt.event.FocusEvent#FOCUS_LOST + * @throws SecurityException if the calling thread does not have + * "replaceKeyboardFocusManager" permission */ - public void clearGlobalFocusOwner() { + public void clearGlobalFocusOwner() + throws SecurityException + { + checkReplaceKFMPermission(); if (!GraphicsEnvironment.isHeadless()) { // Toolkit must be fully initialized, otherwise // _clearGlobalFocusOwner will crash or throw an exception @@ -609,6 +636,15 @@ public abstract class KeyboardFocusManager peer.clearGlobalFocusOwner(activeWindow); } + void clearGlobalFocusOwnerPriv() { + AccessController.doPrivileged(new PrivilegedAction() { + public Void run() { + clearGlobalFocusOwner(); + return null; + } + }); + } + Component getNativeFocusOwner() { return peer.getCurrentFocusOwner(); } @@ -660,29 +696,21 @@ public abstract class KeyboardFocusManager * are equivalent unless a temporary focus change is currently in effect. * In such a situation, the permanent focus owner will again be the focus * owner when the temporary focus change ends. - *

- * This method will throw a SecurityException if this KeyboardFocusManager - * is not the current KeyboardFocusManager for the calling thread's - * context. * * @return the permanent focus owner * @see #getPermanentFocusOwner * @see #setGlobalPermanentFocusOwner * @throws SecurityException if this KeyboardFocusManager is not the * current KeyboardFocusManager for the calling thread's context + * and if the calling thread does not have "replaceKeyboardFocusManager" + * permission */ protected Component getGlobalPermanentFocusOwner() throws SecurityException { synchronized (KeyboardFocusManager.class) { - if (this == getCurrentKeyboardFocusManager()) { - return permanentFocusOwner; - } else { - if (focusLog.isLoggable(PlatformLogger.FINER)) { - focusLog.finer("This manager is " + this + ", current is " + getCurrentKeyboardFocusManager()); - } - throw new SecurityException(notPrivileged); - } + checkKFMSecurity(); + return permanentFocusOwner; } } @@ -708,16 +736,23 @@ public abstract class KeyboardFocusManager * @see Component#requestFocus() * @see Component#requestFocusInWindow() * @see Component#isFocusable + * @throws SecurityException if this KeyboardFocusManager is not the + * current KeyboardFocusManager for the calling thread's context + * and if the calling thread does not have "replaceKeyboardFocusManager" + * permission * @beaninfo * bound: true */ protected void setGlobalPermanentFocusOwner(Component permanentFocusOwner) + throws SecurityException { Component oldPermanentFocusOwner = null; boolean shouldFire = false; if (permanentFocusOwner == null || permanentFocusOwner.isFocusable()) { synchronized (KeyboardFocusManager.class) { + checkKFMSecurity(); + oldPermanentFocusOwner = getPermanentFocusOwner(); try { @@ -770,27 +805,19 @@ public abstract class KeyboardFocusManager * Returns the focused Window, even if the calling thread is in a different * context than the focused Window. The focused Window is the Window that * is or contains the focus owner. - *

- * This method will throw a SecurityException if this KeyboardFocusManager - * is not the current KeyboardFocusManager for the calling thread's - * context. * * @return the focused Window * @see #getFocusedWindow * @see #setGlobalFocusedWindow * @throws SecurityException if this KeyboardFocusManager is not the * current KeyboardFocusManager for the calling thread's context + * and if the calling thread does not have "replaceKeyboardFocusManager" + * permission */ protected Window getGlobalFocusedWindow() throws SecurityException { synchronized (KeyboardFocusManager.class) { - if (this == getCurrentKeyboardFocusManager()) { - return focusedWindow; - } else { - if (focusLog.isLoggable(PlatformLogger.FINER)) { - focusLog.finer("This manager is " + this + ", current is " + getCurrentKeyboardFocusManager()); - } - throw new SecurityException(notPrivileged); - } + checkKFMSecurity(); + return focusedWindow; } } @@ -812,15 +839,23 @@ public abstract class KeyboardFocusManager * @see Component#requestFocus() * @see Component#requestFocusInWindow() * @see Window#isFocusableWindow + * @throws SecurityException if this KeyboardFocusManager is not the + * current KeyboardFocusManager for the calling thread's context + * and if the calling thread does not have "replaceKeyboardFocusManager" + * permission * @beaninfo * bound: true */ - protected void setGlobalFocusedWindow(Window focusedWindow) { + protected void setGlobalFocusedWindow(Window focusedWindow) + throws SecurityException + { Window oldFocusedWindow = null; boolean shouldFire = false; if (focusedWindow == null || focusedWindow.isFocusableWindow()) { synchronized (KeyboardFocusManager.class) { + checkKFMSecurity(); + oldFocusedWindow = getFocusedWindow(); try { @@ -874,27 +909,19 @@ public abstract class KeyboardFocusManager * or its children with special decorations, such as a highlighted title * bar. The active Window is always either the focused Window, or the first * Frame or Dialog that is an owner of the focused Window. - *

- * This method will throw a SecurityException if this KeyboardFocusManager - * is not the current KeyboardFocusManager for the calling thread's - * context. * * @return the active Window * @see #getActiveWindow * @see #setGlobalActiveWindow * @throws SecurityException if this KeyboardFocusManager is not the * current KeyboardFocusManager for the calling thread's context + * and if the calling thread does not have "replaceKeyboardFocusManager" + * permission */ protected Window getGlobalActiveWindow() throws SecurityException { synchronized (KeyboardFocusManager.class) { - if (this == getCurrentKeyboardFocusManager()) { - return activeWindow; - } else { - if (focusLog.isLoggable(PlatformLogger.FINER)) { - focusLog.finer("This manager is " + this + ", current is " + getCurrentKeyboardFocusManager()); - } - throw new SecurityException(notPrivileged); - } + checkKFMSecurity(); + return activeWindow; } } @@ -917,12 +944,20 @@ public abstract class KeyboardFocusManager * @see #getGlobalActiveWindow * @see Component#requestFocus() * @see Component#requestFocusInWindow() + * @throws SecurityException if this KeyboardFocusManager is not the + * current KeyboardFocusManager for the calling thread's context + * and if the calling thread does not have "replaceKeyboardFocusManager" + * permission * @beaninfo * bound: true */ - protected void setGlobalActiveWindow(Window activeWindow) { + protected void setGlobalActiveWindow(Window activeWindow) + throws SecurityException + { Window oldActiveWindow; synchronized (KeyboardFocusManager.class) { + checkKFMSecurity(); + oldActiveWindow = getActiveWindow(); if (focusLog.isLoggable(PlatformLogger.FINER)) { focusLog.finer("Setting global active window to " + activeWindow + ", old active " + oldActiveWindow); @@ -991,12 +1026,12 @@ public abstract class KeyboardFocusManager /** * Sets the default focus traversal keys for a given traversal operation. - * This traversal key Set will be in effect on all - * Windows that have no such Set of - * their own explicitly defined. This Set will also be - * inherited, recursively, by any child Component of - * those Windows that has - * no such Set of its own explicitly defined. + * This traversal key {@code Set} will be in effect on all + * {@code Window}s that have no such {@code Set} of + * their own explicitly defined. This {@code Set} will also be + * inherited, recursively, by any child {@code Component} of + * those {@code Windows} that has + * no such {@code Set} of its own explicitly defined. *

* The default values for the default focus traversal keys are * implementation-dependent. Sun recommends that all implementations for a @@ -1011,66 +1046,67 @@ public abstract class KeyboardFocusManager * Default * * - * KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS + * {@code KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS} * Normal forward keyboard traversal - * TAB on KEY_PRESSED, - * CTRL-TAB on KEY_PRESSED + * {@code TAB} on {@code KEY_PRESSED}, + * {@code CTRL-TAB} on {@code KEY_PRESSED} * * - * KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS + * {@code KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS} * Normal reverse keyboard traversal - * SHIFT-TAB on KEY_PRESSED, - * CTRL-SHIFT-TAB on KEY_PRESSED + * {@code SHIFT-TAB} on {@code KEY_PRESSED}, + * {@code CTRL-SHIFT-TAB} on {@code KEY_PRESSED} * * - * KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS + * {@code KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS} * Go up one focus traversal cycle * none * * - * KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS + * {@code KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS} * Go down one focus traversal cycle * none * * * - * To disable a traversal key, use an empty Set; - * Collections.EMPTY_SET is recommended. + * To disable a traversal key, use an empty {@code Set}; + * {@code Collections.EMPTY_SET} is recommended. *

- * Using the AWTKeyStroke API, client code can + * Using the {@code AWTKeyStroke} API, client code can * specify on which of two - * specific KeyEvents, KEY_PRESSED or - * KEY_RELEASED, the focus traversal operation will - * occur. Regardless of which KeyEvent is specified, - * however, all KeyEvents related to the focus - * traversal key, including the associated KEY_TYPED + * specific {@code KeyEvent}s, {@code KEY_PRESSED} or + * {@code KEY_RELEASED}, the focus traversal operation will + * occur. Regardless of which {@code KeyEvent} is specified, + * however, all {@code KeyEvent}s related to the focus + * traversal key, including the associated {@code KEY_TYPED} * event, will be consumed, and will not be dispatched - * to any Component. It is a runtime error to - * specify a KEY_TYPED event as + * to any {@code Component}. It is a runtime error to + * specify a {@code KEY_TYPED} event as * mapping to a focus traversal operation, or to map the same event to * multiple default focus traversal operations. + *

+ * This method may throw a {@code ClassCastException} if any {@code Object} + * in {@code keystrokes} is not an {@code AWTKeyStroke}. * * @param id one of - * KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, - * KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, - * KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS, or - * KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS - * @param keystrokes the Set of AWTKeyStrokes for the + * {@code KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS}, + * {@code KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS}, + * {@code KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS}, or + * {@code KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS} + * @param keystrokes the Set of {@code AWTKeyStroke}s for the * specified operation * @see #getDefaultFocusTraversalKeys * @see Component#setFocusTraversalKeys * @see Component#getFocusTraversalKeys * @throws IllegalArgumentException if id is not one of - * KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, - * KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, - * KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS, or - * KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS, - * or if keystrokes is null, - * or if keystrokes contains null, - * or if any Object in - * keystrokes is not an AWTKeyStroke, + * {@code KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS}, + * {@code KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS}, + * {@code KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS}, or + * {@code KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS}, + * or if keystrokes is {@code null}, + * or if keystrokes contains {@code null}, * or if any keystroke - * represents a KEY_TYPED event, + * represents a {@code KEY_TYPED} event, * or if any keystroke already maps * to another default focus traversal operation * @beaninfo @@ -1090,20 +1126,12 @@ public abstract class KeyboardFocusManager Set oldKeys; synchronized (this) { - for (Iterator iter = keystrokes.iterator(); iter.hasNext(); ) { - Object obj = iter.next(); + for (AWTKeyStroke keystroke : keystrokes) { - if (obj == null) { + if (keystroke == null) { throw new IllegalArgumentException("cannot set null focus traversal key"); } - // Fix for 6195831: - //According to javadoc this method should throw IAE instead of ClassCastException - if (!(obj instanceof AWTKeyStroke)) { - throw new IllegalArgumentException("object is expected to be AWTKeyStroke"); - } - AWTKeyStroke keystroke = (AWTKeyStroke)obj; - if (keystroke.getKeyChar() != KeyEvent.CHAR_UNDEFINED) { throw new IllegalArgumentException("focus traversal keys cannot map to KEY_TYPED events"); } @@ -1201,10 +1229,6 @@ public abstract class KeyboardFocusManager * Components represent the next and previous Components to focus during * normal focus traversal. In that case, the current focus cycle root is * used to differentiate among the possibilities. - *

- * This method will throw a SecurityException if this KeyboardFocusManager - * is not the current KeyboardFocusManager for the calling thread's - * context. * * @return the current focus cycle root, or null if the current focus cycle * root is not a member of the calling thread's context @@ -1212,19 +1236,15 @@ public abstract class KeyboardFocusManager * @see #setGlobalCurrentFocusCycleRoot * @throws SecurityException if this KeyboardFocusManager is not the * current KeyboardFocusManager for the calling thread's context + * and if the calling thread does not have "replaceKeyboardFocusManager" + * permission */ protected Container getGlobalCurrentFocusCycleRoot() throws SecurityException { synchronized (KeyboardFocusManager.class) { - if (this == getCurrentKeyboardFocusManager()) { - return currentFocusCycleRoot; - } else { - if (focusLog.isLoggable(PlatformLogger.FINER)) { - focusLog.finer("This manager is " + this + ", current is " + getCurrentKeyboardFocusManager()); - } - throw new SecurityException(notPrivileged); - } + checkKFMSecurity(); + return currentFocusCycleRoot; } } @@ -1235,16 +1255,27 @@ public abstract class KeyboardFocusManager * In that case, the current focus cycle root is used to differentiate * among the possibilities. *

+ * If a SecurityManager is installed, the calling thread must be granted + * the "replaceKeyboardFocusManager" AWTPermission. If this permission is + * not granted, this method will throw a SecurityException, and the current + * focus cycle root will not be changed. + *

* This method is intended to be used only by KeyboardFocusManagers and * focus implementations. It is not for general client use. * * @param newFocusCycleRoot the new focus cycle root * @see #getCurrentFocusCycleRoot * @see #getGlobalCurrentFocusCycleRoot + * @throws SecurityException if the calling thread does not have + * "replaceKeyboardFocusManager" permission * @beaninfo * bound: true */ - public void setGlobalCurrentFocusCycleRoot(Container newFocusCycleRoot) { + public void setGlobalCurrentFocusCycleRoot(Container newFocusCycleRoot) + throws SecurityException + { + checkReplaceKFMPermission(); + Container oldFocusCycleRoot; synchronized (KeyboardFocusManager.class) { @@ -1256,6 +1287,15 @@ public abstract class KeyboardFocusManager newFocusCycleRoot); } + void setGlobalCurrentFocusCycleRootPriv(final Container newFocusCycleRoot) { + AccessController.doPrivileged(new PrivilegedAction() { + public Void run() { + setGlobalCurrentFocusCycleRoot(newFocusCycleRoot); + return null; + } + }); + } + /** * Adds a PropertyChangeListener to the listener list. The listener is * registered for all bound properties of this class, including the @@ -3065,4 +3105,39 @@ public abstract class KeyboardFocusManager : null; } } + + private static void checkReplaceKFMPermission() + throws SecurityException + { + SecurityManager security = System.getSecurityManager(); + if (security != null) { + if (replaceKeyboardFocusManagerPermission == null) { + replaceKeyboardFocusManagerPermission = + new AWTPermission("replaceKeyboardFocusManager"); + } + security. + checkPermission(replaceKeyboardFocusManagerPermission); + } + } + + // Checks if this KeyboardFocusManager instance is the current KFM, + // or otherwise checks if the calling thread has "replaceKeyboardFocusManager" + // permission. Here's the reasoning to do so: + // + // A system KFM instance (which is the current KFM by default) may have no + // "replaceKFM" permission when a client code is on the call stack beneath, + // but still it should be able to execute the methods protected by this check + // due to the system KFM is trusted (and so it does like "privileged"). + // + // If this KFM instance is not the current KFM but the client code has all + // permissions we can't throw SecurityException because it would contradict + // the security concepts. In this case the trusted client code is responsible + // for calling the secured methods from KFM instance which is not current. + private void checkKFMSecurity() + throws SecurityException + { + if (this != getCurrentKeyboardFocusManager()) { + checkReplaceKFMPermission(); + } + } } diff --git a/src/share/classes/java/awt/Window.java b/src/share/classes/java/awt/Window.java index 1e2ee59a09ade55ec70d8732771cf5e894782fba..984e287bd50d95f1eb7e1aa843f5d66dfc3f8439 100644 --- a/src/share/classes/java/awt/Window.java +++ b/src/share/classes/java/awt/Window.java @@ -506,7 +506,7 @@ public class Window extends Container implements Accessible { modalExclusionType = Dialog.ModalExclusionType.NO_EXCLUDE; - SunToolkit.checkAndSetPolicy(this, false); + SunToolkit.checkAndSetPolicy(this); } /** @@ -2568,7 +2568,7 @@ public class Window extends Container implements Accessible { } } KeyboardFocusManager.getCurrentKeyboardFocusManager(). - clearGlobalFocusOwner(); + clearGlobalFocusOwnerPriv(); } } diff --git a/src/share/classes/javax/swing/JApplet.java b/src/share/classes/javax/swing/JApplet.java index e36cd55e89163e052e18ec0becfa769abc63f423..0da6c3e532a12df0f45c0c57128734e257719475 100644 --- a/src/share/classes/javax/swing/JApplet.java +++ b/src/share/classes/javax/swing/JApplet.java @@ -149,7 +149,7 @@ public class JApplet extends Applet implements Accessible, setRootPaneCheckingEnabled(true); setFocusTraversalPolicyProvider(true); - sun.awt.SunToolkit.checkAndSetPolicy(this, true); + sun.awt.SunToolkit.checkAndSetPolicy(this); enableEvents(AWTEvent.KEY_EVENT_MASK); } diff --git a/src/share/classes/javax/swing/JComponent.java b/src/share/classes/javax/swing/JComponent.java index 78bc5c4f64891230a6da8d873f9ffa70f665c46d..dbf4b3c3343a5e6164d88e93d3c963db2b9a2bed 100644 --- a/src/share/classes/javax/swing/JComponent.java +++ b/src/share/classes/javax/swing/JComponent.java @@ -4148,6 +4148,9 @@ public abstract class JComponent extends Container implements Serializable, * Refer to * {@link java.awt.Component#setFocusTraversalKeys} * for a complete description of this method. + *

+ * This method may throw a {@code ClassCastException} if any {@code Object} + * in {@code keystrokes} is not an {@code AWTKeyStroke}. * * @param id one of KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, * KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, or @@ -4160,8 +4163,7 @@ public abstract class JComponent extends Container implements Serializable, * KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, * KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, or * KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS, or if keystrokes - * contains null, or if any Object in keystrokes is not an - * AWTKeyStroke, or if any keystroke represents a KEY_TYPED event, + * contains null, or if any keystroke represents a KEY_TYPED event, * or if any keystroke already maps to another focus traversal * operation for this Component * @since 1.5 @@ -5571,6 +5573,7 @@ public abstract class JComponent extends Container implements Serializable, * {@inheritDoc} */ @Override + @Deprecated public void hide() { boolean showing = isShowing(); super.hide(); diff --git a/src/share/classes/javax/swing/JDialog.java b/src/share/classes/javax/swing/JDialog.java index a4e35b66351b38b86343b88da34c44b001aaa9f7..a53c4abe50cf503f465c8d4c8247794d33b5e86f 100644 --- a/src/share/classes/javax/swing/JDialog.java +++ b/src/share/classes/javax/swing/JDialog.java @@ -654,7 +654,7 @@ public class JDialog extends Dialog implements WindowConstants, getRootPane().setWindowDecorationStyle(JRootPane.PLAIN_DIALOG); } } - sun.awt.SunToolkit.checkAndSetPolicy(this, true); + sun.awt.SunToolkit.checkAndSetPolicy(this); } /** diff --git a/src/share/classes/javax/swing/JFrame.java b/src/share/classes/javax/swing/JFrame.java index 3d5dea1f7cb6bb6462cd20c23b281401844c903f..cccd6f98aa5b95b7ddaecd09ee60dd682ca35d0b 100644 --- a/src/share/classes/javax/swing/JFrame.java +++ b/src/share/classes/javax/swing/JFrame.java @@ -266,7 +266,7 @@ public class JFrame extends Frame implements WindowConstants, getRootPane().setWindowDecorationStyle(JRootPane.FRAME); } } - sun.awt.SunToolkit.checkAndSetPolicy(this, true); + sun.awt.SunToolkit.checkAndSetPolicy(this); } /** diff --git a/src/share/classes/javax/swing/JInternalFrame.java b/src/share/classes/javax/swing/JInternalFrame.java index 516ac9afb08632f4ff3f7df166daadc809cca3a1..a0ba3a180840aa97107b5a52c36a41b8628154d7 100644 --- a/src/share/classes/javax/swing/JInternalFrame.java +++ b/src/share/classes/javax/swing/JInternalFrame.java @@ -349,7 +349,7 @@ public class JInternalFrame extends JComponent implements setRootPaneCheckingEnabled(true); desktopIcon = new JDesktopIcon(this); updateUI(); - sun.awt.SunToolkit.checkAndSetPolicy(this, true); + sun.awt.SunToolkit.checkAndSetPolicy(this); addPropertyChangeListenerIfNecessary(); } diff --git a/src/share/classes/javax/swing/JWindow.java b/src/share/classes/javax/swing/JWindow.java index 4a12d0205fbdc503ac018d56c67b8bfb51224e83..f5d7b08a4bdc5831cc68edcf6c92f08675224949 100644 --- a/src/share/classes/javax/swing/JWindow.java +++ b/src/share/classes/javax/swing/JWindow.java @@ -264,7 +264,7 @@ public class JWindow extends Window implements Accessible, setLocale( JComponent.getDefaultLocale() ); setRootPane(createRootPane()); setRootPaneCheckingEnabled(true); - sun.awt.SunToolkit.checkAndSetPolicy(this, true); + sun.awt.SunToolkit.checkAndSetPolicy(this); } /** diff --git a/src/share/classes/javax/swing/UIManager.java b/src/share/classes/javax/swing/UIManager.java index c3199d5f8d20ff08c647c6ea828523d44c33b023..d135e34b5c92feab5e877ebf2f9a2b8ff445b89e 100644 --- a/src/share/classes/javax/swing/UIManager.java +++ b/src/share/classes/javax/swing/UIManager.java @@ -191,6 +191,7 @@ public class UIManager implements Serializable private UIDefaults[] tables = new UIDefaults[2]; boolean initialized = false; + boolean focusPolicyInitialized = false; MultiUIDefaults multiUIDefaults = new MultiUIDefaults(tables); LookAndFeel lookAndFeel; LookAndFeel multiLookAndFeel = null; @@ -1000,6 +1001,7 @@ public class UIManager implements Serializable */ public static ComponentUI getUI(JComponent target) { maybeInitialize(); + maybeInitializeFocusPolicy(target); ComponentUI ui = null; LookAndFeel multiLAF = getLAFState().multiLookAndFeel; if (multiLAF != null) { @@ -1422,6 +1424,27 @@ public class UIManager implements Serializable } } + /* + * Sets default swing focus traversal policy. + */ + private static void maybeInitializeFocusPolicy(JComponent comp) { + // Check for JRootPane which indicates that a swing toplevel + // is coming, in which case a swing default focus policy + // should be instatiated. See 7125044. + if (comp instanceof JRootPane) { + synchronized (classLock) { + if (!getLAFState().focusPolicyInitialized) { + getLAFState().focusPolicyInitialized = true; + + if (FocusManager.isFocusManagerEnabled()) { + KeyboardFocusManager.getCurrentKeyboardFocusManager(). + setDefaultFocusTraversalPolicy( + new LayoutFocusTraversalPolicy()); + } + } + } + } + } /* * Only called by maybeInitialize(). @@ -1433,17 +1456,6 @@ public class UIManager implements Serializable initializeAuxiliaryLAFs(swingProps); initializeInstalledLAFs(swingProps); - // Enable the Swing default LayoutManager. - String toolkitName = Toolkit.getDefaultToolkit().getClass().getName(); - // don't set default policy if this is XAWT. - if (!"sun.awt.X11.XToolkit".equals(toolkitName)) { - if (FocusManager.isFocusManagerEnabled()) { - KeyboardFocusManager.getCurrentKeyboardFocusManager(). - setDefaultFocusTraversalPolicy( - new LayoutFocusTraversalPolicy()); - } - } - // Install Swing's PaintEventDispatcher if (RepaintManager.HANDLE_TOP_LEVEL_PAINT) { sun.awt.PaintEventDispatcher.setPaintEventDispatcher( diff --git a/src/share/classes/sun/awt/AWTAccessor.java b/src/share/classes/sun/awt/AWTAccessor.java index f804779015585ace1658977c27fac364da8295e8..04a2799fe5f46f70351de649a2b300802e2b685a 100644 --- a/src/share/classes/sun/awt/AWTAccessor.java +++ b/src/share/classes/sun/awt/AWTAccessor.java @@ -34,6 +34,8 @@ import java.awt.geom.Point2D; import java.awt.peer.ComponentPeer; import java.security.AccessControlContext; +import java.io.File; + /** * The AWTAccessor utility class. * The main purpose of this class is to enable accessing @@ -455,7 +457,7 @@ public final class AWTAccessor { /* * Sets the files the user selects */ - void setFiles(FileDialog fileDialog, String directory, String files[]); + void setFiles(FileDialog fileDialog, File files[]); /* * Sets the file the user selects diff --git a/src/share/classes/sun/awt/SunToolkit.java b/src/share/classes/sun/awt/SunToolkit.java index b63403961a696bb16c21b15dab1c75b8fb2a0905..a1c0d184eb909e256f6fbd2df739c26eee89eba8 100644 --- a/src/share/classes/sun/awt/SunToolkit.java +++ b/src/share/classes/sun/awt/SunToolkit.java @@ -461,48 +461,11 @@ public abstract class SunToolkit extends Toolkit AWTAccessor.getWindowAccessor().setLWRequestStatus(changed, status); }; - public static void checkAndSetPolicy(Container cont, boolean isSwingCont) - { - FocusTraversalPolicy defaultPolicy = KeyboardFocusManager - .getCurrentKeyboardFocusManager().getDefaultFocusTraversalPolicy(); - - String toolkitName = Toolkit.getDefaultToolkit().getClass().getName(); - // if this is not XAWT then use default policy - // because Swing change it - if (!"sun.awt.X11.XToolkit".equals(toolkitName)) { - cont.setFocusTraversalPolicy(defaultPolicy); - return; - } - - String policyName = defaultPolicy.getClass().getName(); - - if (DefaultFocusTraversalPolicy.class != defaultPolicy.getClass()) { - // Policy was changed - // Check if it is awt policy or swing policy - // If it is Swing policy we shouldn't use it in AWT frames - // If it is AWT policy we shouldn't use it in Swing frames - // Otherwise we should use this policy - if (policyName.startsWith("java.awt.")) { - // AWT - if (isSwingCont) { - // Can't use AWT policy in Swing windows - should use Swing's one. - defaultPolicy = createLayoutPolicy(); - } else { - // New awt policy. - } - } else if (policyName.startsWith("javax.swing.")) { - if (isSwingCont) { - // New Swing's policy - } else { - defaultPolicy = new DefaultFocusTraversalPolicy(); - } - } - } else { - // Policy is default, use different default policy for swing - if (isSwingCont) { - defaultPolicy = createLayoutPolicy(); - } - } + public static void checkAndSetPolicy(Container cont) { + FocusTraversalPolicy defaultPolicy = KeyboardFocusManager. + getCurrentKeyboardFocusManager(). + getDefaultFocusTraversalPolicy(); + cont.setFocusTraversalPolicy(defaultPolicy); } diff --git a/src/share/demo/jfc/Notepad/Notepad.java b/src/share/demo/jfc/Notepad/Notepad.java index c80966920fba7ba0afd2ef8b4c679fa846d76961..b6c7199e2562eb770644390fda9fcd7ac0d3960c 100644 --- a/src/share/demo/jfc/Notepad/Notepad.java +++ b/src/share/demo/jfc/Notepad/Notepad.java @@ -39,71 +39,18 @@ -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Component; -import java.awt.Container; -import java.awt.FileDialog; -import java.awt.Font; -import java.awt.Frame; -import java.awt.Graphics; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; -import java.io.File; -import java.io.FileReader; -import java.io.FileWriter; -import java.io.IOException; -import java.io.Reader; -import java.io.Writer; -import java.net.URL; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.MissingResourceException; -import java.util.ResourceBundle; -import java.util.StringTokenizer; -import java.util.logging.Level; -import java.util.logging.Logger; -import javax.swing.AbstractAction; -import javax.swing.Action; -import javax.swing.BorderFactory; -import javax.swing.Box; -import javax.swing.BoxLayout; -import javax.swing.ImageIcon; -import javax.swing.JButton; -import javax.swing.JComponent; -import javax.swing.JFileChooser; -import javax.swing.JFrame; -import javax.swing.JMenu; -import javax.swing.JMenuBar; -import javax.swing.JMenuItem; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JProgressBar; -import javax.swing.JScrollPane; -import javax.swing.JTextArea; -import javax.swing.JToolBar; -import javax.swing.JViewport; -import javax.swing.SwingUtilities; -import javax.swing.UIManager; +import java.awt.*; +import java.awt.event.*; +import java.beans.*; +import java.io.*; +import java.net.*; +import java.util.*; +import java.util.logging.*; +import javax.swing.*; +import javax.swing.undo.*; +import javax.swing.text.*; +import javax.swing.event.*; import javax.swing.UIManager.LookAndFeelInfo; -import javax.swing.event.UndoableEditEvent; -import javax.swing.event.UndoableEditListener; -import javax.swing.text.BadLocationException; -import javax.swing.text.Document; -import javax.swing.text.JTextComponent; -import javax.swing.text.PlainDocument; -import javax.swing.text.Segment; -import javax.swing.text.TextAction; -import javax.swing.undo.CannotRedoException; -import javax.swing.undo.CannotUndoException; -import javax.swing.undo.UndoManager; /** @@ -115,16 +62,27 @@ import javax.swing.undo.UndoManager; @SuppressWarnings("serial") class Notepad extends JPanel { + protected static Properties properties; private static ResourceBundle resources; private final static String EXIT_AFTER_PAINT = "-exit"; private static boolean exitAfterFirstPaint; + private static final String[] MENUBAR_KEYS = {"file", "edit", "debug"}; + private static final String[] TOOLBAR_KEYS = {"new", "open", "save", "-", "cut", "copy", "paste"}; + private static final String[] FILE_KEYS = {"new", "open", "save", "-", "exit"}; + private static final String[] EDIT_KEYS = {"cut", "copy", "paste", "-", "undo", "redo"}; + private static final String[] DEBUG_KEYS = {"dump", "showElementTree"}; + static { try { + properties = new Properties(); + properties.load(Notepad.class.getResourceAsStream( + "resources/NotepadSystem.properties")); resources = ResourceBundle.getBundle("resources.Notepad", Locale.getDefault()); - } catch (MissingResourceException mre) { - System.err.println("resources/Notepad.properties not found"); + } catch (MissingResourceException | IOException e) { + System.err.println("resources/Notepad.properties " + + "or resources/NotepadSystem.properties not found"); System.exit(1); } } @@ -163,26 +121,22 @@ class Notepad extends JPanel { // install the command table commands = new HashMap(); Action[] actions = getActions(); - for (int i = 0; i < actions.length; i++) { - Action a = actions[i]; - //commands.put(a.getText(Action.NAME), a); + for (Action a : actions) { commands.put(a.getValue(Action.NAME), a); } JScrollPane scroller = new JScrollPane(); JViewport port = scroller.getViewport(); port.add(editor); - try { - String vpFlag = resources.getString("ViewportBackingStore"); + + String vpFlag = getProperty("ViewportBackingStore"); + if (vpFlag != null) { Boolean bs = Boolean.valueOf(vpFlag); - port.setScrollMode(bs.booleanValue() + port.setScrollMode(bs ? JViewport.BACKINGSTORE_SCROLL_MODE : JViewport.BLIT_SCROLL_MODE); - } catch (MissingResourceException ignored) { - // just use the viewport default } - menuItems = new HashMap(); JPanel panel = new JPanel(); panel.setLayout(new BorderLayout()); panel.add("North", createToolbar()); @@ -191,31 +145,26 @@ class Notepad extends JPanel { add("South", createStatusbar()); } - public static void main(String[] args) { - try { - if (args.length > 0 && args[0].equals(EXIT_AFTER_PAINT)) { - exitAfterFirstPaint = true; + public static void main(String[] args) throws Exception { + if (args.length > 0 && args[0].equals(EXIT_AFTER_PAINT)) { + exitAfterFirstPaint = true; + } + SwingUtilities.invokeAndWait(new Runnable() { + + public void run() { + JFrame frame = new JFrame(); + frame.setTitle(resources.getString("Title")); + frame.setBackground(Color.lightGray); + frame.getContentPane().setLayout(new BorderLayout()); + Notepad notepad = new Notepad(); + frame.getContentPane().add("Center", notepad); + frame.setJMenuBar(notepad.createMenubar()); + frame.addWindowListener(new AppCloser()); + frame.pack(); + frame.setSize(500, 600); + frame.setVisible(true); } - SwingUtilities.invokeAndWait(new Runnable() { - - public void run() { - JFrame frame = new JFrame(); - frame.setTitle(resources.getString("Title")); - frame.setBackground(Color.lightGray); - frame.getContentPane().setLayout(new BorderLayout()); - Notepad notepad = new Notepad(); - frame.getContentPane().add("Center", notepad); - frame.setJMenuBar(notepad.createMenubar()); - frame.addWindowListener(new AppCloser()); - frame.pack(); - frame.setSize(500, 600); - frame.setVisible(true); - } - }); - } catch (Throwable t) { - Logger.getLogger(Notepad.class.getName()).log(Level.SEVERE, - "uncaught exception", t); - } + }); } /** @@ -274,9 +223,7 @@ class Notepad extends JPanel { /** * This is the hook through which all menu items are - * created. It registers the result with the menuitem - * hashtable so that it can be fetched with getMenuItem(). - * @see #getMenuItem + * created. */ protected JMenuItem createMenuItem(String cmd) { JMenuItem mi = new JMenuItem(getResourceString(cmd + labelSuffix)); @@ -285,7 +232,7 @@ class Notepad extends JPanel { mi.setHorizontalTextPosition(JButton.RIGHT); mi.setIcon(new ImageIcon(url)); } - String astr = getResourceString(cmd + actionSuffix); + String astr = getProperty(cmd + actionSuffix); if (astr == null) { astr = cmd; } @@ -298,25 +245,17 @@ class Notepad extends JPanel { } else { mi.setEnabled(false); } - menuItems.put(cmd, mi); return mi; } - /** - * Fetch the menu item that was created for the given - * command. - * @param cmd Name of the action. - * @returns item created for the given command or null - * if one wasn't created. - */ - protected JMenuItem getMenuItem(String cmd) { - return menuItems.get(cmd); - } - protected Action getAction(String cmd) { return commands.get(cmd); } + protected String getProperty(String key) { + return properties.getProperty(key); + } + protected String getResourceString(String nm) { String str; try { @@ -330,20 +269,11 @@ class Notepad extends JPanel { protected URL getResource(String key) { String name = getResourceString(key); if (name != null) { - URL url = this.getClass().getResource(name); - return url; + return this.getClass().getResource(name); } return null; } - protected Container getToolbar() { - return toolbar; - } - - protected JMenuBar getMenubar() { - return menubar; - } - /** * Create a status bar */ @@ -368,12 +298,11 @@ class Notepad extends JPanel { */ private Component createToolbar() { toolbar = new JToolBar(); - String[] toolKeys = tokenize(getResourceString("toolbar")); - for (int i = 0; i < toolKeys.length; i++) { - if (toolKeys[i].equals("-")) { + for (String toolKey: getToolBarKeys()) { + if (toolKey.equals("-")) { toolbar.add(Box.createHorizontalStrut(5)); } else { - toolbar.add(createTool(toolKeys[i])); + toolbar.add(createTool(toolKey)); } } toolbar.add(Box.createHorizontalGlue()); @@ -408,7 +337,7 @@ class Notepad extends JPanel { b.setRequestFocusEnabled(false); b.setMargin(new Insets(1, 1, 1, 1)); - String astr = getResourceString(key + actionSuffix); + String astr = getProperty(key + actionSuffix); if (astr == null) { astr = key; } @@ -428,44 +357,18 @@ class Notepad extends JPanel { return b; } - /** - * Take the given string and chop it up into a series - * of strings on whitespace boundaries. This is useful - * for trying to get an array of strings out of the - * resource file. - */ - protected String[] tokenize(String input) { - List v = new ArrayList(); - StringTokenizer t = new StringTokenizer(input); - String cmd[]; - - while (t.hasMoreTokens()) { - v.add(t.nextToken()); - } - cmd = new String[v.size()]; - for (int i = 0; i < cmd.length; i++) { - cmd[i] = v.get(i); - } - - return cmd; - } - /** * Create the menubar for the app. By default this pulls the * definition of the menu from the associated resource file. */ protected JMenuBar createMenubar() { - JMenuItem mi; JMenuBar mb = new JMenuBar(); - - String[] menuKeys = tokenize(getResourceString("menubar")); - for (int i = 0; i < menuKeys.length; i++) { - JMenu m = createMenu(menuKeys[i]); + for(String menuKey: getMenuBarKeys()){ + JMenu m = createMenu(menuKey); if (m != null) { mb.add(m); } } - this.menubar = mb; return mb; } @@ -474,19 +377,42 @@ class Notepad extends JPanel { * definition of the menu from the associated resource file. */ protected JMenu createMenu(String key) { - String[] itemKeys = tokenize(getResourceString(key)); - JMenu menu = new JMenu(getResourceString(key + "Label")); - for (int i = 0; i < itemKeys.length; i++) { - if (itemKeys[i].equals("-")) { + JMenu menu = new JMenu(getResourceString(key + labelSuffix)); + for (String itemKey: getItemKeys(key)) { + if (itemKey.equals("-")) { menu.addSeparator(); } else { - JMenuItem mi = createMenuItem(itemKeys[i]); + JMenuItem mi = createMenuItem(itemKey); menu.add(mi); } } return menu; } + /** + * Get keys for menus + */ + protected String[] getItemKeys(String key) { + switch (key) { + case "file": + return FILE_KEYS; + case "edit": + return EDIT_KEYS; + case "debug": + return DEBUG_KEYS; + default: + return null; + } + } + + protected String[] getMenuBarKeys() { + return MENUBAR_KEYS; + } + + protected String[] getToolBarKeys() { + return TOOLBAR_KEYS; + } + // Yarked from JMenu, ideally this would be public. protected PropertyChangeListener createActionChangeListener(JMenuItem b) { return new ActionChangedListener(b); @@ -516,13 +442,11 @@ class Notepad extends JPanel { } private JTextComponent editor; private Map commands; - private Map menuItems; - private JMenuBar menubar; private JToolBar toolbar; private JComponent status; private JFrame elementTreeFrame; protected ElementTreePanel elementTreePanel; - protected FileDialog fileDialog; + /** * Listener for the edits on the current document. */ @@ -773,10 +697,6 @@ class Notepad extends JPanel { super(showElementTreeAction); } - ShowElementTreeAction(String nm) { - super(nm); - } - public void actionPerformed(ActionEvent e) { if (elementTreeFrame == null) { // Create a frame containing an instance of diff --git a/src/share/demo/jfc/Notepad/resources/Notepad.properties b/src/share/demo/jfc/Notepad/resources/Notepad.properties index ef61d6fd3c461689b567627e34d9e875f9cadc20..d43e350942c49c46f42b277caac6de637adf80e0 100644 --- a/src/share/demo/jfc/Notepad/resources/Notepad.properties +++ b/src/share/demo/jfc/Notepad/resources/Notepad.properties @@ -3,16 +3,6 @@ Title=Notepad ElementTreeFrameTitle=Elements -# The following string should NOT be translated: ViewportBackingStore -ViewportBackingStore=false - -# menubar definition -# -# Each of the strings that follow form a key to be -# used to the actual menu definition. - -# The following string should NOT be translated: menubar -menubar=file edit debug # file Menu definition # @@ -24,8 +14,6 @@ menubar=file edit debug # save -> Notepad.saveAction # exit -> Notepad.exitAction -# The following string should NOT be translated: file -file=new open save - exit fileLabel=File openLabel=Open openImage=resources/open.gif @@ -42,38 +30,22 @@ exitLabel=Exit # copy -> JTextComponent.copyAction # paste -> JTextComponent.pasteAction -# The following string should NOT be translated: edit -edit=cut copy paste - undo redo editLabel=Edit cutLabel=Cut -# The following string should NOT be translated: cutAction -cutAction=cut-to-clipboard cutImage=resources/cut.gif copyLabel=Copy -# The following string should NOT be translated: copyAction -copyAction=copy-to-clipboard copyImage=resources/copy.gif pasteLabel=Paste -# The following string should NOT be translated: pasteAction -pasteAction=paste-from-clipboard pasteImage=resources/paste.gif undoLabel=Undo -# The following string should NOT be translated: undoAction -undoAction=Undo redoLabel=Redo -# The following string should NOT be translated: redoAction -redoAction=Redo # # debug Menu definition # -# The following string should NOT be translated: debug -debug=dump showElementTree debugLabel=Debug dumpLabel=Dump model to System.err -# The following string should NOT be translated: dumpAction -dumpAction=dump-model showElementTreeLabel=Show Elements # toolbar definition @@ -83,8 +55,6 @@ showElementTreeLabel=Show Elements # are of course sharable, and in this case are shared # with the menu items. -# The following string should NOT be translated: toolbar -toolbar=new open save - cut copy paste newTooltip=Create a new file openTooltip=Open a file saveTooltip=Save to a file diff --git a/src/share/demo/jfc/Notepad/resources/NotepadSystem.properties b/src/share/demo/jfc/Notepad/resources/NotepadSystem.properties new file mode 100644 index 0000000000000000000000000000000000000000..a6f8786d099dfc25fe0caab8b76358595546efc4 --- /dev/null +++ b/src/share/demo/jfc/Notepad/resources/NotepadSystem.properties @@ -0,0 +1,12 @@ +# +# Non-translatable properties for Notepad example + +ViewportBackingStore=false + +cutAction=cut-to-clipboard +copyAction=copy-to-clipboard +pasteAction=paste-from-clipboard +undoAction=Undo +redoAction=Redo +dumpAction=dump-model + diff --git a/src/share/native/sun/java2d/opengl/OGLContext.h b/src/share/native/sun/java2d/opengl/OGLContext.h index 866d8f41280beda76d987955097134656f203246..5e236bb28c60184faf9c993f23eabadbf2560b4e 100644 --- a/src/share/native/sun/java2d/opengl/OGLContext.h +++ b/src/share/native/sun/java2d/opengl/OGLContext.h @@ -84,6 +84,7 @@ typedef struct { GLdouble *xformMatrix; GLuint blitTextureID; GLint textureFunction; + jboolean vertexCacheEnabled; } OGLContext; /** diff --git a/src/share/native/sun/java2d/opengl/OGLTextRenderer.c b/src/share/native/sun/java2d/opengl/OGLTextRenderer.c index 12e028452ba68bd22598d3fa80f1136a9cc2699c..7a24d5222d5d8bbc95439f6964a3e42e658f3e63 100644 --- a/src/share/native/sun/java2d/opengl/OGLTextRenderer.c +++ b/src/share/native/sun/java2d/opengl/OGLTextRenderer.c @@ -202,11 +202,6 @@ OGLTR_InitGlyphCache(jboolean lcdCache) J2dTraceLn(J2D_TRACE_INFO, "OGLTR_InitGlyphCache"); - // init vertex cache (if it hasn't been already) - if (!OGLVertexCache_InitVertexCache()) { - return JNI_FALSE; - } - // init glyph cache data structure gcinfo = AccelGlyphCache_Init(OGLTR_CACHE_WIDTH, OGLTR_CACHE_HEIGHT, @@ -583,6 +578,10 @@ OGLTR_EnableGlyphVertexCache(OGLContext *oglc) { J2dTraceLn(J2D_TRACE_INFO, "OGLTR_EnableGlyphVertexCache"); + if (!OGLVertexCache_InitVertexCache(oglc)) { + return; + } + if (glyphCache == NULL) { if (!OGLTR_InitGlyphCache(JNI_FALSE)) { return; diff --git a/src/share/native/sun/java2d/opengl/OGLVertexCache.c b/src/share/native/sun/java2d/opengl/OGLVertexCache.c index 87556d61d5d9014127d8f1f2c594530b68b75493..574e2786fb9c948f08b6cd1b889d1db8d9ce74dd 100644 --- a/src/share/native/sun/java2d/opengl/OGLVertexCache.c +++ b/src/share/native/sun/java2d/opengl/OGLVertexCache.c @@ -67,29 +67,31 @@ static jint maskCacheIndex = 0; } while (0) jboolean -OGLVertexCache_InitVertexCache() +OGLVertexCache_InitVertexCache(OGLContext *oglc) { J2dTraceLn(J2D_TRACE_INFO, "OGLVertexCache_InitVertexCache"); - if (vertexCache != NULL) { - return JNI_TRUE; - } - - vertexCache = (J2DVertex *)malloc(OGLVC_MAX_INDEX * sizeof(J2DVertex)); if (vertexCache == NULL) { - return JNI_FALSE; + vertexCache = (J2DVertex *)malloc(OGLVC_MAX_INDEX * sizeof(J2DVertex)); + if (vertexCache == NULL) { + return JNI_FALSE; + } } - j2d_glTexCoordPointer(2, GL_FLOAT, - sizeof(J2DVertex), vertexCache); - j2d_glColorPointer(4, GL_UNSIGNED_BYTE, - sizeof(J2DVertex), ((jfloat *)vertexCache) + 2); - j2d_glVertexPointer(2, GL_FLOAT, - sizeof(J2DVertex), ((jfloat *)vertexCache) + 3); + if (!oglc->vertexCacheEnabled) { + j2d_glTexCoordPointer(2, GL_FLOAT, + sizeof(J2DVertex), vertexCache); + j2d_glColorPointer(4, GL_UNSIGNED_BYTE, + sizeof(J2DVertex), ((jfloat *)vertexCache) + 2); + j2d_glVertexPointer(2, GL_FLOAT, + sizeof(J2DVertex), ((jfloat *)vertexCache) + 3); - j2d_glEnableClientState(GL_TEXTURE_COORD_ARRAY); - j2d_glEnableClientState(GL_COLOR_ARRAY); - j2d_glEnableClientState(GL_VERTEX_ARRAY); + j2d_glEnableClientState(GL_TEXTURE_COORD_ARRAY); + j2d_glEnableClientState(GL_COLOR_ARRAY); + j2d_glEnableClientState(GL_VERTEX_ARRAY); + + oglc->vertexCacheEnabled = JNI_TRUE; + } return JNI_TRUE; } @@ -149,10 +151,6 @@ OGLVertexCache_InitMaskCache() { J2dTraceLn(J2D_TRACE_INFO, "OGLVertexCache_InitMaskCache"); - if (!OGLVertexCache_InitVertexCache()) { - return JNI_FALSE; - } - maskCacheTexID = OGLContext_CreateBlitTexture(GL_INTENSITY8, GL_LUMINANCE, OGLVC_MASK_CACHE_WIDTH_IN_TEXELS, @@ -179,6 +177,10 @@ OGLVertexCache_EnableMaskCache(OGLContext *oglc) { J2dTraceLn(J2D_TRACE_INFO, "OGLVertexCache_EnableMaskCache"); + if (!OGLVertexCache_InitVertexCache(oglc)) { + return; + } + if (maskCacheTexID == 0) { if (!OGLVertexCache_InitMaskCache()) { return; diff --git a/src/share/native/sun/java2d/opengl/OGLVertexCache.h b/src/share/native/sun/java2d/opengl/OGLVertexCache.h index bf22d1f950e512e45e464a1cba4be9f93d92a1b9..0392d8558ee61a27e6c326e2dcb8f18651173f93 100644 --- a/src/share/native/sun/java2d/opengl/OGLVertexCache.h +++ b/src/share/native/sun/java2d/opengl/OGLVertexCache.h @@ -65,7 +65,7 @@ /** * Exported methods. */ -jboolean OGLVertexCache_InitVertexCache(); +jboolean OGLVertexCache_InitVertexCache(OGLContext *oglc); void OGLVertexCache_FlushVertexCache(); void OGLVertexCache_RestoreColorState(OGLContext *oglc); diff --git a/src/solaris/classes/sun/awt/X11/GtkFileDialogPeer.java b/src/solaris/classes/sun/awt/X11/GtkFileDialogPeer.java index ebd434a96df289b254b9b1ab7fcbabd9bd86767d..71cb7f3ddc503aa0e44b6dc23ade202d59bea514 100644 --- a/src/solaris/classes/sun/awt/X11/GtkFileDialogPeer.java +++ b/src/solaris/classes/sun/awt/X11/GtkFileDialogPeer.java @@ -73,7 +73,7 @@ class GtkFileDialogPeer extends XDialogPeer implements FileDialogPeer { if (filenames == null) { accessor.setDirectory(fd, null); accessor.setFile(fd, null); - accessor.setFiles(fd, null, null); + accessor.setFiles(fd, null); } else { // Fix 6987233: add the trailing slash if it's absent String with_separator = directory; @@ -83,7 +83,13 @@ class GtkFileDialogPeer extends XDialogPeer implements FileDialogPeer { } accessor.setDirectory(fd, with_separator); accessor.setFile(fd, filenames[0]); - accessor.setFiles(fd, directory, filenames); + + int filesNumber = (filenames != null) ? filenames.length : 0; + File[] files = new File[filesNumber]; + for (int i = 0; i < filesNumber; i++) { + files[i] = new File(directory, filenames[i]); + } + accessor.setFiles(fd, files); } } diff --git a/src/solaris/classes/sun/awt/X11/XFileDialogPeer.java b/src/solaris/classes/sun/awt/X11/XFileDialogPeer.java index 9fac04660caf76142f73f7148a5e75fa0ff2330b..f15dbd209d191075dcea6da9fc783229dd0c55d4 100644 --- a/src/solaris/classes/sun/awt/X11/XFileDialogPeer.java +++ b/src/solaris/classes/sun/awt/X11/XFileDialogPeer.java @@ -396,11 +396,18 @@ class XFileDialogPeer extends XDialogPeer implements FileDialogPeer, ActionListe savedFile = file.substring(index+1); } + String[] fileNames = fileList.getSelectedItems(); + int filesNumber = (fileNames != null) ? fileNames.length : 0; + File[] files = new File[filesNumber]; + for (int i = 0; i < filesNumber; i++) { + files[i] = new File(savedDir, fileNames[i]); + } + AWTAccessor.FileDialogAccessor fileDialogAccessor = AWTAccessor.getFileDialogAccessor(); fileDialogAccessor.setDirectory(target, savedDir); fileDialogAccessor.setFile(target, savedFile); - fileDialogAccessor.setFiles(target, savedDir, fileList.getSelectedItems()); + fileDialogAccessor.setFiles(target, files); } /** @@ -419,7 +426,7 @@ class XFileDialogPeer extends XDialogPeer implements FileDialogPeer, ActionListe fileDialogAccessor.setDirectory(target, null); fileDialogAccessor.setFile(target, null); - fileDialogAccessor.setFiles(target, null, null); + fileDialogAccessor.setFiles(target, null); handleQuitButton(); } diff --git a/src/windows/classes/sun/awt/windows/WFileDialogPeer.java b/src/windows/classes/sun/awt/windows/WFileDialogPeer.java index 56568dcf3a1f7dc2510884cfec679f6064118b04..11fe02f83d02951b457f679c7577de1f56c2ced6 100644 --- a/src/windows/classes/sun/awt/windows/WFileDialogPeer.java +++ b/src/windows/classes/sun/awt/windows/WFileDialogPeer.java @@ -139,13 +139,16 @@ public class WFileDialogPeer extends WWindowPeer implements FileDialogPeer { String jDirectory = null; String jFile = null; - String jFiles[] = null; + File[] jFiles = null; if (multiple) { jDirectory = wFiles[0]; - jFiles = new String[wFiles.length - 1]; - System.arraycopy(wFiles, 1, jFiles, 0, jFiles.length); - jFile = jFiles[1]; // choose any file + int filesNumber = wFiles.length - 1; + jFiles = new File[filesNumber]; + for (int i = 0; i < filesNumber; i++) { + jFiles[i] = new File(jDirectory, wFiles[i + 1]); + } + jFile = wFiles[1]; // choose any file } else { int index = wFiles[0].lastIndexOf(java.io.File.separatorChar); if (index == -1) { @@ -155,7 +158,7 @@ public class WFileDialogPeer extends WWindowPeer implements FileDialogPeer { jDirectory = wFiles[0].substring(0, index + 1); jFile = wFiles[0].substring(index + 1); } - jFiles = new String[] { jFile }; + jFiles = new File[] { new File(jDirectory, jFile) }; } final FileDialog fileDialog = (FileDialog)target; @@ -163,7 +166,7 @@ public class WFileDialogPeer extends WWindowPeer implements FileDialogPeer { fileDialogAccessor.setDirectory(fileDialog, jDirectory); fileDialogAccessor.setFile(fileDialog, jFile); - fileDialogAccessor.setFiles(fileDialog, jDirectory, jFiles); + fileDialogAccessor.setFiles(fileDialog, jFiles); WToolkit.executeOnEventHandlerThread(fileDialog, new Runnable() { public void run() { @@ -178,7 +181,7 @@ public class WFileDialogPeer extends WWindowPeer implements FileDialogPeer { final FileDialog fileDialog = (FileDialog)target; AWTAccessor.getFileDialogAccessor().setFile(fileDialog, null); - AWTAccessor.getFileDialogAccessor().setFiles(fileDialog, null, null); + AWTAccessor.getFileDialogAccessor().setFiles(fileDialog, null); WToolkit.executeOnEventHandlerThread(fileDialog, new Runnable() { public void run() { diff --git a/test/java/awt/Dialog/ModalDialogPermission/ModalDialogPermission.java b/test/java/awt/Dialog/ModalDialogPermission/ModalDialogPermission.java new file mode 100644 index 0000000000000000000000000000000000000000..5c6cfe2d40e9495200a1d97e4713bd18be17c4b7 --- /dev/null +++ b/test/java/awt/Dialog/ModalDialogPermission/ModalDialogPermission.java @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Dialog; +import java.awt.Frame; +import java.util.Timer; +import java.util.TimerTask; + +/* + @test + @bug 7080109 + @summary Dialog.show() lacks doPrivileged() to access system event queue. + @author sergey.bylokhov@oracle.com: area=awt.dialog + @run main/othervm/policy=java.policy -Djava.security.manager ModalDialogPermission +*/ +public final class ModalDialogPermission { + + public static void main(final String[] args) { + Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() { + @Override + public void uncaughtException(final Thread t, final Throwable e) { + throw new RuntimeException(e); + } + }); + final Frame frame = new Frame(); + final Dialog dialog = new Dialog(frame, "ModalDialog", true); + final Timer t = new Timer(); + t.schedule(new TimerTask() { + + @Override + public void run() { + dialog.setVisible(false); + dialog.dispose(); + } + }, 3000L); + dialog.show(); + frame.dispose(); + t.cancel(); + } +} diff --git a/test/java/awt/Dialog/ModalDialogPermission/java.policy b/test/java/awt/Dialog/ModalDialogPermission/java.policy new file mode 100644 index 0000000000000000000000000000000000000000..d0a94d142633fe157e481f5e38c13170084f10ae --- /dev/null +++ b/test/java/awt/Dialog/ModalDialogPermission/java.policy @@ -0,0 +1,3 @@ +grant { + permission java.lang.RuntimePermission "setDefaultUncaughtExceptionHandler"; +}; diff --git a/test/java/awt/Focus/FocusTraversalPolicy/InitialFTP.java b/test/java/awt/Focus/FocusTraversalPolicy/InitialFTP.java new file mode 100644 index 0000000000000000000000000000000000000000..44cf627ba51f67a7f24a9815cd0809e15f941cf0 --- /dev/null +++ b/test/java/awt/Focus/FocusTraversalPolicy/InitialFTP.java @@ -0,0 +1,26 @@ +/* + @test + @bug 7125044 + @summary Tests defaut focus traversal policy in AWT & Swing toplevel windows. + @author anton.tarasov@sun.com: area=awt.focus + @run main InitialFTP_AWT + @run main InitialFTP_Swing +*/ + +import java.awt.FocusTraversalPolicy; +import java.awt.Window; + +public class InitialFTP { + public static void test(Window win, Class expectedPolicy) { + FocusTraversalPolicy ftp = win.getFocusTraversalPolicy(); + + System.out.println("==============" + "\n" + + "Tested window: " + win + "\n" + + "Expected policy: " + expectedPolicy + "\n" + + "Effective policy: " + ftp.getClass()); + + if (!expectedPolicy.equals(ftp.getClass())) { + throw new RuntimeException("Test failed: wrong effective focus policy"); + } + } +} diff --git a/test/java/awt/Focus/FocusTraversalPolicy/InitialFTP_AWT.java b/test/java/awt/Focus/FocusTraversalPolicy/InitialFTP_AWT.java new file mode 100644 index 0000000000000000000000000000000000000000..b22117a1dec44f4946ffa2db28b73e4f2b28e9d6 --- /dev/null +++ b/test/java/awt/Focus/FocusTraversalPolicy/InitialFTP_AWT.java @@ -0,0 +1,50 @@ +/* + @bug 7125044 + @summary Tests default focus traversal policy in AWT toplevel windows. + @author anton.tarasov@sun.com: area=awt.focus +*/ + +import java.awt.Button; +import java.awt.DefaultFocusTraversalPolicy; +import java.awt.FlowLayout; +import java.awt.FocusTraversalPolicy; +import java.awt.Frame; +import java.awt.List; +import java.awt.TextArea; +import java.awt.Window; + +public class InitialFTP_AWT { + public static void main(String[] args) { + AWTFrame f0 = new AWTFrame("frame0"); + f0.setVisible(true); + + InitialFTP.test(f0, DefaultFocusTraversalPolicy.class); + + AWTFrame f1 = new AWTFrame("frame1"); + f1.setVisible(true); + + InitialFTP.test(f1, DefaultFocusTraversalPolicy.class); + + System.out.println("Test passed."); + } +} + +class AWTFrame extends Frame { + Button button = new Button("button"); + TextArea text = new TextArea("qwerty"); + List list = new List(); + + public AWTFrame(String title) { + super(title); + + list.add("one"); + list.add("two"); + list.add("three"); + + this.setLayout(new FlowLayout()); + this.add(button); + this.add(text); + this.add(list); + this.pack(); + } +} diff --git a/test/java/awt/Focus/FocusTraversalPolicy/InitialFTP_Swing.java b/test/java/awt/Focus/FocusTraversalPolicy/InitialFTP_Swing.java new file mode 100644 index 0000000000000000000000000000000000000000..ab756220b6b1dec0f93145895141cd4c5926e2ca --- /dev/null +++ b/test/java/awt/Focus/FocusTraversalPolicy/InitialFTP_Swing.java @@ -0,0 +1,46 @@ +/* + @bug 7125044 + @summary Tests default focus traversal policy in Swing toplevel windows. + @author anton.tarasov@sun.com: area=awt.focus +*/ + +import java.awt.FlowLayout; +import java.awt.FocusTraversalPolicy; +import java.awt.Window; +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JList; +import javax.swing.JTextArea; +import javax.swing.LayoutFocusTraversalPolicy; + +public class InitialFTP_Swing { + public static void main(String[] args) { + SwingFrame f0 = new SwingFrame("frame0"); + f0.setVisible(true); + + InitialFTP.test(f0, LayoutFocusTraversalPolicy.class); + + SwingFrame f1 = new SwingFrame("frame1"); + f1.setVisible(true); + + InitialFTP.test(f1, LayoutFocusTraversalPolicy.class); + + System.out.println("Test passed."); + } +} + +class SwingFrame extends JFrame { + JButton button = new JButton("button"); + JTextArea text = new JTextArea("qwerty"); + JList list = new JList(new String[] {"one", "two", "three"}); + + public SwingFrame(String title) { + super(title); + + this.setLayout(new FlowLayout()); + this.add(button); + this.add(text); + this.add(list); + this.pack(); + } +} diff --git a/test/java/awt/GraphicsDevice/CloneConfigsTest.java b/test/java/awt/GraphicsDevice/CloneConfigsTest.java index c124ff5f434bd021c5b72b6a2e072c4e2a564097..29c3aa9b575db95fdd55f1a464189816dc381472 100644 --- a/test/java/awt/GraphicsDevice/CloneConfigsTest.java +++ b/test/java/awt/GraphicsDevice/CloneConfigsTest.java @@ -23,7 +23,7 @@ /* * @test - * @bug 6822057 + * @bug 6822057 7124400 * * @summary Test verifies that list of supported graphics configurations * can not be changed via modification of elements of an array diff --git a/test/java/awt/event/KeyEvent/SwallowKeyEvents/SwallowKeyEvents.java b/test/java/awt/event/KeyEvent/SwallowKeyEvents/SwallowKeyEvents.java new file mode 100644 index 0000000000000000000000000000000000000000..c10094eed67d3d21b1947144da9164a4c4d82e26 --- /dev/null +++ b/test/java/awt/event/KeyEvent/SwallowKeyEvents/SwallowKeyEvents.java @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + @test + @bug 7154072 + @summary Tests that key events with modifiers are not swallowed. + @author anton.tarasov: area=awt.focus + @library ../../../regtesthelpers + @build Util + @run main SwallowKeyEvents +*/ + +import java.awt.AWTException; +import java.awt.Frame; +import java.awt.Robot; +import java.awt.TextField; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import test.java.awt.regtesthelpers.Util; + +public class SwallowKeyEvents { + static final int PRESS_COUNT = 10; + + static int keyPressedCount = 0; + + static Frame f = new Frame("Frame"); + static TextField t = new TextField("text"); + static Robot r; + + public static void main(String[] args) { + f.add(t); + f.pack(); + f.setVisible(true); + + t.requestFocus(); + + try { + r = new Robot(); + } catch (AWTException ex) { + throw new RuntimeException(ex); + } + + Util.waitForIdle(r); + + t.addKeyListener(new KeyAdapter() { + public void keyPressed(KeyEvent ke) { + System.out.println(ke); + if (ke.getKeyCode() == KeyEvent.VK_M) { + keyPressedCount++; + } + } + }); + + test(); + + System.out.println("key_pressed count: " + keyPressedCount); + + if (keyPressedCount != PRESS_COUNT) { + throw new RuntimeException("Test failed!"); + } else { + System.out.println("Test passed."); + } + } + + public static void test() { + r.keyPress(KeyEvent.VK_SHIFT); + r.keyPress(KeyEvent.VK_META); + + for (int i=0; i