Skip to content

Commit

Permalink
Working on Prisex24.2, backporint from Psx31
Browse files Browse the repository at this point in the history
  • Loading branch information
goga authored and goga committed Jun 14, 2023
1 parent 1e14859 commit fd560ca
Show file tree
Hide file tree
Showing 156 changed files with 1,784 additions and 450 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ eclipse.preferences.version=1
encoding//OSGI-INF/l10n/bundle.properties=UTF-8
encoding//OSGI-INF/l10n/bundle_ka_GE.properties=UTF-8
encoding//OSGI-INF/l10n/bundle_ru_RU.properties=UTF-8
encoding//src/com/hazard157/prisex24/m5/tags/messages.properties=UTF-8
encoding//src/com/hazard157/prisex24/m5/tags/messages_ka_GE.properties=UTF-8
encoding//src/com/hazard157/prisex24/m5/tags/messages_ru_RU.properties=UTF-8
encoding//src/com/hazard157/prisex24/m5/todos/messages_ka_GE.properties=UTF-8
encoding//src/com/hazard157/prisex24/m5/todos/messages_ru_RU.properties=UTF-8
encoding//src/com/hazard157/prisex24/messages.properties=UTF-8
Expand Down
6 changes: 5 additions & 1 deletion com.hazard157.prisex24/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ Bundle-SymbolicName: com.hazard157.prisex24;singleton:=true
Bundle-Version: 1.0.0.qualifier
Export-Package: com.hazard157.prisex24,
com.hazard157.prisex24.devel,
com.hazard157.prisex24.e4.addons
com.hazard157.prisex24.e4.addons,
com.hazard157.prisex24.e4.uiparts,
com.hazard157.prisex24.m5,
com.hazard157.prisex24.m5.tags,
com.hazard157.prisex24.m5.todos
Bundle-Activator: com.hazard157.prisex24.Activator
Bundle-Vendor: HAZARD157
Require-Bundle: javax.annotation,
Expand Down
2 changes: 2 additions & 0 deletions com.hazard157.prisex24/OSGI-INF/l10n/bundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ Uipart_Episodes_List = Episodes
Uipart_Episodes_List_D = Episodes list
Uipart_Refbook_Sourcevids = Source videos
Uipart_Refbook_Sourcevids_D = All source videos of all episodes
Uipart_Refbook_Tags = Tags
Uipart_Refbook_Tags_D = Working with the tags reference book
Uipart_Refbook_Todos = Todos
Uipart_Refbook_Todos_D = Work with a list of all tasks and todos
Uipart_Svins_Frames = Svins frames
Expand Down
2 changes: 2 additions & 0 deletions com.hazard157.prisex24/OSGI-INF/l10n/bundle_ka_GE.properties
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ Uipart_Episodes_List = ეპიზოდები
Uipart_Episodes_List_D = ეპიზოდების სია
Uipart_Refbook_Sourcevids = Source videos
Uipart_Refbook_Sourcevids_D = All source videos of all episodes
Uipart_Refbook_Tags = ტეგები
Uipart_Refbook_Tags_D = ტეგების საცნობარო წიგნთან მუშაობა
Uipart_Refbook_Todos = საქმეები
Uipart_Refbook_Todos_D = მუშაობა ყველა ამოცანისა და შემთხვევის ჩამონათვალით
Uipart_Svins_Frames = ინტერვალების კადრები
Expand Down
2 changes: 2 additions & 0 deletions com.hazard157.prisex24/OSGI-INF/l10n/bundle_ru_RU.properties
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ Uipart_Episodes_List = Эпизоды
Uipart_Episodes_List_D = Список эпизодов
Uipart_Refbook_Sourcevids = Исходные видео
Uipart_Refbook_Sourcevids_D = Список всех исходных видео всех эпизодов
Uipart_Refbook_Tags = Ярлыки
Uipart_Refbook_Tags_D = Работа со справочником ярлыков
Uipart_Refbook_Todos = Дела
Uipart_Refbook_Todos_D = Работа со списком всех задач и дел
Uipart_Svins_Frames = Кадры интервалов
Expand Down
1 change: 1 addition & 0 deletions com.hazard157.prisex24/fragment.e4xmi
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<elements xsi:type="advanced:Perspective" xmi:id="_3hJRcAqoEe6kmvIYOJ1hbQ" elementId="com.hazard157.prisex24.persp.refbooks" label="%Persp_Refbooks" iconURI="platform:/plugin/com.hazard157.common/icons/is24x24/refbooks-list.png" tooltip="%Persp_Refbooks_D">
<children xsi:type="basic:PartStack" xmi:id="_R3000AqqEe6kmvIYOJ1hbQ" elementId="com.hazard157.prisex24.partstack.refbooks">
<children xsi:type="basic:Part" xmi:id="_cc6_sAq0Ee6kmvIYOJ1hbQ" elementId="com.hazard157.prisex24.part.uipart_refbook_todos" contributionURI="bundleclass://com.hazard157.prisex24/com.hazard157.prisex24.e4.uiparts.UipartRefbookTodos" label="%Uipart_Refbook_Todos" iconURI="platform:/plugin/com.hazard157.prisex24/icons/is24x24/todos-list.png" tooltip="%Uipart_Refbook_Todos_D"/>
<children xsi:type="basic:Part" xmi:id="_NPDf0ArfEe6kmvIYOJ1hbQ" elementId="com.hazard157.prisex24.part.uipart_refbook_tags" accessibilityPhrase="" contributionURI="bundleclass://com.hazard157.prisex24/com.hazard157.prisex24.e4.uiparts.refbooks.UipartRefbookTags" label="%Uipart_Refbook_Tags" iconURI="platform:/plugin/com.hazard157.prisex24/icons/is24x24/tags-list.png" tooltip="%Uipart_Refbook_Tags_D"/>
</children>
</elements>
</fragments>
Expand Down
Binary file added com.hazard157.prisex24/icons/is128x128/tag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added com.hazard157.prisex24/icons/is16x16/tag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added com.hazard157.prisex24/icons/is24x24/tag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added com.hazard157.prisex24/icons/is32x32/tag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added com.hazard157.prisex24/icons/is48x48/tag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added com.hazard157.prisex24/icons/is64x64/tag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added com.hazard157.prisex24/icons/is96x96/tag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added com.hazard157.prisex24/icons/tag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added com.hazard157.prisex24/icons/tags-list.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ public interface IPrisex24CoreConstants {
String ICONID_TODO_ITEM = "todo-item"; //$NON-NLS-1$
String ICONID_TODO_ITEM_DIMMED = "todo-item-dimmed"; //$NON-NLS-1$
String ICONID_TODOS_LIST = "todos-list"; //$NON-NLS-1$
String ICONID_TAG = "tag"; //$NON-NLS-1$
String ICONID_TAGS_LIST = "tags-list"; //$NON-NLS-1$

/**
* Constants registration.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.hazard157.prisex24;

import org.toxsoft.core.tsgui.bricks.ctx.*;

import com.hazard157.common.e4.services.mps.*;
import com.hazard157.psx.proj3.episodes.*;

/**
* Extending {@link ITsGuiContextable} with PSX services.
*
* @author hazard157
*/
@SuppressWarnings( "javadoc" )
public interface IPsxGuiContextable
extends ITsGuiContextable {

default IUnitEpisodes unitEpisodes() {
return tsContext().get( IUnitEpisodes.class );
}

default IMediaPlayerService mediaPlayer() {
return tsContext().get( IMediaPlayerService.class );
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

import com.hazard157.prisex24.*;
import com.hazard157.prisex24.Activator;
import com.hazard157.prisex24.e4.services.currep.*;
import com.hazard157.prisex24.m5.tags.*;
import com.hazard157.prisex24.m5.todos.*;
import com.hazard157.psx.proj3.*;

Expand Down Expand Up @@ -54,6 +56,8 @@ protected void initApp( IEclipseContext aAppContext ) {
EModelService modelService = aAppContext.get( EModelService.class );
MTrimmedWindow mainWindow = (MTrimmedWindow)modelService.find( IMwsCoreConstants.MWSID_WINDOW_MAIN, app );
mainWindow.setIconURI( TsIconManagerUtils.makeStdIconUriString( PLUGIN_ID, ICONID_APP_ICON, IS_48X48 ) );
// E4 services
aAppContext.set( ICurrentEpisodeService.class, new CurrentEpisodeService( aAppContext ) );
}

@Override
Expand All @@ -63,6 +67,7 @@ protected void initWin( IEclipseContext aWinContext ) {
IM5Domain m5 = aWinContext.get( IM5Domain.class );
m5.addModel( new FulfilStageM5Model() );
m5.addModel( new TodoM5Model() );
m5.addModel( new TagM5Model() );

// DEBUG --- resource tracking
Resource.setNonDisposeHandler( aT -> {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package com.hazard157.prisex24.e4.services.currep;

import org.eclipse.e4.core.contexts.*;
import org.toxsoft.core.tsgui.mws.services.currentity.*;
import org.toxsoft.core.tslib.coll.helpers.*;
import org.toxsoft.core.tslib.utils.errors.*;

import com.hazard157.psx.proj3.episodes.*;

/**
* {@link ICurrentEpisodeService} implementation.
*
* @author hazard157
*/
public class CurrentEpisodeService
extends CurrentEntityService<IEpisode>
implements ICurrentEpisodeService {

private final IUnitEpisodes unitEpisodes;

/**
* Конструктор.
*
* @param aAppContext {@link IEclipseContext} - контекст приложения
* @throws TsNullArgumentRtException аргумент = null
*/
public CurrentEpisodeService( IEclipseContext aAppContext ) {
super( aAppContext );
unitEpisodes = appContext().get( IUnitEpisodes.class );
}

@Override
public void select( ETsCollMove aDirection ) {
TsNullArgumentRtException.checkNull( aDirection );
IEpisode toSel = aDirection.findElemAt( current(), unitEpisodes.items(), 5, true );
setCurrent( toSel );
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.hazard157.prisex24.e4.services.currep;

import org.toxsoft.core.tsgui.mws.services.currentity.*;
import org.toxsoft.core.tslib.coll.helpers.*;
import org.toxsoft.core.tslib.utils.errors.*;

import com.hazard157.psx.proj3.episodes.*;

/**
* The concept of "current episode in the application".
*
* @author hazard157
*/
public interface ICurrentEpisodeService
extends ICurrentEntityService<IEpisode> {

/**
* Selects episode in the given direction.
*
* @param aDirection {@link ETsCollMove} - the direction
* @throws TsNullArgumentRtException any argument = <code>null</code>
*/
void select( ETsCollMove aDirection );

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.hazard157.prisex24.e4.uiparts;

import org.toxsoft.core.tsgui.mws.bases.*;

import com.hazard157.prisex24.*;

/**
* Extends {@link MwsAbstractPart} with {@link IPsxGuiContextable}.
*
* @author hazard157
*/
public abstract class PsxAbstractUipart
extends MwsAbstractPart
implements IPsxGuiContextable {

// nop

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
package com.hazard157.prisex24.e4.uiparts.episodes;

import static com.hazard157.prisex24.m5.IPsxM5Constants.*;
import static org.toxsoft.core.tsgui.m5.gui.mpc.IMultiPaneComponentConstants.*;
import static org.toxsoft.core.tslib.av.impl.AvUtils.*;

import javax.inject.*;

import org.eclipse.swt.widgets.*;
import org.toxsoft.core.tsgui.bricks.ctx.*;
import org.toxsoft.core.tsgui.bricks.ctx.impl.*;
import org.toxsoft.core.tsgui.graphics.icons.*;
import org.toxsoft.core.tsgui.graphics.image.*;
import org.toxsoft.core.tsgui.m5.*;
import org.toxsoft.core.tsgui.m5.gui.panels.*;
import org.toxsoft.core.tsgui.m5.model.*;
import org.toxsoft.core.tsgui.utils.layout.*;

import com.hazard157.prisex24.e4.services.currep.*;
import com.hazard157.prisex24.e4.uiparts.*;
import com.hazard157.psx.proj3.episodes.*;

/**
* UIpart: list of episodes with selection synchronized with {@link ICurrentEpisodeService#current()}.
*
* @author hazard157
*/
public class UipartEpisodesList
extends PsxAbstractUipart {

@Inject
ICurrentEpisodeService currentEpisodeService;

IM5Model<IEpisode> model;
IM5CollectionPanel<IEpisode> panel;
IUnitEpisodes unitEpisodes;

@Override
protected void doInit( Composite aParent ) {
currentEpisodeService.addCurrentEntityChangeListener( c -> updateCurrentEpisode() );
model = m5().getModel( MID_EPISODE, IEpisode.class );
ITsGuiContext ctx = new TsGuiContext( tsContext() );
OPDEF_IS_FILTER_PANE.setValue( ctx.params(), AV_TRUE );
OPDEF_NODE_THUMB_SIZE.setValue( ctx.params(), avValobj( EThumbSize.SZ180 ) );
OPDEF_NODE_ICON_SIZE.setValue( ctx.params(), avValobj( EIconSize.IS_64X64 ) );
IM5LifecycleManager<IEpisode> lm = model.getLifecycleManager( null );
panel = model.panelCreator().createCollEditPanel( ctx, lm.itemsProvider(), lm );
aParent.setLayout( new BorderLayout() );
panel.createControl( aParent );
panel.getControl().setLayoutData( BorderLayout.CENTER );
panel.addTsSelectionListener( ( src, sel ) -> currentEpisodeService.setCurrent( sel ) );
updateCurrentEpisode();
}

void updateCurrentEpisode() {
panel.setSelectedItem( currentEpisodeService.current() );
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package com.hazard157.prisex24.e4.uiparts.refbooks;

import javax.inject.*;

import org.eclipse.swt.widgets.*;
import org.toxsoft.core.tsgui.bricks.ctx.*;
import org.toxsoft.core.tsgui.bricks.ctx.impl.*;
import org.toxsoft.core.tsgui.m5.*;
import org.toxsoft.core.tsgui.m5.gui.panels.*;
import org.toxsoft.core.tsgui.m5.model.*;

import com.hazard157.prisex24.e4.uiparts.*;
import com.hazard157.prisex24.m5.*;
import com.hazard157.psx.proj3.tags.*;

/**
* UIpart: tags refbook editor.
*
* @author hazard157
*/
public class UipartRefbookTags
extends PsxAbstractUipart {

@Inject
IRootTag rootTag;

@Override
protected void doInit( Composite aParent ) {
IM5Model<ITag> model = m5().getModel( IPsxM5Constants.MID_TAG, ITag.class );
ITsGuiContext ctx = new TsGuiContext( tsContext() );
IM5LifecycleManager<ITag> lm = model.getLifecycleManager( rootTag );
// DETAILS_PANE_PLACEMENT.setValue( ctx.params(), EBorderLayoutPlacement.SOUTH );
IM5CollectionPanel<ITag> panel = model.panelCreator().createCollEditPanel( ctx, lm.itemsProvider(), lm );
panel.createControl( aParent );
}

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.hazard157.prisex24.e4.uiparts;
package com.hazard157.prisex24.e4.uiparts.refbooks;

import javax.inject.*;

Expand All @@ -8,8 +8,8 @@
import org.toxsoft.core.tsgui.m5.*;
import org.toxsoft.core.tsgui.m5.gui.panels.*;
import org.toxsoft.core.tsgui.m5.model.*;
import org.toxsoft.core.tsgui.mws.bases.*;

import com.hazard157.prisex24.e4.uiparts.*;
import com.hazard157.prisex24.m5.*;
import com.hazard157.psx.proj3.todos.*;

Expand All @@ -19,7 +19,7 @@
* @author hazard157
*/
public class UipartRefbookTodos
extends MwsAbstractPart {
extends PsxAbstractUipart {

@Inject
IUnitTodos unitTodos;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
@SuppressWarnings( "javadoc" )
public interface IPsxM5Constants {

String MID_EPISODE = PSX_ID + ".Episode"; //$NON-NLS-1$

String MID_TODO = PSX_ID + ".Todo"; //$NON-NLS-1$
String FID_NOTE = "Note"; //$NON-NLS-1$
String FID_CREATION_TIME = "CreationTime"; //$NON-NLS-1$
Expand All @@ -23,4 +25,6 @@ public interface IPsxM5Constants {
String MID_FULFIL_STAGE = PSX_ID + "FulfilStage"; //$NON-NLS-1$
String FID_WHEN = "When"; //$NON-NLS-1$

String MID_TAG = PSX_ID + ".Tag"; //$NON-NLS-1$

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package com.hazard157.prisex24.m5.tags;

/**
* Localizable resources.
*
* @author hazard157
*/
interface IPsxResource {

/**
* {@link TagLifecycleManager}
*/
String MSG_ERR_TAG_INV_MASTER_OBJ = Messages.getString( "MSG_ERR_TAG_INV_MASTER_OBJ" ); //$NON-NLS-1$
String FMT_ERR_CANT_MAKE_CHILDED_NODE_LEAF = Messages.getString( "FMT_ERR_CANT_MAKE_CHILDED_NODE_LEAF" ); //$NON-NLS-1$
String FMT_ERR_TAG_NAME_ALREADY_EXISTS = Messages.getString( "FMT_ERR_TAG_NAME_ALREADY_EXISTS" ); //$NON-NLS-1$
String FMT_WARN_REMOVE_TAG_WITH_CHILDS = Messages.getString( "FMT_WARN_REMOVE_TAG_WITH_CHILDS" ); //$NON-NLS-1$

/**
* {@link TagM5Model}
*/
String STR_TAG = Messages.getString( "STR_TAG" ); //$NON-NLS-1$
String STR_TAG_D = Messages.getString( "STR_TAG_D" ); //$NON-NLS-1$
String STR_TAG_ID = Messages.getString( "STR_TAG_ID" ); //$NON-NLS-1$
String STR_TAG_ID_D = Messages.getString( "STR_TAG_ID_D" ); //$NON-NLS-1$
String STR_TAG_NAME = Messages.getString( "STR_TAG_NAME" ); //$NON-NLS-1$
String STR_TAG_NAME_D = Messages.getString( "STR_TAG_NAME_D" ); //$NON-NLS-1$

/**
* {@link TagMpc}
*/
String STR_TMI_BY_GROUP = Messages.getString( "STR_TMI_BY_GROUP" ); //$NON-NLS-1$
String STR_TMI_BY_GROUP_D = Messages.getString( "STR_TMI_BY_GROUP_D" ); //$NON-NLS-1$
String FMT_ERR_NO_CHILDS_IN_LEAF = Messages.getString( "FMT_ERR_NO_CHILDS_IN_LEAF" ); //$NON-NLS-1$
String DLG_FMT_NEW_CHILD_TAG_D = Messages.getString( "DLG_FMT_NEW_CHILD_TAG_D" ); //$NON-NLS-1$
String DLG_NEW_ROOT_TAG_D = Messages.getString( "DLG_NEW_ROOT_TAG_D" ); //$NON-NLS-1$
String DLG_NEW_TAG = Messages.getString( "DLG_NEW_TAG" ); //$NON-NLS-1$

}
Loading

0 comments on commit fd560ca

Please sign in to comment.