diff -r ba198baeb89c core.windows/nbproject/project.xml
--- a/core.windows/nbproject/project.xml Wed May 04 08:56:05 2011 +0200
+++ b/core.windows/nbproject/project.xml Wed May 04 17:29:47 2011 +0200
@@ -68,6 +68,15 @@
+ org.netbeans.modules.sendopts
+
+
+
+ 2
+ 2.13
+
+
+ org.netbeans.modules.settings
diff -r ba198baeb89c core.windows/src/org/netbeans/core/windows/model/Bundle.properties
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/core.windows/src/org/netbeans/core/windows/model/Bundle.properties Wed May 04 17:29:47 2011 +0200
@@ -0,0 +1,47 @@
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+#
+# Copyright 2011 Oracle and/or its affiliates. All rights reserved.
+#
+# Oracle and Java are registered trademarks of Oracle and/or its affiliates.
+# Other names may be trademarks of their respective owners.
+#
+# The contents of this file are subject to the terms of either the GNU
+# General Public License Version 2 only ("GPL") or the Common
+# Development and Distribution License("CDDL") (collectively, the
+# "License"). You may not use this file except in compliance with the
+# License. You can obtain a copy of the License at
+# http://www.netbeans.org/cddl-gplv2.html
+# or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
+# specific language governing permissions and limitations under the
+# License. When distributing the software, include this License Header
+# Notice in each file and include the License file at
+# nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the GPL Version 2 section of the License file that
+# accompanied this code. If applicable, add the following below the
+# License Header, with the fields enclosed by brackets [] replaced by
+# your own identifying information:
+# "Portions Copyrighted [year] [name of copyright owner]"
+#
+# If you wish your version of this file to be governed by only the CDDL
+# or only the GPL Version 2, indicate your decision by adding
+# "[Contributor] elects to include this software in this distribution
+# under the [CDDL or GPL Version 2] license." If you do not indicate a
+# single choice of license, a recipient has the option to distribute
+# your version of this file under either the CDDL, the GPL Version 2 or
+# to extend the choice of license to its licensees as provided above.
+# However, if you add GPL Version 2 code and therefore, elected the GPL
+# Version 2 license, then the option applies only if the new code is
+# made subject to such option by the copyright holder.
+#
+# Contributor(s):
+#
+# Portions Copyrighted 2011 Sun Microsystems, Inc.
+
+HINT_DesignLayout=Switches Window System into Design Mode Allowing Definition of Layout of Modes
+CTL_DesignViewComponentTopComponent=Mode Component
+HINT_DesignViewComponentTopComponent=Represents a mode and allows its rename
+DesignViewComponent.modeName.text=
+DesignViewComponent.jLabel1.text=Mode Name:
+DesignViewComponent.jButton1.text=Rename Mode
+
diff -r ba198baeb89c core.windows/src/org/netbeans/core/windows/model/DefaultModeModel.java
--- a/core.windows/src/org/netbeans/core/windows/model/DefaultModeModel.java Wed May 04 08:56:05 2011 +0200
+++ b/core.windows/src/org/netbeans/core/windows/model/DefaultModeModel.java Wed May 04 17:29:47 2011 +0200
@@ -62,7 +62,7 @@
/** Programatic name of mode. */
- private final String name;
+ private String name;
private final Rectangle bounds = new Rectangle();
@@ -108,7 +108,7 @@
this.permanent = permanent;
this.topComponentSubModel = new TopComponentSubModel(kind);
}
-
+
/////////////////////////////////////
// Mutator methods >>
/////////////////////////////////////
@@ -357,6 +357,10 @@
}
return topComponentContextSubModel;
}
+
+ final void setName(String name) {
+ this.name = name;
+ }
}
diff -r ba198baeb89c core.windows/src/org/netbeans/core/windows/model/DefaultModel.java
--- a/core.windows/src/org/netbeans/core/windows/model/DefaultModel.java Wed May 04 08:56:05 2011 +0200
+++ b/core.windows/src/org/netbeans/core/windows/model/DefaultModel.java Wed May 04 17:29:47 2011 +0200
@@ -155,8 +155,11 @@
private final Object LOCK_PROJECT_NAME = new Object();
+ static DefaultModel INSTANCE;
public DefaultModel() {
+ assert INSTANCE == null;
+ INSTANCE = this;
}
@@ -728,6 +731,13 @@
return null;
}
}
+
+ final void setModeName(ModeImpl mode, String name) {
+ ModeModel modeModel = getModelForMode(mode);
+ if(modeModel instanceof DefaultModeModel) {
+ ((DefaultModeModel)modeModel).setName(name);
+ }
+ }
/** Gets bounds. */
public Rectangle getModeBounds(ModeImpl mode) {
diff -r ba198baeb89c core.windows/src/org/netbeans/core/windows/model/DesignView.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/core.windows/src/org/netbeans/core/windows/model/DesignView.java Wed May 04 17:29:47 2011 +0200
@@ -0,0 +1,173 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
+ *
+ * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
+ * Other names may be trademarks of their respective owners.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common
+ * Development and Distribution License("CDDL") (collectively, the
+ * "License"). You may not use this file except in compliance with the
+ * License. You can obtain a copy of the License at
+ * http://www.netbeans.org/cddl-gplv2.html
+ * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
+ * specific language governing permissions and limitations under the
+ * License. When distributing the software, include this License Header
+ * Notice in each file and include the License file at
+ * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the GPL Version 2 section of the License file that
+ * accompanied this code. If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * If you wish your version of this file to be governed by only the CDDL
+ * or only the GPL Version 2, indicate your decision by adding
+ * "[Contributor] elects to include this software in this distribution
+ * under the [CDDL or GPL Version 2] license." If you do not indicate a
+ * single choice of license, a recipient has the option to distribute
+ * your version of this file under either the CDDL, the GPL Version 2 or
+ * to extend the choice of license to its licensees as provided above.
+ * However, if you add GPL Version 2 code and therefore, elected the GPL
+ * Version 2 license, then the option applies only if the new code is
+ * made subject to such option by the copyright holder.
+ *
+ * Contributor(s):
+ *
+ * Portions Copyrighted 2011 Sun Microsystems, Inc.
+ */
+package org.netbeans.core.windows.model;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.Map;
+import java.util.Set;
+import org.netbeans.api.sendopts.CommandException;
+import org.netbeans.core.windows.Constants;
+import org.netbeans.core.windows.SplitConstraint;
+import org.netbeans.core.windows.WindowManagerImpl;
+import org.netbeans.spi.sendopts.Env;
+import org.netbeans.spi.sendopts.Option;
+import org.netbeans.spi.sendopts.OptionProcessor;
+import org.openide.awt.ActionID;
+import org.openide.awt.ActionRegistration;
+import org.openide.filesystems.FileObject;
+import org.openide.filesystems.FileUtil;
+import org.openide.util.Exceptions;
+import org.openide.util.NbBundle.Messages;
+import org.openide.util.lookup.ServiceProvider;
+import org.openide.windows.Mode;
+import org.openide.windows.TopComponent;
+import org.openide.windows.WindowManager;
+
+/**
+ *
+ * @author Jaroslav Tulach
+ */
+@ServiceProvider(service=OptionProcessor.class)
+public final class DesignView extends OptionProcessor implements Runnable {
+ private static final Option designLayout = Option.shortDescription(
+ Option.withoutArgument(Option.NO_SHORT_NAME, "designlayout"),
+ "org.netbeans.core.windows.model.Bundle", "HINT_DesignLayout"
+ );
+ static int designModeCounter;
+
+ @Override
+ protected Set