update copyright
[fedora-idea.git] / plugins / ui-designer / src / com / intellij / uiDesigner / snapShooter / SnapShotRemoteComponent.java
blobb6cd40de208dfc6589854e907a0155227ee8485b
1 /*
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.
17 package com.intellij.uiDesigner.snapShooter;
19 import org.jetbrains.annotations.Nullable;
21 /**
22 * @author yole
24 public class SnapShotRemoteComponent {
25 private final int myId;
26 private boolean myTopLevel;
27 private final String myClassName;
28 private final String myLayoutManager;
29 private final String myText;
30 private SnapShotRemoteComponent[] myChildren = null;
32 public SnapShotRemoteComponent(final int id, final String className, final String layoutManager, final String text) {
33 myId = id;
34 myClassName = className;
35 myLayoutManager = layoutManager;
36 myText = text;
39 public SnapShotRemoteComponent(String line, boolean topLevel) {
40 final String[] strings = line.trim().split(";", 4);
41 myId = Integer.parseInt(strings [0]);
42 myClassName = strings [1];
43 myLayoutManager = strings [2];
44 myText = strings [3];
45 myTopLevel = topLevel;
48 public int getId() {
49 return myId;
52 public boolean isTopLevel() {
53 return myTopLevel;
56 public String getClassName() {
57 return myClassName;
60 public String getText() {
61 return myText;
64 public String getLayoutManager() {
65 return myLayoutManager;
68 @Nullable
69 public SnapShotRemoteComponent[] getChildren() {
70 return myChildren;
73 public void setChildren(final SnapShotRemoteComponent[] children) {
74 myChildren = children;
77 public String toProtocolString() {
78 return myId + ";" + myClassName + ";" + myLayoutManager + ";" + myText;