2 * Copyright 2000-2009 JetBrains s.r.o.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package com
.intellij
.uiDesigner
.radComponents
;
18 import com
.intellij
.openapi
.module
.Module
;
19 import com
.intellij
.uiDesigner
.VSpacer
;
20 import com
.intellij
.uiDesigner
.XmlWriter
;
21 import com
.intellij
.uiDesigner
.palette
.Palette
;
22 import com
.intellij
.uiDesigner
.core
.GridConstraints
;
26 * @author Anton Katilin
27 * @author Vladimir Kondratyev
29 public final class RadVSpacer
extends RadAtomicComponent
{
30 public static class Factory
extends RadComponentFactory
{
31 public RadComponent
newInstance(Module module
, Class aClass
, String id
) {
32 return new RadVSpacer(module
, aClass
, id
);
35 public RadComponent
newInstance(final Class componentClass
, final String id
, final Palette palette
) {
36 throw new UnsupportedOperationException("Spacer instances should not be created by SnapShooter");
39 public RadComponent
newInstance(Module module
, String className
, String id
) throws ClassNotFoundException
{
40 return new RadVSpacer(module
, VSpacer
.class, id
);
44 public RadVSpacer(final Module module
, final String id
) {
45 super(module
, VSpacer
.class, id
);
48 public RadVSpacer(final Module module
, final Class aClass
, final String id
) {
49 super(module
, aClass
, id
);
53 * Constructor for use in SnapShooter
55 public RadVSpacer(final String id
, final int row
) {
56 super(null, VSpacer
.class, id
);
57 getConstraints().setRow(row
);
58 getConstraints().setVSizePolicy(GridConstraints
.SIZEPOLICY_CAN_GROW
|
59 GridConstraints
.SIZEPOLICY_WANT_GROW
);
60 getConstraints().setFill(GridConstraints
.FILL_VERTICAL
);
63 public void write(final XmlWriter writer
) {
64 writer
.startElement("vspacer");
67 writeConstraints(writer
);
69 writer
.endElement(); // vspacer
73 @Override public boolean hasIntrospectedProperties() {