--- a/core.windows/src/org/netbeans/core/windows/resources/layer.xml
+++ a/core.windows/src/org/netbeans/core/windows/resources/layer.xml
@@ -222,6 +222,12 @@
+
+
+
+
+
+
@@ -233,6 +239,9 @@
+
+
+
--- a/core.windows/src/org/netbeans/core/windows/resources/toolbar1_2.dtd
+++ a/core.windows/src/org/netbeans/core/windows/resources/toolbar1_2.dtd
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
--- a/core.windows/src/org/netbeans/core/windows/view/ui/toolbars/ToolbarConfiguration.java
+++ a/core.windows/src/org/netbeans/core/windows/view/ui/toolbars/ToolbarConfiguration.java
@@ -154,7 +154,7 @@
ToolbarConstraints tc = name2constr.get(tbName);
- if (tc != null && tb != null) {
+ if (tc != null && tb != null && tc.isCloseable()) {
//May be null if a toolbar has been renamed
JCheckBoxMenuItem mi = new JCheckBoxMenuItem (
tb.getDisplayName(), tc.isVisible()
@@ -440,7 +440,7 @@
boolean isQuickSearch = "QuickSearch".equals(toolbarName); //NOI18N
tc = new ToolbarConstraints(toolbarName,
isQuickSearch ? ToolbarConstraints.Align.right : ToolbarConstraints.Align.left,
- true, true);
+ true, true, true);
ToolbarRow row = null; //TODO find / add row with the best available space
if( rows.isEmpty() ) {
row = new ToolbarRow();
--- a/core.windows/src/org/netbeans/core/windows/view/ui/toolbars/ToolbarConstraints.java
+++ a/core.windows/src/org/netbeans/core/windows/view/ui/toolbars/ToolbarConstraints.java
@@ -68,11 +68,14 @@
private final boolean draggable;
- public ToolbarConstraints( String name, Align align, boolean visible, boolean draggable ) {
+ private final boolean closeable;
+
+ public ToolbarConstraints( String name, Align align, boolean visible, boolean draggable, boolean closeable ) {
this.name = name;
this.draggable = draggable;
this.align = align;
this.visible = visible;
+ this.closeable = closeable;
}
public Align getAlign() {
@@ -83,6 +86,10 @@
this.align = align;
}
+ public boolean isCloseable() {
+ return closeable;
+ }
+
public boolean isDraggable() {
return draggable;
}
--- a/core.windows/src/org/netbeans/core/windows/view/ui/toolbars/ToolbarConvertor.java
+++ a/core.windows/src/org/netbeans/core/windows/view/ui/toolbars/ToolbarConvertor.java
@@ -78,6 +78,8 @@
private static final String ATT_TOOLBAR_VISIBLE = "visible"; // NOI18N
/** xml attribute for toolbar draggable */
private static final String ATT_TOOLBAR_DRAGGABLE = "draggable"; // NOI18N
+ /** xml attribute for toolbar closeable */
+ private static final String ATT_TOOLBAR_CLOSEABLE = "closeable"; // NOI18N
public static ToolbarConvertor create() {
return new ToolbarConvertor();
@@ -112,7 +114,7 @@
w.write(""); //NOI18N
w.newLine();
- w.write(""); //NOI18N
+ w.write(""); //NOI18N
w.newLine();
w.write("<"); w.write(TAG_CONFIGURATION); w.write(">"); //NOI18N
@@ -131,6 +133,8 @@
w.write(" "); //NOI18N
w.write(ATT_TOOLBAR_DRAGGABLE); w.write("=\""); w.write(tc.isDraggable() ? "true" : "false"); w.write("\""); //NOI18N
w.write(" "); //NOI18N
+ w.write(ATT_TOOLBAR_CLOSEABLE); w.write("=\""); w.write(tc.isCloseable() ? "true" : "false"); w.write("\""); //NOI18N
+ w.write(" "); //NOI18N
w.write(ATT_TOOLBAR_ALIGNMENT); w.write("=\""); w.write(tc.getAlign().toString()); w.write("\""); //NOI18N
w.write("/>"); //NOI18N
w.newLine();
@@ -180,12 +184,14 @@
boolean draggable = !"false".equals( attributes.getValue(ATT_TOOLBAR_DRAGGABLE) ); //NOI18N
+ boolean closeable = !"false".equals( attributes.getValue(ATT_TOOLBAR_CLOSEABLE) ); //NOI18N
+
//#154332 - HACK always dock quick search toolbar to the right
//needed when importing toolbar settings from nb 6.5
if( "QuickSearch".equals( barName ) ) {
align = ToolbarConstraints.Align.right;
}
- ToolbarConstraints tc = new ToolbarConstraints(barName, align, visible, draggable);
+ ToolbarConstraints tc = new ToolbarConstraints(barName, align, visible, draggable, closeable);
if( null != currentRow )
currentRow.addConstraint(tc);
}
--- a/core.windows/src/org/netbeans/core/windows/view/ui/toolbars/ToolbarRow.java
+++ a/core.windows/src/org/netbeans/core/windows/view/ui/toolbars/ToolbarRow.java
@@ -156,7 +156,7 @@
* visualize toolbar drop feedback.
*/
private void addDropConstraints() {
- dropConstraints = new ToolbarConstraints(FAKE_NAME, ToolbarConstraints.Align.left, false, true);
+ dropConstraints = new ToolbarConstraints(FAKE_NAME, ToolbarConstraints.Align.left, false, true, true);
dropReplacement = new JLabel();
dropReplacement.setName(dropConstraints.getName());
add( dropReplacement );
@@ -319,7 +319,7 @@
constraints.add( constraints.indexOf(dropConstraints), dragConstraints );
} else {
//we've got a new toolbar, create new constraints for it
- ToolbarConstraints newConstraints = new ToolbarConstraints( dropContainter.getName(), dropConstraints.getAlign(), true, true);
+ ToolbarConstraints newConstraints = new ToolbarConstraints( dropContainter.getName(), dropConstraints.getAlign(), true, true, true);
add( dropContainter );
constraints.add( constraints.indexOf(dropConstraints), newConstraints );
name2constraint.put(newConstraints.getName(), newConstraints);