1 package ch
.cyberduck
.ui
.cocoa
;
4 * Copyright (c) 2008 David Kocher. All rights reserved.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * Bug fixes, suggestions and comments should be sent to:
18 * dkocher@cyberduck.ch
21 import ch
.cyberduck
.core
.preferences
.PreferencesFactory
;
22 import ch
.cyberduck
.binding
.application
.NSFont
;
23 import ch
.cyberduck
.binding
.application
.NSMutableParagraphStyle
;
24 import ch
.cyberduck
.binding
.application
.NSParagraphStyle
;
25 import ch
.cyberduck
.binding
.application
.NSText
;
26 import ch
.cyberduck
.binding
.foundation
.NSArray
;
27 import ch
.cyberduck
.binding
.foundation
.NSAttributedString
;
28 import ch
.cyberduck
.binding
.foundation
.NSDictionary
;
33 public final class TableCellAttributes
{
35 private TableCellAttributes() {
39 public static final NSMutableParagraphStyle PARAGRAPH_STYLE_LEFT_ALIGNMENT_TRUNCATE_MIDDLE
;
42 PARAGRAPH_STYLE_LEFT_ALIGNMENT_TRUNCATE_MIDDLE
= NSMutableParagraphStyle
.paragraphStyle();
43 PARAGRAPH_STYLE_LEFT_ALIGNMENT_TRUNCATE_MIDDLE
.setParagraphStyle(NSParagraphStyle
.defaultParagraphStyle());
44 PARAGRAPH_STYLE_LEFT_ALIGNMENT_TRUNCATE_MIDDLE
.setAlignment(NSText
.NSLeftTextAlignment
);
45 PARAGRAPH_STYLE_LEFT_ALIGNMENT_TRUNCATE_MIDDLE
.setLineBreakMode(NSParagraphStyle
.NSLineBreakByTruncatingMiddle
);
48 public static final NSMutableParagraphStyle PARAGRAPH_STYLE_LEFT_ALIGNMENT_TRUNCATE_TAIL
;
51 PARAGRAPH_STYLE_LEFT_ALIGNMENT_TRUNCATE_TAIL
= NSMutableParagraphStyle
.paragraphStyle();
52 PARAGRAPH_STYLE_LEFT_ALIGNMENT_TRUNCATE_TAIL
.setParagraphStyle(NSParagraphStyle
.defaultParagraphStyle());
53 PARAGRAPH_STYLE_LEFT_ALIGNMENT_TRUNCATE_TAIL
.setAlignment(NSText
.NSLeftTextAlignment
);
54 PARAGRAPH_STYLE_LEFT_ALIGNMENT_TRUNCATE_TAIL
.setLineBreakMode(NSParagraphStyle
.NSLineBreakByTruncatingTail
);
57 public static final NSMutableParagraphStyle PARAGRAPH_STYLE_RIGHT_ALIGNMENT_TRUNCATE_TAIL
;
60 PARAGRAPH_STYLE_RIGHT_ALIGNMENT_TRUNCATE_TAIL
= NSMutableParagraphStyle
.paragraphStyle();
61 PARAGRAPH_STYLE_RIGHT_ALIGNMENT_TRUNCATE_TAIL
.setParagraphStyle(NSParagraphStyle
.defaultParagraphStyle());
62 PARAGRAPH_STYLE_RIGHT_ALIGNMENT_TRUNCATE_TAIL
.setAlignment(NSText
.NSRightTextAlignment
);
63 PARAGRAPH_STYLE_RIGHT_ALIGNMENT_TRUNCATE_TAIL
.setLineBreakMode(NSParagraphStyle
.NSLineBreakByTruncatingTail
);
66 public static final NSDictionary BROWSER_FONT_ATTRIBUTES_LEFT_ALIGNMENT
= NSDictionary
.dictionaryWithObjectsForKeys(
67 NSArray
.arrayWithObjects(NSFont
.systemFontOfSize(PreferencesFactory
.get().getFloat("browser.font.size")), PARAGRAPH_STYLE_LEFT_ALIGNMENT_TRUNCATE_MIDDLE
),
68 NSArray
.arrayWithObjects(NSAttributedString
.FontAttributeName
, NSAttributedString
.ParagraphStyleAttributeName
)
71 public static NSDictionary
browserFontLeftAlignment() {
72 return BROWSER_FONT_ATTRIBUTES_LEFT_ALIGNMENT
;
75 public static final NSDictionary BROWSER_FONT_ATTRIBUTES_RIGHT_ALIGNMENT
= NSDictionary
.dictionaryWithObjectsForKeys(
76 NSArray
.arrayWithObjects(NSFont
.systemFontOfSize(PreferencesFactory
.get().getFloat("browser.font.size")), PARAGRAPH_STYLE_RIGHT_ALIGNMENT_TRUNCATE_TAIL
),
77 NSArray
.arrayWithObjects(NSAttributedString
.FontAttributeName
, NSAttributedString
.ParagraphStyleAttributeName
)
80 public static NSDictionary
browserFontRightAlignment() {
81 return BROWSER_FONT_ATTRIBUTES_RIGHT_ALIGNMENT
;