1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-03 07:05:24 +02:00

[183631] fixing date formats & wayward english encoding message

This commit is contained in:
David Dykstal 2007-05-29 14:07:04 +00:00
parent 1604d47c7c
commit 9424135bde
5 changed files with 24 additions and 10 deletions

View file

@ -36,3 +36,5 @@ Export-Package: org.eclipse.rse.files.ui,
org.eclipse.rse.internal.files.ui.wizards;x-internal:=true
Bundle-Vendor: %providerName
Bundle-RequiredExecutionEnvironment: J2SE-1.4
Import-Package: com.ibm.icu.lang;version="3.6.1",
com.ibm.icu.text;version="3.6.1"

View file

@ -289,6 +289,9 @@ public class FileResources extends NLS
public static String ACTION_SELECT_FILE_LABEL;
public static String ACTION_SELECT_FILE_TOOLTIP;
// Property Pages
public static String MESSAGE_ENCODING_NOT_SUPPORTED;
static
{
// load message values from bundle file

View file

@ -287,4 +287,9 @@ ACTION_NEWFOLDER_TOOLTIP=Create a new Folder
ACTION_SELECT_DIRECTORY_LABEL=Browse...
ACTION_SELECT_DIRECTORY_TOOLTIP=Select folder from remote system
ACTION_SELECT_FILE_LABEL=Browse...
ACTION_SELECT_FILE_TOOLTIP=Select file from remote system
ACTION_SELECT_FILE_TOOLTIP=Select file from remote system
#=============================================================
# Property Pages...
#=============================================================
MESSAGE_ENCODING_NOT_SUPPORTED=The selected encoding is not supported.

View file

@ -20,14 +20,13 @@
package org.eclipse.rse.internal.files.ui.propertypages;
import java.nio.charset.Charset;
import java.nio.charset.IllegalCharsetNameException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.rse.core.RSECorePlugin;
import org.eclipse.rse.core.events.ISystemResourceChangeEvents;
import org.eclipse.rse.internal.files.ui.FileResources;
import org.eclipse.rse.internal.subsystems.files.core.SystemFileResources;
import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
import org.eclipse.rse.services.files.RemoteFileIOException;
@ -55,6 +54,8 @@ import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.ui.ide.IDEEncoding;
import com.ibm.icu.text.DateFormat;
/**
* The remote property page for remote file properties.
@ -302,7 +303,8 @@ public class SystemFilePropertyPage extends SystemBasePropertyPage
clearErrorMessage();
}
else {
setErrorMessage("The selected encoding is not supported.");
// TODO make this a SystemMessage
setErrorMessage(FileResources.MESSAGE_ENCODING_NOT_SUPPORTED);
}
}
}
@ -400,8 +402,9 @@ public class SystemFilePropertyPage extends SystemBasePropertyPage
Date date = file.getLastModifiedDate();
if (date != null)
{
SimpleDateFormat datefmt = (SimpleDateFormat)DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL);
labelModified.setText(datefmt.format(date));
DateFormat datefmt = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.FULL);
String formattedDate = datefmt.format(date);
labelModified.setText(formattedDate);
}
}
// readonly

View file

@ -26,9 +26,7 @@
package org.eclipse.rse.internal.files.ui.view;
import java.io.File;
import java.text.DateFormat;
import java.text.NumberFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
@ -147,6 +145,8 @@ import org.eclipse.ui.progress.IElementCollector;
import org.eclipse.ui.views.properties.IPropertyDescriptor;
import org.eclipse.ui.views.properties.PropertyDescriptor;
import com.ibm.icu.text.DateFormat;
/**
* Adapter for displaying remote file system objects in tree views.
* These are children of RemoteFileSubSystem filter strings
@ -1201,8 +1201,9 @@ public class SystemViewRemoteFileAdapter
{
if (formatted)
{
SimpleDateFormat datefmt = (SimpleDateFormat) DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.MEDIUM);
return datefmt.format(date);
DateFormat datefmt = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.MEDIUM);
String formattedDate = datefmt.format(date);
return formattedDate;
}
else
{