mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-25 15:20:11 +00:00
Merge
This commit is contained in:
commit
84ed289db0
@ -1857,7 +1857,7 @@ public abstract class Toolkit {
|
||||
|
||||
/**
|
||||
* Adds the specified property change listener for the named desktop
|
||||
* property. When a {@link PropertyChangeListenerProxy} object is added,
|
||||
* property. When a {@link java.beans.PropertyChangeListenerProxy} object is added,
|
||||
* its property name is ignored, and the wrapped listener is added.
|
||||
* If {@code name} is {@code null} or {@code pcl} is {@code null},
|
||||
* no exception is thrown and no action is performed.
|
||||
@ -1874,7 +1874,7 @@ public abstract class Toolkit {
|
||||
|
||||
/**
|
||||
* Removes the specified property change listener for the named
|
||||
* desktop property. When a {@link PropertyChangeListenerProxy} object
|
||||
* desktop property. When a {@link java.beans.PropertyChangeListenerProxy} object
|
||||
* is removed, its property name is ignored, and
|
||||
* the wrapped listener is removed.
|
||||
* If {@code name} is {@code null} or {@code pcl} is {@code null},
|
||||
@ -1893,11 +1893,11 @@ public abstract class Toolkit {
|
||||
/**
|
||||
* Returns an array of all the property change listeners
|
||||
* registered on this toolkit. The returned array
|
||||
* contains {@code PropertyChangeListenerProxy} objects
|
||||
* contains {@link java.beans.PropertyChangeListenerProxy} objects
|
||||
* that associate listeners with the names of desktop properties.
|
||||
*
|
||||
* @return all of this toolkit's {@ code PropertyChangeListener}
|
||||
* objects wrapped in {@code PropertyChangeListenerProxy} objects
|
||||
* @return all of this toolkit's {@link PropertyChangeListener}
|
||||
* objects wrapped in {@code java.beans.PropertyChangeListenerProxy} objects
|
||||
* or an empty array if no listeners are added
|
||||
*
|
||||
* @see PropertyChangeSupport#getPropertyChangeListeners()
|
||||
|
||||
@ -29,8 +29,6 @@ import java.awt.FileDialog;
|
||||
import java.awt.peer.FileDialogPeer;
|
||||
import java.io.File;
|
||||
import java.io.FilenameFilter;
|
||||
import javax.swing.SwingUtilities;
|
||||
import javax.swing.SwingWorker;
|
||||
import sun.awt.AWTAccessor;
|
||||
|
||||
/**
|
||||
@ -107,9 +105,7 @@ class GtkFileDialogPeer extends XDialogPeer implements FileDialogPeer {
|
||||
if (b) {
|
||||
Thread t = new Thread() {
|
||||
public void run() {
|
||||
GtkFileDialogPeer.this.run(fd.getTitle(), fd.getMode(),
|
||||
fd.getDirectory(), fd.getFile(), fd.getFilenameFilter(), fd.isMultipleMode(),
|
||||
fd.getX(), fd.getY());
|
||||
showNativeDialog();
|
||||
fd.setVisible(false);
|
||||
}
|
||||
};
|
||||
@ -146,4 +142,30 @@ class GtkFileDialogPeer extends XDialogPeer implements FileDialogPeer {
|
||||
// We do not implement this method because we
|
||||
// have delegated to FileDialog#setFilenameFilter
|
||||
}
|
||||
|
||||
private void showNativeDialog() {
|
||||
String dirname = fd.getDirectory();
|
||||
// File path has a priority against directory path.
|
||||
String filename = fd.getFile();
|
||||
if (filename != null) {
|
||||
final File file = new File(filename);
|
||||
if (fd.getMode() == FileDialog.LOAD
|
||||
&& dirname != null
|
||||
&& file.getParent() == null) {
|
||||
// File path for gtk_file_chooser_set_filename.
|
||||
filename = dirname + (dirname.endsWith(File.separator) ? "" :
|
||||
File.separator) + filename;
|
||||
}
|
||||
if (fd.getMode() == FileDialog.SAVE && file.getParent() != null) {
|
||||
// Filename for gtk_file_chooser_set_current_name.
|
||||
filename = file.getName();
|
||||
// Directory path for gtk_file_chooser_set_current_folder.
|
||||
dirname = file.getParent();
|
||||
}
|
||||
}
|
||||
GtkFileDialogPeer.this.run(fd.getTitle(), fd.getMode(), dirname,
|
||||
filename, fd.getFilenameFilter(),
|
||||
fd.isMultipleMode(), fd.getX(), fd.getY());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -3715,7 +3715,10 @@ void AwtComponent::OpenCandidateWindow(int x, int y)
|
||||
SetCandidateWindow(iCandType, x-rc.left, y-rc.top);
|
||||
}
|
||||
if (m_bitsCandType != 0) {
|
||||
::DefWindowProc(GetHWnd(), WM_IME_NOTIFY, IMN_OPENCANDIDATE, m_bitsCandType);
|
||||
HWND proxy = GetProxyFocusOwner();
|
||||
// REMIND: is there any chance GetProxyFocusOwner() returns NULL here?
|
||||
::DefWindowProc((proxy != NULL) ? proxy : GetHWnd(),
|
||||
WM_IME_NOTIFY, IMN_OPENCANDIDATE, m_bitsCandType);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -69,9 +69,12 @@ void AwtObject::_Dispose(jobject self)
|
||||
|
||||
CriticalSection::Lock l(AwtToolkit::GetInstance().GetSyncCS());
|
||||
|
||||
JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2);
|
||||
jobject selfGlobalRef = env->NewGlobalRef(self);
|
||||
|
||||
// value 0 of lParam means that we should not attempt to enter the
|
||||
// SyncCall critical section, as it was entered someshere earlier
|
||||
AwtToolkit::GetInstance().SendMessage(WM_AWT_DISPOSE, (WPARAM)self, (LPARAM)0);
|
||||
AwtToolkit::GetInstance().SendMessage(WM_AWT_DISPOSE, (WPARAM)selfGlobalRef, (LPARAM)0);
|
||||
|
||||
CATCH_BAD_ALLOC;
|
||||
}
|
||||
|
||||
@ -741,7 +741,9 @@ LRESULT CALLBACK AwtToolkit::WndProc(HWND hWnd, UINT message,
|
||||
}
|
||||
if (canDispose) {
|
||||
if(wParam != NULL) {
|
||||
AwtObject *o = (AwtObject *) JNI_GET_PDATA((jobject)wParam);
|
||||
jobject self = (jobject)wParam;
|
||||
AwtObject *o = (AwtObject *) JNI_GET_PDATA(self);
|
||||
env->DeleteGlobalRef(self);
|
||||
if(o != NULL && theAwtObjectList.Remove(o)) {
|
||||
o->Dispose();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user