package com.perforce.p4simulink.ui; /** * Copyright (C) 2014 Perforce Software. All rights reserved. * * Please see LICENSE.txt in top-level folder of this distribution. */ import javax.swing.*; import java.io.File; import java.io.FileWriter; import java.util.ArrayList; import java.util.List; public class P4IgnoreDialogue extends P4Pane { public static final int UNSAVED = 0; public static final int SAVED = 1; private JTextArea contents; private File file; public P4IgnoreDialogue(String current, File ignoreFile) { contents = new JTextArea(current != null ? current : ""); file = ignoreFile; } public Object[] getFields() { List<Object> fields = new ArrayList<>(); fields.add(".p4ignore Contents: "); fields.add(contents); return fields.toArray(); } public int save() { if (file == null || !file.canWrite()) { // can't save it return UNSAVED; } try { FileWriter writer = new FileWriter(file); writer.write(contents.getText()); writer.close(); } catch (Exception e) { return UNSAVED; } return SAVED; } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#4 | 12023 | Paul Allen | Copying using p4Simulink_dev->main | ||
#3 | 11672 | Paul Allen |
Tidy up formatting and imports. No functional change. |
||
#2 | 11659 | Paul Allen |
Performance improvements, continued: improved performance of getFileState() by replacing the client haveList call with a direct server command. Also improved isLatest by removing fstat calls and replacing with simpler calls to diff and sync. Transferred from p4://perforce.perforce.com:1666@983506 |
||
#1 | 11656 | Paul Allen |
Additional functionality from Scania meeting, including current changelist selector (still needs descriptions added) as well as .p4ignore editor. Transferred from p4://perforce.perforce.com:1666@978388 |