diff --git a/bin/win/IdeaWin32.dll b/bin/win/IdeaWin32.dll index 068dd30aecb0..9807643f9124 100644 Binary files a/bin/win/IdeaWin32.dll and b/bin/win/IdeaWin32.dll differ diff --git a/java/execution/impl/src/com/intellij/execution/applet/AppletConfigurable.form b/java/execution/impl/src/com/intellij/execution/applet/AppletConfigurable.form index 6a0c22b8ae78..0e182b599bb7 100644 --- a/java/execution/impl/src/com/intellij/execution/applet/AppletConfigurable.form +++ b/java/execution/impl/src/com/intellij/execution/applet/AppletConfigurable.form @@ -3,7 +3,7 @@ - + @@ -43,7 +43,7 @@ - + @@ -57,7 +57,7 @@ - + @@ -69,6 +69,7 @@ + @@ -260,18 +261,20 @@ - - - - - - + + + + + + + + diff --git a/java/execution/impl/src/com/intellij/execution/application/ApplicationConfigurable.form b/java/execution/impl/src/com/intellij/execution/application/ApplicationConfigurable.form index d3c691ce357d..2eb76848a983 100644 --- a/java/execution/impl/src/com/intellij/execution/application/ApplicationConfigurable.form +++ b/java/execution/impl/src/com/intellij/execution/application/ApplicationConfigurable.form @@ -3,7 +3,7 @@ - + @@ -17,17 +17,17 @@ - + + + - - - + - + @@ -38,6 +38,7 @@ + @@ -45,7 +46,9 @@ - + + + diff --git a/java/execution/impl/src/com/intellij/execution/ui/AlternativeJREPanel.java b/java/execution/impl/src/com/intellij/execution/ui/AlternativeJREPanel.java index 973cc74c180b..f7a081f79cc7 100644 --- a/java/execution/impl/src/com/intellij/execution/ui/AlternativeJREPanel.java +++ b/java/execution/impl/src/com/intellij/execution/ui/AlternativeJREPanel.java @@ -45,9 +45,8 @@ public class AlternativeJREPanel extends JPanel { super(new GridBagLayout()); myCbEnabled = new JCheckBox(ExecutionBundle.message("run.configuration.use.alternate.jre.checkbox")); - myCbEnabled.setPreferredSize(new Dimension(154, 16)); final GridBagConstraints gc = new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.WEST, - GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0); + GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0); add(myCbEnabled, gc); myFieldWithHistory = new TextFieldWithHistory(); @@ -64,11 +63,13 @@ public class AlternativeJREPanel extends JPanel { TextComponentAccessor.TEXT_FIELD_WITH_HISTORY_WHOLE_TEXT); gc.gridx = 1; gc.weightx = 1; + gc.fill = GridBagConstraints.HORIZONTAL; + gc.insets.left = 10; add(myPathField, gc); InsertPathAction.addTo(myFieldWithHistory.getTextEditor()); - gc.weighty = 1; - add(Box.createVerticalBox(), gc); + //gc.weighty = 1; + //add(Box.createVerticalBox(), gc); myCbEnabled.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { @@ -105,4 +106,12 @@ public class AlternativeJREPanel extends JPanel { setPathEnabled(isEnabled); setPath(path); } + + public void setCheckBoxPreferredSize(Dimension d) { + myCbEnabled.setPreferredSize(d); + } + + public Dimension getCheckBoxPreferredSize() { + return myCbEnabled.getPreferredSize(); + } } diff --git a/java/execution/impl/src/com/intellij/execution/ui/CommonJavaParametersPanel.java b/java/execution/impl/src/com/intellij/execution/ui/CommonJavaParametersPanel.java index 35442ec0d697..de2122fdaae2 100644 --- a/java/execution/impl/src/com/intellij/execution/ui/CommonJavaParametersPanel.java +++ b/java/execution/impl/src/com/intellij/execution/ui/CommonJavaParametersPanel.java @@ -19,6 +19,7 @@ import com.intellij.execution.CommonJavaRunConfigurationParameters; import com.intellij.execution.ExecutionBundle; import com.intellij.openapi.ui.LabeledComponent; import com.intellij.ui.RawCommandLineEditor; +import org.jetbrains.annotations.Nullable; import java.awt.*; @@ -36,12 +37,17 @@ public class CommonJavaParametersPanel extends CommonProgramParametersPanel { copyDialogCaption(myVMParameters); myVMParameters.setLabelLocation(BorderLayout.WEST); - myVMParameters.setLabelPreferredSize(super.getProgramParametersComponent().getLabelPreferredSize()); add(myVMParameters); super.addComponents(); } + @Override + public void setLabelsPreferredSize(Dimension d) { + super.setLabelsPreferredSize(d); + myVMParameters.setLabelPreferredSize(d); + } + public void setVMParameters(String text) { myVMParameters.getComponent().setText(text); } diff --git a/java/java-impl/src/com/intellij/refactoring/extractMethodObject/ExtractMethodObjectPanel.form b/java/java-impl/src/com/intellij/refactoring/extractMethodObject/ExtractMethodObjectPanel.form index 361e2292b919..cc1201f81c73 100644 --- a/java/java-impl/src/com/intellij/refactoring/extractMethodObject/ExtractMethodObjectPanel.form +++ b/java/java-impl/src/com/intellij/refactoring/extractMethodObject/ExtractMethodObjectPanel.form @@ -3,7 +3,7 @@ - + @@ -170,6 +170,7 @@ + @@ -186,6 +187,7 @@ + diff --git a/native/IdeaWin32/IdeaWin32.cpp b/native/IdeaWin32/IdeaWin32.cpp index f4ce19c5ee01..8dd09c310cb1 100644 --- a/native/IdeaWin32/IdeaWin32.cpp +++ b/native/IdeaWin32/IdeaWin32.cpp @@ -3,20 +3,27 @@ #include "jni_util.h" #include "windows.h" -jfieldID nameId; +jfieldID nameID; +jfieldID attributesID; +jfieldID timestampID; +jfieldID lengthID; -HANDLE FindFileInner(JNIEnv *env, jstring path, LPWIN32_FIND_DATA lpData) { - const jchar* str = env->GetStringChars(path, 0); - HANDLE h = FindFirstFile((LPCWSTR)str, lpData); - env->ReleaseStringChars(path, str); - return h; +JNIEXPORT void JNICALL Java_com_intellij_openapi_vfs_impl_win32_FileInfo_initIDs(JNIEnv *env, jclass cls) { + nameID = env->GetFieldID(cls, "name", "Ljava/lang/String;"); + attributesID = env->GetFieldID(cls, "attributes", "I"); + timestampID = env->GetFieldID(cls, "timestamp", "J"); + lengthID = env->GetFieldID(cls, "length", "J"); } -bool CopyObjectArray(JNIEnv *env, jobjectArray dst, jobjectArray src, - jint count) -{ - int i; - for (i=0; iGetStringChars(path, 0); + const HANDLE h = FindFirstFile((LPCWSTR)str, lpData); + env->ReleaseStringChars(path, str); + return h; +} + +static bool CopyObjectArray(JNIEnv *env, jobjectArray dst, jobjectArray src, jint count) { + for (int i = 0; i < count; i++) { jobject p = env->GetObjectArrayElement(src, i); env->SetObjectArrayElement(dst, i, p); env->DeleteLocalRef(p); @@ -24,121 +31,123 @@ bool CopyObjectArray(JNIEnv *env, jobjectArray dst, jobjectArray src, return true; } -static LONGLONG -fileTimeToInt64 (const FILETIME * time) -{ - ULARGE_INTEGER _time; - - _time.LowPart = time->dwLowDateTime; - _time.HighPart = time->dwHighDateTime; - - return _time.QuadPart; +static LONGLONG pairToInt64(DWORD lowPart, DWORD highPart) { + ULARGE_INTEGER large; + large.LowPart = lowPart; + large.HighPart = highPart; + return large.QuadPart; } -jfieldID nameID; -jfieldID attributesID; -jfieldID timestampID; -jfieldID lengthID; +#define IS_SET(flags, flag) ((flags & flag) == flag) -jobject CreateFileInfo(JNIEnv *env, LPWIN32_FIND_DATA lpData, jclass cls) { +static jobject CreateFileInfo(JNIEnv *env, jstring path, bool append, LPWIN32_FIND_DATA lpData, jclass cls) { + jobject o = env->AllocObject(cls); + if (o == NULL) { + return NULL; + } - jobject o = env->AllocObject(cls); - if (o == NULL) { - return NULL; - } - jstring fileName = env->NewString((jchar*)lpData->cFileName, (jsize)wcslen(lpData->cFileName)); - if (fileName == NULL) { - return NULL; - } - env->SetObjectField(o, nameID, fileName); - env->SetIntField(o, attributesID, lpData->dwFileAttributes); - env->SetLongField(o, timestampID, fileTimeToInt64(&lpData->ftLastWriteTime)); + jstring fileName = env->NewString((jchar*)lpData->cFileName, (jsize)wcslen(lpData->cFileName)); + if (fileName == NULL) { + return NULL; + } + env->SetObjectField(o, nameID, fileName); - ULARGE_INTEGER size; - size.LowPart = lpData->nFileSizeLow; - size.HighPart = lpData->nFileSizeHigh; - env->SetLongField(o, lengthID, size.QuadPart); - return o; -} + bool read = false; + if (IS_SET(lpData->dwFileAttributes, FILE_ATTRIBUTE_REPARSE_POINT) && IS_SET(lpData->dwReserved0, IO_REPARSE_TAG_SYMLINK)) { + int nameLen = env->GetStringLength(path) + wcslen(lpData->cFileName) + 2; + wchar_t *lpName = (wchar_t *)malloc(nameLen * sizeof(wchar_t)); -JNIEXPORT void JNICALL Java_com_intellij_openapi_vfs_impl_win32_FileInfo_initIDs(JNIEnv *env, jclass cls) { - nameID = env->GetFieldID(cls, "name", "Ljava/lang/String;"); - attributesID = env->GetFieldID(cls, "attributes", "I"); - timestampID = env->GetFieldID(cls, "timestamp", "J"); - lengthID = env->GetFieldID(cls, "length", "J"); + if (lpName != NULL) { + const jchar *dirName = env->GetStringChars(path, 0); + wcscpy_s(lpName, nameLen, (LPCWSTR)dirName); + env->ReleaseStringChars(path, dirName); + if (append) { + wcscat_s(lpName, nameLen, L"\\"); + wcscat_s(lpName, nameLen, lpData->cFileName); + } + + // read symlink target attributes + HANDLE th = CreateFile(lpName, FILE_READ_ATTRIBUTES, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL, + OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL); + if (th != INVALID_HANDLE_VALUE) { + BY_HANDLE_FILE_INFORMATION targetData; + if (GetFileInformationByHandle(th, &targetData)) { + env->SetIntField(o, attributesID, targetData.dwFileAttributes); + env->SetLongField(o, timestampID, pairToInt64(targetData.ftLastWriteTime.dwLowDateTime, targetData.ftLastWriteTime.dwHighDateTime)); + env->SetLongField(o, lengthID, pairToInt64(targetData.nFileSizeLow, targetData.nFileSizeHigh)); + read = true; + } + CloseHandle(th); + } + + free(lpName); + } + } + + if (!read) { + env->SetIntField(o, attributesID, lpData->dwFileAttributes); + env->SetLongField(o, timestampID, pairToInt64(lpData->ftLastWriteTime.dwLowDateTime, lpData->ftLastWriteTime.dwHighDateTime)); + env->SetLongField(o, lengthID, pairToInt64(lpData->nFileSizeLow, lpData->nFileSizeHigh)); + } + + return o; } JNIEXPORT jobject JNICALL Java_com_intellij_openapi_vfs_impl_win32_IdeaWin32_getInfo(JNIEnv *env, jobject method, jstring path) { - WIN32_FIND_DATA data; - HANDLE h = FindFileInner(env, path, &data); - if (h == INVALID_HANDLE_VALUE) { - return NULL; - } - FindClose(h); - jclass infoClass = env->FindClass("com/intellij/openapi/vfs/impl/win32/FileInfo"); - return CreateFileInfo(env, &data, infoClass); + WIN32_FIND_DATA data; + HANDLE h = FindFileInner(env, path, &data); + if (h == INVALID_HANDLE_VALUE) { + return NULL; + } + FindClose(h); + jclass infoClass = env->FindClass("com/intellij/openapi/vfs/impl/win32/FileInfo"); + return CreateFileInfo(env, path, false, &data, infoClass); } -JNIEXPORT jboolean JNICALL Java_com_intellij_openapi_vfs_impl_win32_IdeaWin32_checkExist(JNIEnv *env, jobject method, jstring path) { - jint result = 0; - WIN32_FILE_ATTRIBUTE_DATA wfad; - const jchar* str = env->GetStringChars(path, 0); +JNIEXPORT jobjectArray JNICALL Java_com_intellij_openapi_vfs_impl_win32_IdeaWin32_listChildren(JNIEnv *env, jobject method, jstring path) { + WIN32_FIND_DATA data; + HANDLE h = FindFileInner(env, path, &data); + if (h == INVALID_HANDLE_VALUE) { + return NULL; + } - if (GetFileAttributesEx((LPCWSTR)path, GetFileExInfoStandard, &wfad)) return JNI_TRUE; - return JNI_FALSE; -} + jobjectArray rv, old; + int len = 0, maxlen = 16; + jclass infoClass = env->FindClass("com/intellij/openapi/vfs/impl/win32/FileInfo"); + rv = env->NewObjectArray(maxlen, infoClass, NULL); + if (rv == NULL) { + goto error; + } -JNIEXPORT jobjectArray JNICALL Java_com_intellij_openapi_vfs_impl_win32_IdeaWin32_listChildren(JNIEnv *env, jobject method, jstring path) -{ - - WIN32_FIND_DATA data; - HANDLE h = FindFileInner(env, path, &data); - if (h == INVALID_HANDLE_VALUE) { - return NULL; - } - - jobjectArray rv, old; - int len, maxlen; - - len = 0; - maxlen = 16; - jclass infoClass = env->FindClass("com/intellij/openapi/vfs/impl/win32/FileInfo"); - rv = env->NewObjectArray(maxlen, infoClass, NULL); - if (rv == NULL) goto error; - do { + do { if (len == maxlen) { old = rv; - rv = env->NewObjectArray(maxlen <<= 1, - infoClass, NULL); - if (rv == NULL) goto error; - if (!CopyObjectArray(env, rv, old, len)) goto error; + rv = env->NewObjectArray(maxlen <<= 1, infoClass, NULL); + if (rv == NULL || !CopyObjectArray(env, rv, old, len)) { + goto error; + } env->DeleteLocalRef(old); } - jobject o = CreateFileInfo(env, &data, infoClass); - env->SetObjectArrayElement(rv, len++, o); - env->DeleteLocalRef(o); - } - while (FindNextFile(h, &data)); + jobject o = CreateFileInfo(env, path, true, &data, infoClass); + env->SetObjectArrayElement(rv, len++, o); + env->DeleteLocalRef(o); + } + while (FindNextFile(h, &data)); - FindClose(h); - - old = rv; - rv = env->NewObjectArray(len, infoClass, NULL); - if (rv == NULL) goto error; - if (!CopyObjectArray(env, rv, old, len)) goto error; - return rv; + FindClose(h); + old = rv; + rv = env->NewObjectArray(len, infoClass, NULL); + if (rv == NULL || !CopyObjectArray(env, rv, old, len)) { + goto error; + } + return rv; error: - FindClose(h); - return NULL; + FindClose(h); + return NULL; } -BOOL APIENTRY DllMain( HMODULE hModule, - DWORD ul_reason_for_call, - LPVOID lpReserved - ) -{ +BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) { return TRUE; } - diff --git a/native/IdeaWin32/stdafx.h b/native/IdeaWin32/stdafx.h index 2bdfa89d3315..5cb1cb9f9e68 100644 --- a/native/IdeaWin32/stdafx.h +++ b/native/IdeaWin32/stdafx.h @@ -26,3 +26,5 @@ #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers // Windows Header Files: #include + +#include diff --git a/platform/lang-impl/src/com/intellij/application/options/CodeCompletion.form b/platform/lang-impl/src/com/intellij/application/options/CodeCompletion.form index 2506873a81ce..d2ad379b5095 100644 --- a/platform/lang-impl/src/com/intellij/application/options/CodeCompletion.form +++ b/platform/lang-impl/src/com/intellij/application/options/CodeCompletion.form @@ -18,7 +18,7 @@ - + @@ -135,38 +135,44 @@ - - - - - - - - - - - - - - - -