Merge remote-tracking branch 'origin/master'
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -43,6 +43,7 @@ import java.util.List;
|
||||
public class PsiCatchSectionImpl extends CompositePsiElement implements PsiCatchSection, Constants {
|
||||
private static final Logger LOG = Logger.getInstance("#com.intellij.psi.impl.source.tree.java.PsiCatchSectionImpl");
|
||||
|
||||
private final Object myTypesCacheLock = new Object();
|
||||
private CachedValue<List<PsiType>> myTypesCache = null;
|
||||
|
||||
public PsiCatchSectionImpl() {
|
||||
@@ -75,17 +76,27 @@ public class PsiCatchSectionImpl extends CompositePsiElement implements PsiCatch
|
||||
return getTypesCache().getValue();
|
||||
}
|
||||
|
||||
private synchronized CachedValue<List<PsiType>> getTypesCache() {
|
||||
if (myTypesCache == null) {
|
||||
final CachedValuesManager cacheManager = CachedValuesManager.getManager(getProject());
|
||||
myTypesCache = cacheManager.createCachedValue(new CachedValueProvider<List<PsiType>>() {
|
||||
@Override public Result<List<PsiType>> compute() {
|
||||
final List<PsiType> types = computePreciseCatchTypes(getParameter());
|
||||
return Result.create(types, PsiModificationTracker.MODIFICATION_COUNT);
|
||||
}
|
||||
}, false);
|
||||
@Override
|
||||
public void clearCaches() {
|
||||
super.clearCaches();
|
||||
synchronized (myTypesCacheLock) {
|
||||
myTypesCache = null;
|
||||
}
|
||||
}
|
||||
|
||||
private CachedValue<List<PsiType>> getTypesCache() {
|
||||
synchronized (myTypesCacheLock) {
|
||||
if (myTypesCache == null) {
|
||||
final CachedValuesManager cacheManager = CachedValuesManager.getManager(getProject());
|
||||
myTypesCache = cacheManager.createCachedValue(new CachedValueProvider<List<PsiType>>() {
|
||||
@Override public Result<List<PsiType>> compute() {
|
||||
final List<PsiType> types = computePreciseCatchTypes(getParameter());
|
||||
return Result.create(types, PsiModificationTracker.MODIFICATION_COUNT);
|
||||
}
|
||||
}, false);
|
||||
}
|
||||
return myTypesCache;
|
||||
}
|
||||
return myTypesCache;
|
||||
}
|
||||
|
||||
private List<PsiType> computePreciseCatchTypes(final PsiParameter parameter) {
|
||||
|
||||
@@ -66,7 +66,7 @@ public abstract class AbstractInspectionToolStarter implements ApplicationStarte
|
||||
if (!myOptions.suppressHelp()) {
|
||||
printHelpAndExit(args, myOptions);
|
||||
}
|
||||
return;
|
||||
System.exit(1);
|
||||
}
|
||||
|
||||
myApplication = new InspectionApplication();
|
||||
|
||||
@@ -391,12 +391,14 @@ public class ClipboardSynchronizer implements ApplicationComponent {
|
||||
if (formats == null || formats.length == 0) {
|
||||
return Collections.emptySet();
|
||||
}
|
||||
for (int i = 0, length = formats.length; i < length; i++) {
|
||||
if (formats[i] == 0) return Collections.emptySet();
|
||||
try {
|
||||
@SuppressWarnings({"unchecked", "UnnecessaryLocalVariable"})
|
||||
final Set<DataFlavor> set = DataTransferer.getInstance().getFlavorsForFormats(formats, FLAVOR_MAP).keySet();
|
||||
return set;
|
||||
}
|
||||
catch (NullPointerException e) {
|
||||
LOG.warn("Sun bug #6322854", e);
|
||||
}
|
||||
@SuppressWarnings({"unchecked", "UnnecessaryLocalVariable"})
|
||||
final Set<DataFlavor> set = DataTransferer.getInstance().getFlavorsForFormats(formats, FLAVOR_MAP).keySet();
|
||||
return set;
|
||||
}
|
||||
catch (IllegalAccessException ignore) { }
|
||||
catch (IllegalArgumentException ignore) { }
|
||||
|
||||
@@ -462,8 +462,11 @@ public class FileUtil extends FileUtilRt {
|
||||
|
||||
if (syncTimestamp) {
|
||||
final long timeStamp = fromFile.lastModified();
|
||||
if (!toFile.setLastModified(timeStamp)) {
|
||||
LOG.warn("Unable to set timestamp " + timeStamp + " to " + toFile);
|
||||
if (timeStamp < 0) {
|
||||
LOG.warn("Invalid timestamp " + timeStamp + " of '" + fromFile + "'");
|
||||
}
|
||||
else if (!toFile.setLastModified(timeStamp)) {
|
||||
LOG.warn("Unable to set timestamp " + timeStamp + " to '" + toFile + "'");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
After Width: | Height: | Size: 190 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 441 B |
|
After Width: | Height: | Size: 795 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
@@ -564,6 +564,175 @@
|
||||
</creation>
|
||||
</meta>
|
||||
|
||||
<!-- ================= Containers ================= -->
|
||||
|
||||
<meta model="com.intellij.android.designer.model.RadViewComponent"
|
||||
class="android.widget.DatePicker"
|
||||
tag="DatePicker">
|
||||
|
||||
<palette title="DatePicker" icon="/com/intellij/android/designer/icons/DatePicker.png"
|
||||
tooltip="This class is a widget for selecting a date."/>
|
||||
|
||||
<properties important="startYear endYear spinnersShown calendarViewShown minDate maxDate layout"/>
|
||||
|
||||
<creation>
|
||||
<![CDATA[
|
||||
<DatePicker
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
]]>
|
||||
</creation>
|
||||
</meta>
|
||||
|
||||
<meta model="com.intellij.android.designer.model.RadViewComponent"
|
||||
class="android.widget.CalendarView"
|
||||
tag="CalendarView">
|
||||
|
||||
<palette title="CalendarView" icon="/com/intellij/android/designer/icons/CalendarView.png"
|
||||
tooltip="This class is a calendar widget for displaying and selecting dates."/>
|
||||
|
||||
<properties
|
||||
important="firstDayOfWeek showWeekNumber minDate maxDate shownWeekCount weekDayTextAppearance dateTextAppearance"/>
|
||||
|
||||
<creation>
|
||||
<![CDATA[
|
||||
<CalendarView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
]]>
|
||||
</creation>
|
||||
</meta>
|
||||
|
||||
<meta model="com.intellij.android.designer.model.RadViewComponent"
|
||||
class="android.widget.TimePicker"
|
||||
tag="TimePicker">
|
||||
|
||||
<palette title="TimePicker" icon="/com/intellij/android/designer/icons/TimePicker.png"
|
||||
tooltip="A view for selecting the time of day, in either 24 hour or AM/PM mode."/>
|
||||
|
||||
<properties
|
||||
important="layout"/>
|
||||
|
||||
<creation>
|
||||
<![CDATA[
|
||||
<TimePicker
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
]]>
|
||||
</creation>
|
||||
</meta>
|
||||
|
||||
<meta model="com.intellij.android.designer.model.RadViewComponent"
|
||||
class="android.widget.NumberPicker"
|
||||
tag="NumberPicker">
|
||||
|
||||
<palette title="NumberPicker" icon="/com/intellij/android/designer/icons/NumberPicker.png"
|
||||
tooltip="A widget that enables the user to select a number form a predefined range. The widget presents an input field and up and down buttons for selecting the current value. Pressing/long-pressing the up and down buttons increments and decrements the current value respectively."/>
|
||||
|
||||
<creation>
|
||||
<![CDATA[
|
||||
<NumberPicker
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
]]>
|
||||
</creation>
|
||||
</meta>
|
||||
|
||||
<meta model="com.intellij.android.designer.model.RadViewComponent"
|
||||
class="android.widget.ZoomControls"
|
||||
tag="ZoomControls">
|
||||
|
||||
<palette title="ZoomControls" icon="/com/intellij/android/designer/icons/ZoomControls.png"
|
||||
tooltip="The ZoomControls class displays a simple set of controls used for zooming and provides callbacks to register for events."/>
|
||||
|
||||
<creation>
|
||||
<![CDATA[
|
||||
<ZoomControls
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
]]>
|
||||
</creation>
|
||||
</meta>
|
||||
|
||||
<meta model="com.intellij.android.designer.model.RadViewComponent"
|
||||
class="android.widget.SearchView"
|
||||
tag="SearchView">
|
||||
|
||||
<palette title="SearchView" icon="/com/intellij/android/designer/icons/SearchView.png"
|
||||
tooltip="A widget that provides a user interface for the user to enter a search query and submit a request to a search provider. Shows a list of query suggestions or results, if available, and allows the user to pick a suggestion or result to launch into."/>
|
||||
|
||||
<properties important="iconifiedByDefault queryHint imeOptions inputType"/>
|
||||
|
||||
<creation>
|
||||
<![CDATA[
|
||||
<SearchView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
]]>
|
||||
</creation>
|
||||
</meta>
|
||||
|
||||
<meta model="com.intellij.android.designer.model.RadViewComponent"
|
||||
class="android.widget.ListView"
|
||||
tag="ListView">
|
||||
|
||||
<palette title="ListView" icon="/com/intellij/android/designer/icons/ListView.png"
|
||||
tooltip="A view that shows items in a vertically scrolling list. The items come from the ListAdapter associated with this view."/>
|
||||
|
||||
<properties important="entries divider dividerHeight headerDividersEnabled footerDividersEnabled overScrollHeader overScrollFooter"/>
|
||||
|
||||
<creation>
|
||||
<![CDATA[
|
||||
<ListView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
]]>
|
||||
</creation>
|
||||
</meta>
|
||||
|
||||
<meta model="com.intellij.android.designer.model.RadViewComponent"
|
||||
class="android.widget.GridView"
|
||||
tag="GridView">
|
||||
|
||||
<palette title="GridView" icon="/com/intellij/android/designer/icons/GridView.png"
|
||||
tooltip="A view that shows items in two-dimensional scrolling grid. The items in the grid come from the ListAdapter associated with this view."/>
|
||||
|
||||
<properties important="horizontalSpacing verticalSpacing stretchMode columnWidth numColumns gravity"/>
|
||||
|
||||
<creation>
|
||||
<![CDATA[
|
||||
<GridView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
]]>
|
||||
</creation>
|
||||
</meta>
|
||||
|
||||
<meta model="com.intellij.android.designer.model.RadViewComponent"
|
||||
class="android.webkit.WebView"
|
||||
tag="WebView">
|
||||
|
||||
<palette title="WebView" icon="/com/intellij/android/designer/icons/WebView.png"
|
||||
tooltip="A View that displays web pages. This class is the basis upon which you can roll your own web browser or simply display some online content within your Activity."/>
|
||||
|
||||
<creation>
|
||||
<![CDATA[
|
||||
<WebView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
]]>
|
||||
</creation>
|
||||
</meta>
|
||||
|
||||
<!-- ================= Layouts ================= -->
|
||||
|
||||
<meta model="com.intellij.android.designer.model.RadViewComponent"
|
||||
@@ -622,6 +791,17 @@
|
||||
<item tag="TextureView"/>
|
||||
</group>
|
||||
<group name="Containers">
|
||||
<item tag="DatePicker"/>
|
||||
<item tag="CalendarView"/>
|
||||
<item tag="TimePicker"/>
|
||||
<item tag="NumberPicker"/>
|
||||
<item tag="ZoomControls"/>
|
||||
<item tag="SearchView"/>
|
||||
<item tag="ListView"/>
|
||||
<item tag="GridView"/>
|
||||
<item tag="WebView"/>
|
||||
</group>
|
||||
<group name="Layouts">
|
||||
<item tag="LinearLayout"/>
|
||||
</group>
|
||||
</palette>
|
||||
|
||||