本文整理汇总了Java中com.intellij.util.ReflectionUtil.setField方法的典型用法代码示例。如果您正苦于以下问题:Java ReflectionUtil.setField方法的具体用法?Java ReflectionUtil.setField怎么用?Java ReflectionUtil.setField使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.util.ReflectionUtil
的用法示例。
在下文中一共展示了ReflectionUtil.setField方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateFrameClass
import com.intellij.util.ReflectionUtil; //导入方法依赖的package包/类
public static void updateFrameClass() {
try {
final Toolkit toolkit = Toolkit.getDefaultToolkit();
final Class<? extends Toolkit> aClass = toolkit.getClass();
if ("sun.awt.X11.XToolkit".equals(aClass.getName())) {
ReflectionUtil.setField(aClass, toolkit, null, "awtAppClassName", getFrameClass());
}
}
catch (Exception ignore) { }
}
示例2: setPropertyValue
import com.intellij.util.ReflectionUtil; //导入方法依赖的package包/类
private static void setPropertyValue(InspectionProfileEntry owner,
String property,
boolean selected) {
ReflectionUtil.setField(owner.getClass(), owner, boolean.class, property, selected);
}
示例3: setOption
import com.intellij.util.ReflectionUtil; //导入方法依赖的package包/类
@Override
public void setOption(final String optionName, boolean optionValue) {
ReflectionUtil.setField(myInspection.getClass(), myInspection, boolean.class, optionName, optionValue);
}
示例4: setPropertyValue
import com.intellij.util.ReflectionUtil; //导入方法依赖的package包/类
private static void setPropertyValue(@NotNull InspectionProfileEntry owner, String property, Object value) {
ReflectionUtil.setField(owner.getClass(), owner, null, property, value);
}
示例5: resetPopupTrigger
import com.intellij.util.ReflectionUtil; //导入方法依赖的package包/类
private static void resetPopupTrigger(final MouseEvent e) {
ReflectionUtil.setField(MouseEvent.class, e, boolean.class, "popupTrigger", false);
}
示例6: setPropertyValue
import com.intellij.util.ReflectionUtil; //导入方法依赖的package包/类
private static void setPropertyValue(InspectionProfileEntry owner,
String property,
String value) {
ReflectionUtil.setField(owner.getClass(), owner, String.class, property, value);
}
示例7: patchClickCount
import com.intellij.util.ReflectionUtil; //导入方法依赖的package包/类
/**
* This method patches event if it concerns side buttons like 4 (Backward) or 5 (Forward)
* AND it's not single-click event. We won't support double-click for side buttons.
* Also some JDK bugs produce zero-click events for side buttons.
* @return true if event was patched
*/
public static boolean patchClickCount(final MouseEvent e) {
if (e.getClickCount() != 1 && e.getButton() > 3) {
ReflectionUtil.setField(MouseEvent.class, e, int.class, "clickCount", 1);
}
return false;
}