mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
FrameLayout
This commit is contained in:
@@ -19,7 +19,6 @@ import com.android.ide.common.rendering.api.ViewInfo;
|
||||
import com.android.resources.ResourceType;
|
||||
import com.android.sdklib.IAndroidTarget;
|
||||
import com.intellij.android.designer.propertyTable.AttributeProperty;
|
||||
import com.intellij.android.designer.propertyTable.AttributePropertyWithDefault;
|
||||
import com.intellij.android.designer.propertyTable.CompoundProperty;
|
||||
import com.intellij.android.designer.propertyTable.FlagProperty;
|
||||
import com.intellij.android.designer.propertyTable.editors.ResourceDialog;
|
||||
|
||||
-46
@@ -1,46 +0,0 @@
|
||||
/*
|
||||
* 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.android.designer.propertyTable;
|
||||
|
||||
import com.intellij.android.designer.model.RadViewComponent;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import org.jetbrains.android.dom.attrs.AttributeDefinition;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* @author Alexander Lobas
|
||||
*/
|
||||
public final class AttributePropertyWithDefault extends AttributeProperty {
|
||||
private final String myDefaultValue;
|
||||
|
||||
public AttributePropertyWithDefault(@NotNull String name, @NotNull AttributeDefinition definition, @NotNull String defaultValue) {
|
||||
super(name, definition);
|
||||
myDefaultValue = defaultValue;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDefaultValue(RadViewComponent component) throws Exception {
|
||||
return myDefaultValue.equals(getValue(component));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValue(RadViewComponent component, Object value) throws Exception {
|
||||
if (StringUtil.isEmpty((String)value)) {
|
||||
value = myDefaultValue;
|
||||
}
|
||||
super.setValue(component, value);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user